diff options
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp | 2 | ||||
| -rw-r--r-- | llvm/test/Transforms/InstCombine/shift.ll | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp index 6cf64c26172..55b37f0fe62 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp @@ -773,7 +773,7 @@ Instruction *InstCombiner::visitLShr(BinaryOperator &I) { return NewLShr; } // (X << C1) >>u C2 --> (X >>u (C2 - C1)) & (-1 >> C2) - Value *NewLShr = Builder->CreateLShr(X, ShiftDiff); + Value *NewLShr = Builder->CreateLShr(X, ShiftDiff, "", I.isExact()); APInt Mask(APInt::getLowBitsSet(BitWidth, BitWidth - ShAmt)); return BinaryOperator::CreateAnd(NewLShr, ConstantInt::get(Ty, Mask)); } diff --git a/llvm/test/Transforms/InstCombine/shift.ll b/llvm/test/Transforms/InstCombine/shift.ll index ac9b7e1c37f..5e8b4cb3250 100644 --- a/llvm/test/Transforms/InstCombine/shift.ll +++ b/llvm/test/Transforms/InstCombine/shift.ll @@ -937,7 +937,7 @@ define <2 x i32> @test51_splat_vec(<2 x i32> %x) { define i32 @test51_no_nuw(i32 %x) { ; CHECK-LABEL: @test51_no_nuw( -; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 %x, 2 +; CHECK-NEXT: [[TMP1:%.*]] = lshr exact i32 %x, 2 ; CHECK-NEXT: [[B:%.*]] = and i32 [[TMP1]], 536870911 ; CHECK-NEXT: ret i32 [[B]] ; |

