diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-01 11:11:05 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-11 11:01:12 +0100 |
commit | 0e322c8a1f20ab04ce4f6bc538846859707f2d69 (patch) | |
tree | 219da3e984af3a2436c82651a761d2a11ea881f1 /llvm/test/Transforms/InstCombine | |
parent | 81a3d987ced0905bef2e3055bf77ec174bb631c7 (diff) | |
download | bcm5719-llvm-0e322c8a1f20ab04ce4f6bc538846859707f2d69.tar.gz bcm5719-llvm-0e322c8a1f20ab04ce4f6bc538846859707f2d69.zip |
[InstCombine] Preserve nuw on sub of geps (PR44419)
Fix https://bugs.llvm.org/show_bug.cgi?id=44419 by preserving the
nuw on sub of geps. We only do this if the offset has a multiplication
as the final operation, as we can't be sure the operations is nuw
in the other cases without more thorough analysis.
Differential Revision: https://reviews.llvm.org/D72048
Diffstat (limited to 'llvm/test/Transforms/InstCombine')
-rw-r--r-- | llvm/test/Transforms/InstCombine/sub-gep.ll | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/test/Transforms/InstCombine/sub-gep.ll b/llvm/test/Transforms/InstCombine/sub-gep.ll index 0b3f08345a4..5798614c729 100644 --- a/llvm/test/Transforms/InstCombine/sub-gep.ll +++ b/llvm/test/Transforms/InstCombine/sub-gep.ll @@ -16,7 +16,7 @@ define i64 @test_inbounds([0 x i32]* %base, i64 %idx) { define i64 @test_inbounds_nuw([0 x i32]* %base, i64 %idx) { ; CHECK-LABEL: @test_inbounds_nuw( -; CHECK-NEXT: [[P2_IDX:%.*]] = shl nsw i64 [[IDX:%.*]], 2 +; CHECK-NEXT: [[P2_IDX:%.*]] = shl nuw nsw i64 [[IDX:%.*]], 2 ; CHECK-NEXT: ret i64 [[P2_IDX]] ; %p1 = getelementptr inbounds [0 x i32], [0 x i32]* %base, i64 0, i64 0 |