]> granicus.if.org Git - llvm/commitdiff
minimize tests
authorSanjay Patel <spatel@rotateright.com>
Fri, 8 Jul 2016 16:11:48 +0000 (16:11 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 8 Jul 2016 16:11:48 +0000 (16:11 +0000)
The cmp and load aren't required.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274864 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/or.ll

index 4b4f45a0cb98fd98d468492b9dcd61f626ff6ae1..98dcd2a50c002177289e1dbee79b37dc4f528b6f 100644 (file)
@@ -425,30 +425,22 @@ define i1 @test36(i32 %x) {
   ret i1 %ret2
 }
 
-define i32 @test37(i32* %xp, i32 %y) {
-; CHECK-LABEL: @test37(
-; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 %y, 0
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* [[X:%.*]]p, align 4
-; CHECK-NEXT:    [[OR:%.*]] = select i1 [[TOBOOL]], i32 -1, i32 [[X]]
+define i32 @orsext_to_sel(i32 %x, i1 %y) {
+; CHECK-LABEL: @orsext_to_sel(
+; CHECK-NEXT:    [[OR:%.*]] = select i1 %y, i32 -1, i32 %x
 ; CHECK-NEXT:    ret i32 [[OR]]
 ;
-  %tobool = icmp ne i32 %y, 0
-  %sext = sext i1 %tobool to i32
-  %x = load i32, i32* %xp
+  %sext = sext i1 %y to i32
   %or = or i32 %sext, %x
   ret i32 %or
 }
 
-define i32 @test38(i32* %xp, i32 %y) {
-; CHECK-LABEL: @test38(
-; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 %y, 0
-; CHECK-NEXT:    [[X:%.*]] = load i32, i32* [[X:%.*]]p, align 4
-; CHECK-NEXT:    [[OR:%.*]] = select i1 [[TOBOOL]], i32 -1, i32 [[X]]
+define i32 @orsext_to_sel_swap(i32 %x, i1 %y) {
+; CHECK-LABEL: @orsext_to_sel_swap(
+; CHECK-NEXT:    [[OR:%.*]] = select i1 %y, i32 -1, i32 %x
 ; CHECK-NEXT:    ret i32 [[OR]]
 ;
-  %tobool = icmp ne i32 %y, 0
-  %sext = sext i1 %tobool to i32
-  %x = load i32, i32* %xp
+  %sext = sext i1 %y to i32
   %or = or i32 %x, %sext
   ret i32 %or
 }