[llvm-commits] [llvm] r86927 - /llvm/trunk/test/Transforms/JumpThreading/basic.ll

Chris Lattner sabre at nondot.org
Wed Nov 11 17:55:21 PST 2009


Author: lattner
Date: Wed Nov 11 19:55:20 2009
New Revision: 86927

URL: http://llvm.org/viewvc/llvm-project?rev=86927&view=rev
Log:
We now thread some impossible condition information with LVI.

Modified:
    llvm/trunk/test/Transforms/JumpThreading/basic.ll

Modified: llvm/trunk/test/Transforms/JumpThreading/basic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/JumpThreading/basic.ll?rev=86927&r1=86926&r2=86927&view=diff

==============================================================================
--- llvm/trunk/test/Transforms/JumpThreading/basic.ll (original)
+++ llvm/trunk/test/Transforms/JumpThreading/basic.ll Wed Nov 11 19:55:20 2009
@@ -321,14 +321,42 @@
 }
 
 
+; Impossible conditional constraints should get threaded.  BB3 is dead here.
+define i32 @test11(i32 %A) {
+; CHECK: @test11
+; CHECK-NEXT: icmp
+; CHECK-NEXT: br i1 %tmp455, label %BB4, label %BB2
+	%tmp455 = icmp eq i32 %A, 42
+	br i1 %tmp455, label %BB1, label %BB2
+        
+BB2:
+; CHECK: call i32 @f1()
+; CHECK-NEXT: call void @f3()
+; CHECK-NEXT: ret i32 4
+	%C = call i32 @f1()
+	ret i32 %C
+        
+
+BB1:
+	%tmp459 = icmp eq i32 %A, 43
+	br i1 %tmp459, label %BB3, label %BB4
+
+BB3:
+	call i32 @f2()
+        ret i32 3
+
+BB4:
+	call void @f3()
+	ret i32 4
+}
 
 
 
 ;;; Duplicate condition to avoid xor of cond.
 ;;; TODO: Make this happen.
-define i32 @test11(i1 %cond, i1 %cond2) {
+define i32 @testXX(i1 %cond, i1 %cond2) {
 Entry:
-; CHECK: @test11
+; CHECK: @testXX
 	%v1 = call i32 @f1()
 	br i1 %cond, label %Merge, label %F1
 





More information about the llvm-commits mailing list