mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-19 16:35:10 +00:00
AVX2: Add an additional broadcast idiom.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156540 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5fc2187a02
commit
b210651654
@ -4980,8 +4980,11 @@ X86TargetLowering::LowerVectorBroadcast(SDValue &Op, SelectionDAG &DAG) const {
|
||||
return SDValue();
|
||||
|
||||
SDValue Sc = Op.getOperand(0);
|
||||
if (Sc.getOpcode() != ISD::SCALAR_TO_VECTOR)
|
||||
return SDValue();
|
||||
if (Sc.getOpcode() == ISD::SCALAR_TO_VECTOR)
|
||||
Ld = Sc.getOperand(0);
|
||||
else if (Sc.getOpcode() == ISD::BUILD_VECTOR)
|
||||
Ld = Sc.getOperand(0);
|
||||
else return SDValue();
|
||||
|
||||
Ld = Sc.getOperand(0);
|
||||
ConstSplatVal = (Ld.getOpcode() == ISD::Constant ||
|
||||
|
@ -129,3 +129,15 @@ entry:
|
||||
ret <4 x float> %vecinit6.i
|
||||
}
|
||||
|
||||
|
||||
; CHECK: _RR2
|
||||
; CHECK: vbroadcastss (%
|
||||
; CHECK: ret
|
||||
define <4 x float> @_RR2(float* %ptr, i32* %k) nounwind uwtable readnone ssp {
|
||||
entry:
|
||||
%q = load float* %ptr, align 4
|
||||
%v = insertelement <4 x float> undef, float %q, i32 0
|
||||
%t = shufflevector <4 x float> %v, <4 x float> undef, <4 x i32> zeroinitializer
|
||||
ret <4 x float> %t
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user