summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2024-01-09 15:08:25 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2024-01-09 15:08:25 +0000
commite9ac2dc68d0b0578a5c1a98b4e083d133c1d7b2b (patch)
treef73f47561e0fcf21e269a8949522043e6667f4e0
parent06286a553280fc843d6f5df477a2c776aa2ece35 (diff)
[DAG] XformToShuffleWithZero - use dyn_cast instead of isa/cast pair. NFCI.
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 8b70148d8ce7..58c8ccfb63ea 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -26542,10 +26542,10 @@ SDValue DAGCombiner::XformToShuffleWithZero(SDNode *N) {
}
APInt Bits;
- if (isa<ConstantSDNode>(Elt))
- Bits = Elt->getAsAPIntVal();
- else if (isa<ConstantFPSDNode>(Elt))
- Bits = cast<ConstantFPSDNode>(Elt)->getValueAPF().bitcastToAPInt();
+ if (auto *Cst = dyn_cast<ConstantSDNode>(Elt))
+ Bits = Cst->getAPIntValue();
+ else if (auto *CstFP = dyn_cast<ConstantFPSDNode>(Elt))
+ Bits = CstFP->getValueAPF().bitcastToAPInt();
else
return SDValue();