[SelectionDAG] Use INT_MIN as (1 << 31) is UB for signed integers. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 3 May 2019 11:32:00 +0000 (11:32 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 3 May 2019 11:32:00 +0000 (11:32 +0000)
llvm-svn: 359873

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index f3099e3..7b31f5d 100644 (file)
@@ -9056,7 +9056,7 @@ unsigned SelectionDAG::InferPtrAlignment(SDValue Ptr) const {
 
   // If this is a direct reference to a stack slot, use information about the
   // stack slot's alignment.
-  int FrameIdx = 1 << 31;
+  int FrameIdx = INT_MIN;
   int64_t FrameOffset = 0;
   if (FrameIndexSDNode *FI = dyn_cast<FrameIndexSDNode>(Ptr)) {
     FrameIdx = FI->getIndex();
@@ -9067,7 +9067,7 @@ unsigned SelectionDAG::InferPtrAlignment(SDValue Ptr) const {
     FrameOffset = Ptr.getConstantOperandVal(1);
   }
 
-  if (FrameIdx != (1 << 31)) {
+  if (FrameIdx != INT_MIN) {
     const MachineFrameInfo &MFI = getMachineFunction().getFrameInfo();
     unsigned FIInfoAlign = MinAlign(MFI.getObjectAlignment(FrameIdx),
                                     FrameOffset);