aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-11-29 23:48:37 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-11-29 23:48:37 +0000
commit20833e33fd1bad88f44d0d803b2e2b88f4861b27 (patch)
tree066596982b0f7c1ef4687584b21dcde4829dd252 /test
parentc8306bde15c37592084602e28308fc5a2cd14ef8 (diff)
New LSR test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/loop-strength-reduce2.ll29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/CodeGen/X86/loop-strength-reduce2.ll b/test/CodeGen/X86/loop-strength-reduce2.ll
new file mode 100644
index 0000000000..eb22383f31
--- /dev/null
+++ b/test/CodeGen/X86/loop-strength-reduce2.ll
@@ -0,0 +1,29 @@
+; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -relocation-model=pic | not grep lea
+;
+; Make sure the PIC label flags2-"L1$pb" is not moved up to the preheader.
+
+%flags2 = internal global [8193 x sbyte] zeroinitializer, align 32
+
+void %test(int %k, int %i) {
+entry:
+ %i = bitcast int %i to uint
+ %k_addr.012 = shl int %i, ubyte 1
+ %tmp14 = setgt int %k_addr.012, 8192
+ br bool %tmp14, label %return, label %bb
+
+bb:
+ %indvar = phi uint [ 0, %entry ], [ %indvar.next, %bb ]
+ %tmp. = shl uint %i, ubyte 1
+ %tmp.15 = mul uint %indvar, %i
+ %tmp.16 = add uint %tmp.15, %tmp.
+ %k_addr.0.0 = bitcast uint %tmp.16 to int
+ %tmp = getelementptr [8193 x sbyte]* %flags2, int 0, uint %tmp.16
+ store sbyte 0, sbyte* %tmp
+ %k_addr.0 = add int %k_addr.0.0, %i
+ %tmp = setgt int %k_addr.0, 8192
+ %indvar.next = add uint %indvar, 1
+ br bool %tmp, label %return, label %bb
+
+return:
+ ret void
+}