[llvm] 1303057 - [LegalizeTypes][NFC] Use dyn_cast instead of isa and cast

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 23:19:09 PDT 2022


Author: wanglian
Date: 2022-08-12T14:18:49+08:00
New Revision: 1303057888912d5f6513aed1be027d20156538a6

URL: https://github.com/llvm/llvm-project/commit/1303057888912d5f6513aed1be027d20156538a6
DIFF: https://github.com/llvm/llvm-project/commit/1303057888912d5f6513aed1be027d20156538a6.diff

LOG: [LegalizeTypes][NFC] Use dyn_cast instead of isa and cast

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D131544

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index bd0f09fc2f05..8f0278812c12 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -3033,8 +3033,8 @@ SDValue DAGTypeLegalizer::SplitVecOp_EXTRACT_VECTOR_ELT(SDNode *N) {
   SDValue Idx = N->getOperand(1);
   EVT VecVT = Vec.getValueType();
 
-  if (isa<ConstantSDNode>(Idx)) {
-    uint64_t IdxVal = cast<ConstantSDNode>(Idx)->getZExtValue();
+  if (const ConstantSDNode *Index = dyn_cast<ConstantSDNode>(Idx)) {
+    uint64_t IdxVal = Index->getZExtValue();
 
     SDValue Lo, Hi;
     GetSplitVector(Vec, Lo, Hi);


        


More information about the llvm-commits mailing list