diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-08-14 22:29:27 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-08-14 22:29:27 +0000 |
| commit | beebe05af1499166da1382e2d21505bcd6739fb5 (patch) | |
| tree | 2b02ac4561bafd1c318b9911513cafa3f0965b5e | |
| parent | ba1f9fbddcaed80c024594477c229334d19da348 (diff) | |
| download | bcm5719-llvm-beebe05af1499166da1382e2d21505bcd6739fb5.tar.gz bcm5719-llvm-beebe05af1499166da1382e2d21505bcd6739fb5.zip | |
[InstCombine] add test for missing vector icmp fold
llvm-svn: 278635
| -rw-r--r-- | llvm/test/Transforms/InstCombine/shift.ll | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/llvm/test/Transforms/InstCombine/shift.ll b/llvm/test/Transforms/InstCombine/shift.ll index 755c4a7f9f1..9edecba33b8 100644 --- a/llvm/test/Transforms/InstCombine/shift.ll +++ b/llvm/test/Transforms/InstCombine/shift.ll @@ -344,17 +344,29 @@ define i1 @test19(i32 %A) { } +;; X >u ~4 define i1 @test19a(i32 %A) { ; CHECK-LABEL: @test19a( ; CHECK-NEXT: [[C:%.*]] = icmp ugt i32 %A, -5 ; CHECK-NEXT: ret i1 [[C]] ; - %B = ashr i32 %A, 2 ; <i32> [#uses=1] - ;; X >u ~4 - %C = icmp eq i32 %B, -1 ; <i1> [#uses=1] + %B = ashr i32 %A, 2 + %C = icmp eq i32 %B, -1 ret i1 %C } +; FIXME: Vectors should fold the same way. +define <2 x i1> @test19a_vec(<2 x i32> %A) { +; CHECK-LABEL: @test19a_vec( +; CHECK-NEXT: [[B:%.*]] = ashr <2 x i32> %A, <i32 2, i32 2> +; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i32> [[B]], <i32 -1, i32 -1> +; CHECK-NEXT: ret <2 x i1> [[C]] +; + %B = ashr <2 x i32> %A, <i32 2, i32 2> + %C = icmp eq <2 x i32> %B, <i32 -1, i32 -1> + ret <2 x i1> %C +} + define i1 @test20(i8 %A) { ; CHECK-LABEL: @test20( ; CHECK-NEXT: ret i1 false |

