diff options
| author | Craig Topper <craig.topper@intel.com> | 2017-09-20 21:18:12 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2017-09-20 21:18:12 +0000 |
| commit | 9b593a69385034e11afb41e87b4d4752e88aff37 (patch) | |
| tree | 1cc9643a01ba9efa57fa665f2b6f0c19a8bea120 /llvm/test/Transforms | |
| parent | 31a2c8093593a8e17a05022915eb505dcb7020e3 (diff) | |
| download | bcm5719-llvm-9b593a69385034e11afb41e87b4d4752e88aff37.tar.gz bcm5719-llvm-9b593a69385034e11afb41e87b4d4752e88aff37.zip | |
[InstCombine] Pre-commit test cases for D38065.
llvm-svn: 313818
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/icmp.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll index d0ee8e0ae3b..930bfdca74f 100644 --- a/llvm/test/Transforms/InstCombine/icmp.ll +++ b/llvm/test/Transforms/InstCombine/icmp.ll @@ -1138,6 +1138,17 @@ define i1 @test67(i32 %x) { ret i1 %cmp } +define i1 @test67inverse(i32 %x) { +; CHECK-LABEL: @test67inverse( +; CHECK-NEXT: [[AND:%.*]] = and i32 [[X:%.*]], 96 +; CHECK-NEXT: [[CMP:%.*]] = icmp ult i32 [[AND]], 32 +; CHECK-NEXT: ret i1 [[CMP]] +; + %and = and i32 %x, 127 + %cmp = icmp sle i32 %and, 31 + ret i1 %cmp +} + ; The test above relies on 3 different folds. ; This test only checks the last of those (icmp ugt -> icmp ne). @@ -1164,6 +1175,17 @@ define <2 x i1> @test67vec2(<2 x i32> %x) { ret <2 x i1> %cmp } +define <2 x i1> @test67vecinverse(<2 x i32> %x) { +; CHECK-LABEL: @test67vecinverse( +; CHECK-NEXT: [[AND:%.*]] = and <2 x i32> [[X:%.*]], <i32 96, i32 96> +; CHECK-NEXT: [[CMP:%.*]] = icmp ult <2 x i32> [[AND]], <i32 32, i32 32> +; CHECK-NEXT: ret <2 x i1> [[CMP]] +; + %and = and <2 x i32> %x, <i32 96, i32 96> + %cmp = icmp sle <2 x i32> %and, <i32 31, i32 31> + ret <2 x i1> %cmp +} + define i1 @test68(i32 %x) { ; CHECK-LABEL: @test68( ; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 127 |

