summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-10-28 01:12:16 +0000
committerDan Gohman <gohman@apple.com>2009-10-28 01:12:16 +0000
commit75d6a4afd29f93e3cd40bff7bf374e594da515d6 (patch)
tree1d1af2374c0835539b74fdf7c15772f7836e1624 /llvm/test
parentdeab9dee122336a6b1916a94c84e7bbc6a2e2f3f (diff)
downloadbcm5719-llvm-75d6a4afd29f93e3cd40bff7bf374e594da515d6.tar.gz
bcm5719-llvm-75d6a4afd29f93e3cd40bff7bf374e594da515d6.zip
Allow constants of different types to share constant pool entries
if they have compatible encodings. llvm-svn: 85359
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/constant-pool-sharing.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/constant-pool-sharing.ll b/llvm/test/CodeGen/X86/constant-pool-sharing.ll
new file mode 100644
index 00000000000..c3e97adffb1
--- /dev/null
+++ b/llvm/test/CodeGen/X86/constant-pool-sharing.ll
@@ -0,0 +1,19 @@
+; RUN: llc < %s -march=x86-64 | FileCheck %s
+
+; llc should share constant pool entries between this integer vector
+; and this floating-point vector since they have the same encoding.
+
+; CHECK: LCPI1_0(%rip), %xmm0
+; CHECK: movaps %xmm0, (%rdi)
+; CHECK: movaps %xmm0, (%rsi)
+
+define void @foo(<4 x i32>* %p, <4 x float>* %q, i1 %t) nounwind {
+entry:
+ br label %loop
+loop:
+ store <4 x i32><i32 1073741824, i32 1073741824, i32 1073741824, i32 1073741824>, <4 x i32>* %p
+ store <4 x float><float 2.0, float 2.0, float 2.0, float 2.0>, <4 x float>* %q
+ br i1 %t, label %loop, label %ret
+ret:
+ ret void
+}
OpenPOWER on IntegriCloud