[llvm] r231307 - Improve test robustness

Matthias Braun matze at braunis.de
Wed Mar 4 14:31:19 PST 2015


Author: matze
Date: Wed Mar  4 16:31:18 2015
New Revision: 231307

URL: http://llvm.org/viewvc/llvm-project?rev=231307&view=rev
Log:
Improve test robustness

Improve test robustness in preparation of coming commits:
- Avoid undefs which may get propagated too much.
- Remove several pointless add 0, instructions

Modified:
    llvm/trunk/test/CodeGen/ARM/2011-12-14-machine-sink.ll

Modified: llvm/trunk/test/CodeGen/ARM/2011-12-14-machine-sink.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2011-12-14-machine-sink.ll?rev=231307&r1=231306&r2=231307&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2011-12-14-machine-sink.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/2011-12-14-machine-sink.ll Wed Mar  4 16:31:18 2015
@@ -5,7 +5,7 @@ target datalayout = "e-p:32:32:32-i1:8:3
 target triple = "thumbv7-apple-ios4.0.0"
 ; STATS-NOT: machine-sink
 
-define i32 @foo(i32 %h) nounwind readonly ssp {
+define i32 @foo(i32 %h, i32 %arg1) nounwind readonly ssp {
 entry:
   br label %for.cond
 
@@ -14,11 +14,13 @@ for.cond:
   br i1 %cmp, label %for.body, label %if.end299
 
 for.body:                                         ; preds = %for.cond
-  %v.5 = select i1 undef, i32 undef, i32 0
+  %cond0 = icmp ne i32 %arg1, 42
+  %v.5 = select i1 %cond0, i32 undef, i32 0
   %0 = load i8, i8* undef, align 1
   %conv88 = zext i8 %0 to i32
   %sub89 = sub nsw i32 0, %conv88
-  %v.8 = select i1 undef, i32 undef, i32 %sub89
+  %cond1 = icmp ne i32 %arg1, 23
+  %v.8 = select i1 %cond1, i32 undef, i32 %sub89
   %1 = load i8, i8* null, align 1
   %conv108 = zext i8 %1 to i32
   %2 = load i8, i8* undef, align 1
@@ -26,21 +28,12 @@ for.body:
   %sub111 = sub nsw i32 %conv108, %conv110
   %cmp112 = icmp slt i32 %sub111, 0
   %sub115 = sub nsw i32 0, %sub111
-  %v.10 = select i1 %cmp112, i32 %sub115, i32 %sub111
-  %add62 = add i32 0, %v.5
-  %add73 = add i32 %add62, 0
-  %add84 = add i32 %add73, 0
-  %add95 = add i32 %add84, %v.8
-  %add106 = add i32 %add95, 0
-  %add117 = add i32 %add106, %v.10
-  %add128 = add i32 %add117, 0
-  %add139 = add i32 %add128, 0
-  %add150 = add i32 %add139, 0
-  %add161 = add i32 %add150, 0
-  %add172 = add i32 %add161, 0
+  %abs = select i1 %cmp112, i32 %sub115, i32 %sub111
+  %add95 = add i32 %v.5, %v.8
+  %add117 = add i32 %add95, %abs
   br i1 undef, label %for.cond, label %if.end299
 
 if.end299:                                        ; preds = %for.body, %for.cond
-  %s.10 = phi i32 [ %add172, %for.body ], [ 0, %for.cond ]
+  %s.10 = phi i32 [ %add117, %for.body ], [ 0, %for.cond ]
   ret i32 %s.10
 }





More information about the llvm-commits mailing list