summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstSimplify/select.ll
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2017-08-14 19:09:32 +0000
committerCraig Topper <craig.topper@intel.com>2017-08-14 19:09:32 +0000
commit69fa8e0d99177045e5ad3bef42360c635736c428 (patch)
treee2950fb3e5fe4cd4229e6d01624f82b80cdd8937 /llvm/test/Transforms/InstSimplify/select.ll
parent9c7b881677f65fce8cfbc6ec70c44790576b6ea5 (diff)
downloadbcm5719-llvm-69fa8e0d99177045e5ad3bef42360c635736c428.tar.gz
bcm5719-llvm-69fa8e0d99177045e5ad3bef42360c635736c428.zip
Revert r310869 "[InstSimplify][InstCombine] Modify the interface of decomposeBitTestICmp and use it in the InstSimplify"
Failed to add the two files that moved. And then added an extra change I didn't mean to while trying to fix that. Reverting everything. llvm-svn: 310873
Diffstat (limited to 'llvm/test/Transforms/InstSimplify/select.ll')
-rw-r--r--llvm/test/Transforms/InstSimplify/select.ll14
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/test/Transforms/InstSimplify/select.ll b/llvm/test/Transforms/InstSimplify/select.ll
index 4134191a3cf..e9c94170a94 100644
--- a/llvm/test/Transforms/InstSimplify/select.ll
+++ b/llvm/test/Transforms/InstSimplify/select.ll
@@ -160,10 +160,13 @@ define <2 x i8> @test11vec(<2 x i8> %X) {
ret <2 x i8> %sel
}
+; TODO: we should be able to simplify this
define i32 @test12(i32 %X) {
; CHECK-LABEL: @test12(
-; CHECK-NEXT: [[AND:%.*]] = and i32 [[X:%.*]], 3
-; CHECK-NEXT: ret i32 [[AND]]
+; CHECK-NEXT: [[CMP:%.*]] = icmp ult i32 [[X:%.*]], 4
+; CHECK-NEXT: [[AND:%.*]] = and i32 [[X]], 3
+; CHECK-NEXT: [[COND:%.*]] = select i1 [[CMP]], i32 [[X]], i32 [[AND]]
+; CHECK-NEXT: ret i32 [[COND]]
;
%cmp = icmp ult i32 %X, 4
%and = and i32 %X, 3
@@ -186,10 +189,13 @@ define i32 @test12noncanon(i32 %X) {
ret i32 %cond
}
+; TODO: we should be able to simplify this
define i32 @test13(i32 %X) {
; CHECK-LABEL: @test13(
-; CHECK-NEXT: [[AND:%.*]] = and i32 [[X:%.*]], 3
-; CHECK-NEXT: ret i32 [[AND]]
+; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i32 [[X:%.*]], 3
+; CHECK-NEXT: [[AND:%.*]] = and i32 [[X]], 3
+; CHECK-NEXT: [[COND:%.*]] = select i1 [[CMP]], i32 [[AND]], i32 [[X]]
+; CHECK-NEXT: ret i32 [[COND]]
;
%cmp = icmp ugt i32 %X, 3
%and = and i32 %X, 3
OpenPOWER on IntegriCloud