diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-08-15 19:16:33 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-08-15 19:16:33 +0000 |
| commit | b86085961188cc7ce42c2f20b34466cd6b805cd3 (patch) | |
| tree | 2b756fe56068b31d5f8d6006811e61a4ed7b5eea /llvm/test/Transforms/InstCombine/div.ll | |
| parent | 1053e7e967dc32a18d98590e7263e7d57b926cab (diff) | |
| download | bcm5719-llvm-b86085961188cc7ce42c2f20b34466cd6b805cd3.tar.gz bcm5719-llvm-b86085961188cc7ce42c2f20b34466cd6b805cd3.zip | |
[InstCombine] add tests for missing vector icmp folds
llvm-svn: 278717
Diffstat (limited to 'llvm/test/Transforms/InstCombine/div.ll')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/div.ll | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/div.ll b/llvm/test/Transforms/InstCombine/div.ll index a19cdefa31f..ece332ab273 100644 --- a/llvm/test/Transforms/InstCombine/div.ll +++ b/llvm/test/Transforms/InstCombine/div.ll @@ -72,6 +72,18 @@ define i1 @test7(i32 %A) { ret i1 %C } +; FIXME: Vectors should fold the same way. +define <2 x i1> @test7vec(<2 x i32> %A) { +; CHECK-LABEL: @test7vec( +; CHECK-NEXT: [[B:%.*]] = udiv <2 x i32> %A, <i32 10, i32 10> +; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i32> [[B]], <i32 2, i32 2> +; CHECK-NEXT: ret <2 x i1> [[C]] +; + %B = udiv <2 x i32> %A, <i32 10, i32 10> + %C = icmp eq <2 x i32> %B, <i32 2, i32 2> + ret <2 x i1> %C +} + define i1 @test8(i8 %A) { ; CHECK-LABEL: @test8( ; CHECK-NEXT: [[C:%.*]] = icmp ugt i8 %A, -11 @@ -83,6 +95,18 @@ define i1 @test8(i8 %A) { ret i1 %C } +; FIXME: Vectors should fold the same way. +define <2 x i1> @test8vec(<2 x i8> %A) { +; CHECK-LABEL: @test8vec( +; CHECK-NEXT: [[B:%.*]] = udiv <2 x i8> %A, <i8 123, i8 123> +; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i8> [[B]], <i8 2, i8 2> +; CHECK-NEXT: ret <2 x i1> [[C]] +; + %B = udiv <2 x i8> %A, <i8 123, i8 123> + %C = icmp eq <2 x i8> %B, <i8 2, i8 2> + ret <2 x i1> %C +} + define i1 @test9(i8 %A) { ; CHECK-LABEL: @test9( ; CHECK-NEXT: [[C:%.*]] = icmp ult i8 %A, -10 @@ -94,6 +118,18 @@ define i1 @test9(i8 %A) { ret i1 %C } +; FIXME: Vectors should fold the same way. +define <2 x i1> @test9vec(<2 x i8> %A) { +; CHECK-LABEL: @test9vec( +; CHECK-NEXT: [[B:%.*]] = udiv <2 x i8> %A, <i8 123, i8 123> +; CHECK-NEXT: [[C:%.*]] = icmp ne <2 x i8> [[B]], <i8 2, i8 2> +; CHECK-NEXT: ret <2 x i1> [[C]] +; + %B = udiv <2 x i8> %A, <i8 123, i8 123> + %C = icmp ne <2 x i8> %B, <i8 2, i8 2> + ret <2 x i1> %C +} + define i32 @test10(i32 %X, i1 %C) { ; CHECK-LABEL: @test10( ; CHECK-NEXT: [[R_V:%.*]] = select i1 %C, i32 6, i32 3 |

