diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-09-15 15:48:53 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-09-15 15:48:53 +0000 |
| commit | e957f1fe2c871443eb3dc5c723a6311e21bc6ee7 (patch) | |
| tree | 687c1f216c465f3bd155e2bdd147b34535623b2a /llvm/test/Transforms | |
| parent | 78582b2adae13261f03555ad54c90d023456b50f (diff) | |
| download | bcm5719-llvm-e957f1fe2c871443eb3dc5c723a6311e21bc6ee7.tar.gz bcm5719-llvm-e957f1fe2c871443eb3dc5c723a6311e21bc6ee7.zip | |
[InstCombine] auto-generate checks
llvm-svn: 281621
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/min-positive.ll | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/llvm/test/Transforms/InstCombine/min-positive.ll b/llvm/test/Transforms/InstCombine/min-positive.ll index 9bbdb2944a3..82d1799f653 100644 --- a/llvm/test/Transforms/InstCombine/min-positive.ll +++ b/llvm/test/Transforms/InstCombine/min-positive.ll @@ -1,10 +1,13 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt -S -instcombine < %s | FileCheck %s @g = external global i32 define i1 @test(i32 %other) { -; CHECK-LABEL: @test -; CHECK: %test = icmp sgt i32 %other, 0 +; CHECK-LABEL: @test( +; CHECK-NEXT: [[TEST:%.*]] = icmp sgt i32 %other, 0 +; CHECK-NEXT: ret i1 [[TEST]] +; %positive = load i32, i32* @g, !range !{i32 1, i32 2048} %cmp = icmp slt i32 %positive, %other %sel = select i1 %cmp, i32 %positive, i32 %other @@ -13,8 +16,10 @@ define i1 @test(i32 %other) { } define i1 @test2(i32 %other) { -; CHECK-LABEL: @test2 -; CHECK: %test = icmp sgt i32 %other, 0 +; CHECK-LABEL: @test2( +; CHECK-NEXT: [[TEST:%.*]] = icmp sgt i32 %other, 0 +; CHECK-NEXT: ret i1 [[TEST]] +; %positive = load i32, i32* @g, !range !{i32 1, i32 2048} %cmp = icmp slt i32 %other, %positive %sel = select i1 %cmp, i32 %other, i32 %positive @@ -24,8 +29,13 @@ define i1 @test2(i32 %other) { ; %positive might be zero define i1 @test3(i32 %other) { -; CHECK-LABEL: @test3 -; CHECK: %test = icmp sgt i32 %sel, 0 +; CHECK-LABEL: @test3( +; CHECK-NEXT: [[POSITIVE:%.*]] = load i32, i32* @g, align 4, !range !0 +; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[POSITIVE]], %other +; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP]], i32 [[POSITIVE]], i32 %other +; CHECK-NEXT: [[TEST:%.*]] = icmp sgt i32 [[SEL]], 0 +; CHECK-NEXT: ret i1 [[TEST]] +; %positive = load i32, i32* @g, !range !{i32 0, i32 2048} %cmp = icmp slt i32 %positive, %other %sel = select i1 %cmp, i32 %positive, i32 %other |

