mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 07:24:47 +00:00
Use the correct result value type instead of using getValueType(0)
in ExpandEXTRACT_VECTOR_ELT and SplitVectorOp. This fixes an abort in the included testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42264 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3870,8 +3870,7 @@ SDOperand SelectionDAGLegalize::ExpandEXTRACT_VECTOR_ELT(SDOperand Op) {
|
|||||||
SDOperand Vec = Op.getOperand(0);
|
SDOperand Vec = Op.getOperand(0);
|
||||||
SDOperand Idx = Op.getOperand(1);
|
SDOperand Idx = Op.getOperand(1);
|
||||||
|
|
||||||
SDNode *InVal = Vec.Val;
|
MVT::ValueType TVT = Vec.getValueType();
|
||||||
MVT::ValueType TVT = InVal->getValueType(0);
|
|
||||||
unsigned NumElems = MVT::getVectorNumElements(TVT);
|
unsigned NumElems = MVT::getVectorNumElements(TVT);
|
||||||
|
|
||||||
switch (TLI.getOperationAction(ISD::EXTRACT_VECTOR_ELT, TVT)) {
|
switch (TLI.getOperationAction(ISD::EXTRACT_VECTOR_ELT, TVT)) {
|
||||||
@@ -5803,10 +5802,10 @@ void SelectionDAGLegalize::SplitVectorOp(SDOperand Op, SDOperand &Lo,
|
|||||||
SDOperand &Hi) {
|
SDOperand &Hi) {
|
||||||
assert(MVT::isVector(Op.getValueType()) && "Cannot split non-vector type!");
|
assert(MVT::isVector(Op.getValueType()) && "Cannot split non-vector type!");
|
||||||
SDNode *Node = Op.Val;
|
SDNode *Node = Op.Val;
|
||||||
unsigned NumElements = MVT::getVectorNumElements(Node->getValueType(0));
|
unsigned NumElements = MVT::getVectorNumElements(Op.getValueType());
|
||||||
assert(NumElements > 1 && "Cannot split a single element vector!");
|
assert(NumElements > 1 && "Cannot split a single element vector!");
|
||||||
unsigned NewNumElts = NumElements/2;
|
unsigned NewNumElts = NumElements/2;
|
||||||
MVT::ValueType NewEltVT = MVT::getVectorElementType(Node->getValueType(0));
|
MVT::ValueType NewEltVT = MVT::getVectorElementType(Op.getValueType());
|
||||||
MVT::ValueType NewVT = MVT::getVectorType(NewEltVT, NewNumElts);
|
MVT::ValueType NewVT = MVT::getVectorType(NewEltVT, NewNumElts);
|
||||||
|
|
||||||
// See if we already split it.
|
// See if we already split it.
|
||||||
|
7
test/CodeGen/X86/extractelement-from-arg.ll
Normal file
7
test/CodeGen/X86/extractelement-from-arg.ll
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
; RUN: llvm-as %s -o - | llc -march=x86-64
|
||||||
|
|
||||||
|
define void @test(float* %R, <4 x float> %X) {
|
||||||
|
%tmp = extractelement <4 x float> %X, i32 3
|
||||||
|
store float %tmp, float* %R
|
||||||
|
ret void
|
||||||
|
}
|
Reference in New Issue
Block a user