[llvm-commits] [llvm] r61549 - /llvm/trunk/test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll

Duncan Sands baldrick at free.fr
Thu Jan 1 16:55:52 PST 2009


Author: baldrick
Date: Thu Jan  1 18:55:51 2009
New Revision: 61549

URL: http://llvm.org/viewvc/llvm-project?rev=61549&view=rev
Log:
Add tests for two types of traps that escape analysis
might one day fall into.

Modified:
    llvm/trunk/test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll

Modified: llvm/trunk/test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll?rev=61549&r1=61548&r2=61549&view=diff

==============================================================================
--- llvm/trunk/test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll (original)
+++ llvm/trunk/test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll Thu Jan  1 18:55:51 2009
@@ -16,6 +16,29 @@
 	ret void
 }
 
+define i1 @c4(i32* %q, i32 %bitno) {
+	%tmp = ptrtoint i32* %q to i32
+	%tmp2 = lshr i32 %tmp, %bitno
+	%bit = trunc i32 %tmp2 to i1
+	br i1 %bit, label %l1, label %l0
+l0:
+	ret i1 0 ; escaping value not caught by def-use chaining.
+l1:
+	ret i1 1 ; escaping value not caught by def-use chaining.
+}
+
+ at lookup_table = global [2 x i1] [ i1 0, i1 1 ]
+
+define i1 @c5(i32* %q, i32 %bitno) {
+	%tmp = ptrtoint i32* %q to i32
+	%tmp2 = lshr i32 %tmp, %bitno
+	%bit = and i32 %tmp2, 1
+        ; subtle escape mechanism follows
+	%lookup = getelementptr [2 x i1]* @lookup_table, i32 0, i32 %bit
+	%val = load i1* %lookup
+	ret i1 %val
+}
+
 define i32 @nc1(i32* %q, i32* %p, i1 %b) {
 e:
 	br label %l





More information about the llvm-commits mailing list