diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-08-14 22:56:46 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-08-14 22:56:46 +0000 |
| commit | 52fe9ae99043cc9131ed8260cfda15b575e67d69 (patch) | |
| tree | 5070503a8c110e388b4390fd2ed81818b61e9621 | |
| parent | 599a8425227e38ee76ab541dacb790ad439a7c5d (diff) | |
| download | bcm5719-llvm-52fe9ae99043cc9131ed8260cfda15b575e67d69.tar.gz bcm5719-llvm-52fe9ae99043cc9131ed8260cfda15b575e67d69.zip | |
[InstCombine] add test for missing vector icmp fold
llvm-svn: 278639
| -rw-r--r-- | llvm/test/Transforms/InstCombine/apint-shift.ll | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/llvm/test/Transforms/InstCombine/apint-shift.ll b/llvm/test/Transforms/InstCombine/apint-shift.ll index f5764c2d5e8..79011e988fb 100644 --- a/llvm/test/Transforms/InstCombine/apint-shift.ll +++ b/llvm/test/Transforms/InstCombine/apint-shift.ll @@ -157,13 +157,29 @@ define i53 @test15a(i1 %X) { ret i53 %V } -; CHECK-LABEL: @test16( -; CHECK-NOT: sh define i1 @test16(i84 %X) { - %tmp.3 = ashr i84 %X, 4 ; <i84> [#uses=1] - %tmp.6 = and i84 %tmp.3, 1 ; <i84> [#uses=1] - %tmp.7 = icmp ne i84 %tmp.6, 0 ; <i1> [#uses=1] - ret i1 %tmp.7 +; CHECK-LABEL: @test16( +; CHECK-NEXT: [[AND:%.*]] = and i84 %X, 16 +; CHECK-NEXT: [[CMP:%.*]] = icmp ne i84 [[AND]], 0 +; CHECK-NEXT: ret i1 [[CMP]] +; + %shr = ashr i84 %X, 4 + %and = and i84 %shr, 1 + %cmp = icmp ne i84 %and, 0 + ret i1 %cmp +} + +define <2 x i1> @test16vec(<2 x i84> %X) { +; CHECK-LABEL: @test16vec( +; CHECK-NEXT: [[SHR1:%.*]] = lshr <2 x i84> %X, <i84 4, i84 4> +; CHECK-NEXT: [[AND:%.*]] = and <2 x i84> [[SHR1]], <i84 1, i84 1> +; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i84> [[AND]], zeroinitializer +; CHECK-NEXT: ret <2 x i1> [[CMP]] +; + %shr = ashr <2 x i84> %X, <i84 4, i84 4> + %and = and <2 x i84> %shr, <i84 1, i84 1> + %cmp = icmp ne <2 x i84> %and, zeroinitializer + ret <2 x i1> %cmp } ; CHECK-LABEL: @test17( |

