mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-14 17:34:41 +00:00
When promoting the vector elements in CopyToParts, use vector trunc
instead of scalarizing, and doing an element-by-element truncat. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133382 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c17d3552da
commit
c6341e6e50
@ -475,17 +475,9 @@ static void getCopyToPartsVector(SelectionDAG &DAG, DebugLoc DL,
|
|||||||
PartVT.getVectorNumElements() == ValueVT.getVectorNumElements()) {
|
PartVT.getVectorNumElements() == ValueVT.getVectorNumElements()) {
|
||||||
|
|
||||||
// Promoted vector extract
|
// Promoted vector extract
|
||||||
unsigned NumElts = ValueVT.getVectorNumElements();
|
bool Smaller = PartVT.bitsLE(ValueVT);
|
||||||
SmallVector<SDValue, 8> NewOps;
|
Val = DAG.getNode((Smaller ? ISD::TRUNCATE : ISD::ANY_EXTEND),
|
||||||
for (unsigned i = 0; i < NumElts; ++i) {
|
DL, PartVT, Val);
|
||||||
SDValue Ext = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL,
|
|
||||||
ValueVT.getScalarType(), Val ,DAG.getIntPtrConstant(i));
|
|
||||||
SDValue Cast = DAG.getNode(ISD::ANY_EXTEND,
|
|
||||||
DL, PartVT.getScalarType(), Ext);
|
|
||||||
NewOps.push_back(Cast);
|
|
||||||
}
|
|
||||||
Val = DAG.getNode(ISD::BUILD_VECTOR, DL, PartVT,
|
|
||||||
&NewOps[0], NewOps.size());
|
|
||||||
} else{
|
} else{
|
||||||
// Vector -> scalar conversion.
|
// Vector -> scalar conversion.
|
||||||
assert(ValueVT.getVectorNumElements() == 1 &&
|
assert(ValueVT.getVectorNumElements() == 1 &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user