diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-08-18 17:55:59 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-08-18 17:55:59 +0000 |
| commit | fa5ca2bf4677d440eb15dcb851b39a31851c1164 (patch) | |
| tree | 9653af029cd55fa105e6987db2240eecfcf5675c /llvm/test | |
| parent | c9623db884ec044249c85366e9bc94e47d5cc48a (diff) | |
| download | bcm5719-llvm-fa5ca2bf4677d440eb15dcb851b39a31851c1164.tar.gz bcm5719-llvm-fa5ca2bf4677d440eb15dcb851b39a31851c1164.zip | |
[InstCombine] use m_APInt to allow icmp (udiv X, Y), C folds for splat constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
https://reviews.llvm.org/rL278935
https://reviews.llvm.org/rL278945
https://reviews.llvm.org/rL279066
https://reviews.llvm.org/rL279077
llvm-svn: 279101
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/compare-udiv.ll | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/llvm/test/Transforms/InstCombine/compare-udiv.ll b/llvm/test/Transforms/InstCombine/compare-udiv.ll index 8eb0715f7ec..a15d15feae1 100644 --- a/llvm/test/Transforms/InstCombine/compare-udiv.ll +++ b/llvm/test/Transforms/InstCombine/compare-udiv.ll @@ -148,12 +148,9 @@ define i1 @test8(i32 %d) { ret i1 %cmp1 } -; FIXME: Vectors should get the same folds as scalars for all tests. - define <2 x i1> @test8vec(<2 x i32> %d) { ; CHECK-LABEL: @test8vec( -; CHECK-NEXT: [[DIV:%.*]] = udiv <2 x i32> <i32 4, i32 4>, %d -; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt <2 x i32> [[DIV]], <i32 3, i32 3> +; CHECK-NEXT: [[CMP1:%.*]] = icmp ult <2 x i32> %d, <i32 2, i32 2> ; CHECK-NEXT: ret <2 x i1> [[CMP1]] ; %div = udiv <2 x i32> <i32 4, i32 4>, %d @@ -173,8 +170,7 @@ define i1 @test9(i32 %d) { define <2 x i1> @test9vec(<2 x i32> %d) { ; CHECK-LABEL: @test9vec( -; CHECK-NEXT: [[DIV:%.*]] = udiv <2 x i32> <i32 4, i32 4>, %d -; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt <2 x i32> [[DIV]], <i32 2, i32 2> +; CHECK-NEXT: [[CMP1:%.*]] = icmp ult <2 x i32> %d, <i32 2, i32 2> ; CHECK-NEXT: ret <2 x i1> [[CMP1]] ; %div = udiv <2 x i32> <i32 4, i32 4>, %d @@ -194,8 +190,7 @@ define i1 @test10(i32 %d) { define <2 x i1> @test10vec(<2 x i32> %d) { ; CHECK-LABEL: @test10vec( -; CHECK-NEXT: [[DIV:%.*]] = udiv <2 x i32> <i32 4, i32 4>, %d -; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt <2 x i32> [[DIV]], <i32 1, i32 1> +; CHECK-NEXT: [[CMP1:%.*]] = icmp ult <2 x i32> %d, <i32 3, i32 3> ; CHECK-NEXT: ret <2 x i1> [[CMP1]] ; %div = udiv <2 x i32> <i32 4, i32 4>, %d @@ -215,8 +210,7 @@ define i1 @test11(i32 %d) { define <2 x i1> @test11vec(<2 x i32> %d) { ; CHECK-LABEL: @test11vec( -; CHECK-NEXT: [[DIV:%.*]] = udiv <2 x i32> <i32 4, i32 4>, %d -; CHECK-NEXT: [[CMP1:%.*]] = icmp ult <2 x i32> [[DIV]], <i32 1, i32 1> +; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt <2 x i32> %d, <i32 4, i32 4> ; CHECK-NEXT: ret <2 x i1> [[CMP1]] ; %div = udiv <2 x i32> <i32 4, i32 4>, %d @@ -236,8 +230,7 @@ define i1 @test12(i32 %d) { define <2 x i1> @test12vec(<2 x i32> %d) { ; CHECK-LABEL: @test12vec( -; CHECK-NEXT: [[DIV:%.*]] = udiv <2 x i32> <i32 4, i32 4>, %d -; CHECK-NEXT: [[CMP1:%.*]] = icmp ult <2 x i32> [[DIV]], <i32 2, i32 2> +; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt <2 x i32> %d, <i32 2, i32 2> ; CHECK-NEXT: ret <2 x i1> [[CMP1]] ; %div = udiv <2 x i32> <i32 4, i32 4>, %d @@ -257,8 +250,7 @@ define i1 @test13(i32 %d) { define <2 x i1> @test13vec(<2 x i32> %d) { ; CHECK-LABEL: @test13vec( -; CHECK-NEXT: [[DIV:%.*]] = udiv <2 x i32> <i32 4, i32 4>, %d -; CHECK-NEXT: [[CMP1:%.*]] = icmp ult <2 x i32> [[DIV]], <i32 3, i32 3> +; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt <2 x i32> %d, <i32 1, i32 1> ; CHECK-NEXT: ret <2 x i1> [[CMP1]] ; %div = udiv <2 x i32> <i32 4, i32 4>, %d @@ -278,8 +270,7 @@ define i1 @test14(i32 %d) { define <2 x i1> @test14vec(<2 x i32> %d) { ; CHECK-LABEL: @test14vec( -; CHECK-NEXT: [[DIV:%.*]] = udiv <2 x i32> <i32 4, i32 4>, %d -; CHECK-NEXT: [[CMP1:%.*]] = icmp ult <2 x i32> [[DIV]], <i32 4, i32 4> +; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt <2 x i32> %d, <i32 1, i32 1> ; CHECK-NEXT: ret <2 x i1> [[CMP1]] ; %div = udiv <2 x i32> <i32 4, i32 4>, %d |

