[SelectionDAG] getShiftAmountConstant - assert the type is an integer.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 22 Jan 2020 13:52:26 +0000 (13:52 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 22 Jan 2020 13:52:44 +0000 (13:52 +0000)
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 94e5011..0421c6a 100644 (file)
@@ -1332,6 +1332,7 @@ SDValue SelectionDAG::getIntPtrConstant(uint64_t Val, const SDLoc &DL,
 
 SDValue SelectionDAG::getShiftAmountConstant(uint64_t Val, EVT VT,
                                              const SDLoc &DL, bool LegalTypes) {
+  assert(VT.isInteger() && "Shift amount is not an integer type!");
   EVT ShiftVT = TLI->getShiftAmountTy(VT, getDataLayout(), LegalTypes);
   return getConstant(Val, DL, ShiftVT);
 }