[PATCH] D131653: [LegalizeTypes][NFC] Use getConstantOperandAPInt instead of cast constant getAPInt
    Simon Pilgrim via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Aug 11 02:51:13 PDT 2022
    
    
  
RKSimon added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:1558
 
-  APInt MulImm = cast<ConstantSDNode>(N->getOperand(0))->getAPIntValue();
+  APInt MulImm = N->getConstantOperandAPInt(0);
   return DAG.getVScale(SDLoc(N), VT, MulImm.sext(VT.getSizeInBits()));
----------------
const APInt &
================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:5355
          "Type must be promoted to a scalable vector type");
-  APInt StepVal = cast<ConstantSDNode>(N->getOperand(0))->getAPIntValue();
+  APInt StepVal = N->getConstantOperandAPInt(0);
   return DAG.getStepVector(dl, NOutVT,
----------------
const APInt &
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131653/new/
https://reviews.llvm.org/D131653
    
    
More information about the llvm-commits
mailing list