mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
[SelectionDAG] Teach the vector scalarizer about TRUNCATE.
When a truncate node defines a legal vector type but uses an illegal vector type, the legalization process was splitting the vector until <1 x vector> type, but then it was failing to scalarize the node because it did not know how to handle TRUNCATE. <rdar://problem/14989896> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190830 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -537,7 +537,7 @@ private:
|
||||
// Vector Operand Scalarization: <1 x ty> -> ty.
|
||||
bool ScalarizeVectorOperand(SDNode *N, unsigned OpNo);
|
||||
SDValue ScalarizeVecOp_BITCAST(SDNode *N);
|
||||
SDValue ScalarizeVecOp_EXTEND(SDNode *N);
|
||||
SDValue ScalarizeVecOp_UnaryOp(SDNode *N);
|
||||
SDValue ScalarizeVecOp_CONCAT_VECTORS(SDNode *N);
|
||||
SDValue ScalarizeVecOp_EXTRACT_VECTOR_ELT(SDNode *N);
|
||||
SDValue ScalarizeVecOp_STORE(StoreSDNode *N, unsigned OpNo);
|
||||
|
||||
@@ -371,7 +371,8 @@ bool DAGTypeLegalizer::ScalarizeVectorOperand(SDNode *N, unsigned OpNo) {
|
||||
case ISD::ANY_EXTEND:
|
||||
case ISD::ZERO_EXTEND:
|
||||
case ISD::SIGN_EXTEND:
|
||||
Res = ScalarizeVecOp_EXTEND(N);
|
||||
case ISD::TRUNCATE:
|
||||
Res = ScalarizeVecOp_UnaryOp(N);
|
||||
break;
|
||||
case ISD::CONCAT_VECTORS:
|
||||
Res = ScalarizeVecOp_CONCAT_VECTORS(N);
|
||||
@@ -410,7 +411,7 @@ SDValue DAGTypeLegalizer::ScalarizeVecOp_BITCAST(SDNode *N) {
|
||||
|
||||
/// ScalarizeVecOp_EXTEND - If the value to extend is a vector that needs
|
||||
/// to be scalarized, it must be <1 x ty>. Extend the element instead.
|
||||
SDValue DAGTypeLegalizer::ScalarizeVecOp_EXTEND(SDNode *N) {
|
||||
SDValue DAGTypeLegalizer::ScalarizeVecOp_UnaryOp(SDNode *N) {
|
||||
assert(N->getValueType(0).getVectorNumElements() == 1 &&
|
||||
"Unexected vector type!");
|
||||
SDValue Elt = GetScalarizedVector(N->getOperand(0));
|
||||
|
||||
Reference in New Issue
Block a user