summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/avx2-vbroadcast.ll
diff options
context:
space:
mode:
authorNadav Rotem <nadav.rotem@intel.com>2012-04-08 12:54:54 +0000
committerNadav Rotem <nadav.rotem@intel.com>2012-04-08 12:54:54 +0000
commit9d68b06bc5ef1157d198d52e3f6829c721d72552 (patch)
tree85a165a9702750c22383bf07feed605036581937 /test/CodeGen/X86/avx2-vbroadcast.ll
parent864737cc5123930f7866e2ca22be07c3e1127b11 (diff)
downloadllvm-9d68b06bc5ef1157d198d52e3f6829c721d72552.tar.gz
llvm-9d68b06bc5ef1157d198d52e3f6829c721d72552.tar.bz2
llvm-9d68b06bc5ef1157d198d52e3f6829c721d72552.tar.xz
AVX2: Build splat vectors by broadcasting a scalar from the constant pool.
Previously we used three instructions to broadcast an immediate value into a vector register. On Sandybridge we continue to load the broadcasted value from the constant pool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154284 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/avx2-vbroadcast.ll')
-rw-r--r--test/CodeGen/X86/avx2-vbroadcast.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGen/X86/avx2-vbroadcast.ll b/test/CodeGen/X86/avx2-vbroadcast.ll
index fbabb15158..314466175e 100644
--- a/test/CodeGen/X86/avx2-vbroadcast.ll
+++ b/test/CodeGen/X86/avx2-vbroadcast.ll
@@ -150,3 +150,24 @@ entry:
%vecinit2.i = insertelement <2 x double> %vecinit.i, double %q, i32 1
ret <2 x double> %vecinit2.i
}
+
+; CHECK: V111
+; CHECK: vpbroadcastd
+; CHECK: ret
+define <8 x i32> @V111(<8 x i32> %in) nounwind uwtable readnone ssp {
+entry:
+ %g = add <8 x i32> %in, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
+ ret <8 x i32> %g
+}
+
+; CHECK: _e2
+; CHECK: vbroadcastss
+; CHECK: ret
+define <4 x float> @_e2(float* %ptr) nounwind uwtable readnone ssp {
+ %vecinit.i = insertelement <4 x float> undef, float 0xbf80000000000000, i32 0
+ %vecinit2.i = insertelement <4 x float> %vecinit.i, float 0xbf80000000000000, i32 1
+ %vecinit4.i = insertelement <4 x float> %vecinit2.i, float 0xbf80000000000000, i32 2
+ %vecinit6.i = insertelement <4 x float> %vecinit4.i, float 0xbf80000000000000, i32 3
+ ret <4 x float> %vecinit6.i
+}
+