[llvm] r274864 - minimize tests

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 8 09:11:49 PDT 2016


Author: spatel
Date: Fri Jul  8 11:11:48 2016
New Revision: 274864

URL: http://llvm.org/viewvc/llvm-project?rev=274864&view=rev
Log:
minimize tests

The cmp and load aren't required.

Modified:
    llvm/trunk/test/Transforms/InstCombine/or.ll

Modified: llvm/trunk/test/Transforms/InstCombine/or.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/or.ll?rev=274864&r1=274863&r2=274864&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/or.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/or.ll Fri Jul  8 11:11:48 2016
@@ -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
 }




More information about the llvm-commits mailing list