mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 21:34:23 +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()) {
|
||||
|
||||
// Promoted vector extract
|
||||
unsigned NumElts = ValueVT.getVectorNumElements();
|
||||
SmallVector<SDValue, 8> NewOps;
|
||||
for (unsigned i = 0; i < NumElts; ++i) {
|
||||
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());
|
||||
bool Smaller = PartVT.bitsLE(ValueVT);
|
||||
Val = DAG.getNode((Smaller ? ISD::TRUNCATE : ISD::ANY_EXTEND),
|
||||
DL, PartVT, Val);
|
||||
} else{
|
||||
// Vector -> scalar conversion.
|
||||
assert(ValueVT.getVectorNumElements() == 1 &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user