diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-08-15 20:56:11 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-08-15 20:56:11 +0000 |
| commit | 3e9acec2fadf811a26b184e9a594f2bcb737279e (patch) | |
| tree | a485f527f0ca34199ec4d44426926361b32439c0 | |
| parent | 5f6100260b4d1f9fe194e21ad5a9184c3fc5d137 (diff) | |
| download | bcm5719-llvm-3e9acec2fadf811a26b184e9a594f2bcb737279e.tar.gz bcm5719-llvm-3e9acec2fadf811a26b184e9a594f2bcb737279e.zip | |
[InstCombine] add tests for missing vector icmp folds
llvm-svn: 278737
| -rw-r--r-- | llvm/test/Transforms/InstCombine/icmp.ll | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll index 1aa37142c23..33dd9c8a0d8 100644 --- a/llvm/test/Transforms/InstCombine/icmp.ll +++ b/llvm/test/Transforms/InstCombine/icmp.ll @@ -1581,6 +1581,18 @@ define i1 @icmp_sub_3_X_ult_2(i32 %X) { ret i1 %cmp } +; FIXME: Vectors should fold too. +define <2 x i1> @icmp_sub_3_X_ult_2_vec(<2 x i32> %X) { +; CHECK-LABEL: @icmp_sub_3_X_ult_2_vec( +; CHECK-NEXT: [[ADD:%.*]] = sub <2 x i32> <i32 3, i32 3>, %X +; CHECK-NEXT: [[CMP:%.*]] = icmp ult <2 x i32> [[ADD]], <i32 2, i32 2> +; CHECK-NEXT: ret <2 x i1> [[CMP]] +; + %add = sub <2 x i32> <i32 3, i32 3>, %X + %cmp = icmp ult <2 x i32> %add, <i32 2, i32 2> + ret <2 x i1> %cmp +} + define i1 @icmp_add_X_-14_uge_2(i32 %X) { ; CHECK-LABEL: @icmp_add_X_-14_uge_2( ; CHECK-NEXT: [[TMP1:%.*]] = and i32 %X, -2 @@ -1603,6 +1615,18 @@ define i1 @icmp_sub_3_X_uge_2(i32 %X) { ret i1 %cmp } +; FIXME: Vectors should fold too. +define <2 x i1> @icmp_sub_3_X_uge_2_vec(<2 x i32> %X) { +; CHECK-LABEL: @icmp_sub_3_X_uge_2_vec( +; CHECK-NEXT: [[ADD:%.*]] = sub <2 x i32> <i32 3, i32 3>, %X +; CHECK-NEXT: [[CMP:%.*]] = icmp ugt <2 x i32> [[ADD]], <i32 1, i32 1> +; CHECK-NEXT: ret <2 x i1> [[CMP]] +; + %add = sub <2 x i32> <i32 3, i32 3>, %X + %cmp = icmp uge <2 x i32> %add, <i32 2, i32 2> + ret <2 x i1> %cmp +} + define i1 @icmp_and_X_-16_eq-16(i32 %X) { ; CHECK-LABEL: @icmp_and_X_-16_eq-16( ; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i32 %X, -17 |

