mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Fixed scalarizing an extract subvector and prevent an infinite loop
when simplify a vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58820 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -7516,8 +7516,8 @@ SDValue SelectionDAGLegalize::ScalarizeVectorOp(SDValue Op) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ISD::EXTRACT_SUBVECTOR:
|
case ISD::EXTRACT_SUBVECTOR:
|
||||||
Result = Node->getOperand(0);
|
Result = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, NewVT, Node->getOperand(0),
|
||||||
assert(Result.getValueType() == NewVT);
|
Node->getOperand(1));
|
||||||
break;
|
break;
|
||||||
case ISD::BIT_CONVERT: {
|
case ISD::BIT_CONVERT: {
|
||||||
SDValue Op0 = Op.getOperand(0);
|
SDValue Op0 = Op.getOperand(0);
|
||||||
|
@@ -1410,6 +1410,12 @@ Value *InstCombiner::SimplifyDemandedVectorElts(Value *V, uint64_t DemandedElts,
|
|||||||
} else if (isa<ConstantAggregateZero>(V)) {
|
} else if (isa<ConstantAggregateZero>(V)) {
|
||||||
// Simplify the CAZ to a ConstantVector where the non-demanded elements are
|
// Simplify the CAZ to a ConstantVector where the non-demanded elements are
|
||||||
// set to undef.
|
// set to undef.
|
||||||
|
|
||||||
|
// Check if this is identity. If so, return 0 since we are not simplifying
|
||||||
|
// anything.
|
||||||
|
if (DemandedElts == ((1ULL << VWidth) -1))
|
||||||
|
return 0;
|
||||||
|
|
||||||
const Type *EltTy = cast<VectorType>(V->getType())->getElementType();
|
const Type *EltTy = cast<VectorType>(V->getType())->getElementType();
|
||||||
Constant *Zero = Constant::getNullValue(EltTy);
|
Constant *Zero = Constant::getNullValue(EltTy);
|
||||||
Constant *Undef = UndefValue::get(EltTy);
|
Constant *Undef = UndefValue::get(EltTy);
|
||||||
|
Reference in New Issue
Block a user