mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 02:33:33 +00:00
Teach SplitVectorOp how to split INSERT_VECTOR_ELT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42457 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
763856526f
commit
9fe4662d9a
@ -5837,6 +5837,18 @@ void SelectionDAGLegalize::SplitVectorOp(SDOperand Op, SDOperand &Lo,
|
||||
Lo = Node->getOperand(0);
|
||||
Hi = Node->getOperand(1);
|
||||
break;
|
||||
case ISD::INSERT_VECTOR_ELT: {
|
||||
SplitVectorOp(Node->getOperand(0), Lo, Hi);
|
||||
unsigned Index = cast<ConstantSDNode>(Node->getOperand(2))->getValue();
|
||||
SDOperand ScalarOp = Node->getOperand(1);
|
||||
if (Index < NewNumElts)
|
||||
Lo = DAG.getNode(ISD::INSERT_VECTOR_ELT, NewVT, Lo, ScalarOp,
|
||||
DAG.getConstant(Index, TLI.getPointerTy()));
|
||||
else
|
||||
Hi = DAG.getNode(ISD::INSERT_VECTOR_ELT, NewVT, Hi, ScalarOp,
|
||||
DAG.getConstant(Index - NewNumElts, TLI.getPointerTy()));
|
||||
break;
|
||||
}
|
||||
case ISD::BUILD_VECTOR: {
|
||||
SmallVector<SDOperand, 8> LoOps(Node->op_begin(),
|
||||
Node->op_begin()+NewNumElts);
|
||||
|
18
test/CodeGen/X86/illegal-insert.ll
Normal file
18
test/CodeGen/X86/illegal-insert.ll
Normal file
@ -0,0 +1,18 @@
|
||||
; RUN: llvm-as %s -o - | llc -march=x86-64
|
||||
|
||||
define <4 x double> @foo0(<4 x double> %t) {
|
||||
%r = insertelement <4 x double> %t, double 2.3, i32 0
|
||||
ret <4 x double> %r
|
||||
}
|
||||
define <4 x double> @foo1(<4 x double> %t) {
|
||||
%r = insertelement <4 x double> %t, double 2.3, i32 1
|
||||
ret <4 x double> %r
|
||||
}
|
||||
define <4 x double> @foo2(<4 x double> %t) {
|
||||
%r = insertelement <4 x double> %t, double 2.3, i32 2
|
||||
ret <4 x double> %r
|
||||
}
|
||||
define <4 x double> @foo3(<4 x double> %t) {
|
||||
%r = insertelement <4 x double> %t, double 2.3, i32 3
|
||||
ret <4 x double> %r
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user