diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2024-01-09 15:08:25 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2024-01-09 15:08:25 +0000 |
commit | e9ac2dc68d0b0578a5c1a98b4e083d133c1d7b2b (patch) | |
tree | f73f47561e0fcf21e269a8949522043e6667f4e0 | |
parent | 06286a553280fc843d6f5df477a2c776aa2ece35 (diff) |
[DAG] XformToShuffleWithZero - use dyn_cast instead of isa/cast pair. NFCI.
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 8 |
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(); |