From: Craig Topper Date: Wed, 20 Sep 2017 21:18:12 +0000 (+0000) Subject: [InstCombine] Pre-commit test cases for D38065. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5fbea4df0825a4cb2d9563b6a1fab438f1e2a11d;p=llvm [InstCombine] Pre-commit test cases for D38065. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313818 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll index d0ee8e0ae3b..930bfdca74f 100644 --- a/test/Transforms/InstCombine/icmp.ll +++ b/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:%.*]], +; CHECK-NEXT: [[CMP:%.*]] = icmp ult <2 x i32> [[AND]], +; CHECK-NEXT: ret <2 x i1> [[CMP]] +; + %and = and <2 x i32> %x, + %cmp = icmp sle <2 x i32> %and, + ret <2 x i1> %cmp +} + define i1 @test68(i32 %x) { ; CHECK-LABEL: @test68( ; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 127