[llvm] 80656fd - [SelectionDAG] getShiftAmountConstant - assert the type is an integer.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 05:54:34 PST 2020


Author: Simon Pilgrim
Date: 2020-01-22T13:52:44Z
New Revision: 80656fd7aef05bce5fe7ee0ab61220c01455018f

URL: https://github.com/llvm/llvm-project/commit/80656fd7aef05bce5fe7ee0ab61220c01455018f
DIFF: https://github.com/llvm/llvm-project/commit/80656fd7aef05bce5fe7ee0ab61220c01455018f.diff

LOG: [SelectionDAG] getShiftAmountConstant - assert the type is an integer.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 94e5011576cd..0421c6ad5e49 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -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);
 }


        


More information about the llvm-commits mailing list