summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-09-04 06:18:33 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-09-04 06:18:33 +0000
commit373d50af1df0eb853f0773cd734f7078a0b139fd (patch)
tree6b8bbcd8c16d4c75db4758e6a94a57348d1fcbad /test
parent90960280ee79987f53b4952793a867143145a36a (diff)
downloadllvm-373d50af1df0eb853f0773cd734f7078a0b139fd.tar.gz
llvm-373d50af1df0eb853f0773cd734f7078a0b139fd.tar.bz2
llvm-373d50af1df0eb853f0773cd734f7078a0b139fd.tar.xz
Load from GV stub should be locally CSE'd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55763 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/fast-isel-mem.ll12
-rw-r--r--test/CodeGen/X86/fast-isel.ll8
2 files changed, 12 insertions, 8 deletions
diff --git a/test/CodeGen/X86/fast-isel-mem.ll b/test/CodeGen/X86/fast-isel-mem.ll
new file mode 100644
index 0000000000..81af0ab5a8
--- /dev/null
+++ b/test/CodeGen/X86/fast-isel-mem.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llc -fast-isel -mtriple=i386-apple-darwin -mattr=sse2 | \
+; RUN: grep mov | grep lazy_ptr | count 1
+
+@src = external global i32
+
+define i32 @loadgv() nounwind {
+entry:
+ %0 = load i32* @src, align 4
+ %1 = load i32* @src, align 4
+ %2 = add i32 %0, %1
+ ret i32 %2
+}
diff --git a/test/CodeGen/X86/fast-isel.ll b/test/CodeGen/X86/fast-isel.ll
index 10b2e1ee42..9910629211 100644
--- a/test/CodeGen/X86/fast-isel.ll
+++ b/test/CodeGen/X86/fast-isel.ll
@@ -47,11 +47,3 @@ entry:
%tmp2 = bitcast i32 0 to i32
ret i32 %tmp2
}
-
-@src = external global i32
-
-define i32 @loadgv() nounwind {
-entry:
- %0 = load i32* @src, align 4
- ret i32 %0
-}