diff options
author | Philip Reames <listmail@philipreames.com> | 2016-03-04 22:27:39 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2016-03-04 22:27:39 +0000 |
commit | a0c9f6e73622e7f040d827850acbdfcbde945998 (patch) | |
tree | 351e3d2ba308dc5a7bb8b764ac377ec7e341f571 /llvm/test/Transforms/CorrelatedValuePropagation/range.ll | |
parent | ecdc98fdaea83d9d4750d93316ba1b2b277d1c51 (diff) | |
download | bcm5719-llvm-a0c9f6e73622e7f040d827850acbdfcbde945998.tar.gz bcm5719-llvm-a0c9f6e73622e7f040d827850acbdfcbde945998.zip |
[LVI] Fix a bug which prevented use of !range metadata within a query
The diff is relatively large since I took a chance to rearrange the code I had to touch in a more obvious way, but the key bit is merely using the !range metadata when we can't analyze the instruction further. The previous !range metadata code was essentially just dead since no binary operator or cast will have !range metadata (per Verifier) and it was otherwise dropped on the floor.
llvm-svn: 262751
Diffstat (limited to 'llvm/test/Transforms/CorrelatedValuePropagation/range.ll')
-rw-r--r-- | llvm/test/Transforms/CorrelatedValuePropagation/range.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/Transforms/CorrelatedValuePropagation/range.ll b/llvm/test/Transforms/CorrelatedValuePropagation/range.ll index 884cc8bdc12..8ca171a286c 100644 --- a/llvm/test/Transforms/CorrelatedValuePropagation/range.ll +++ b/llvm/test/Transforms/CorrelatedValuePropagation/range.ll @@ -189,3 +189,17 @@ define i1 @test10(i64* %p) { %res = icmp eq i64 %a, 0 ret i1 %res } + +@g = external global i32 + +define i1 @test11() { +; CHECK: @test11 +; CHECK: ret i1 true + %positive = load i32, i32* @g, !range !{i32 1, i32 2048} + %add = add i32 %positive, 1 + %test = icmp sgt i32 %add, 0 + br label %next + +next: + ret i1 %test +} |