[region-isolation] Fix crash due to missing visitVectorBaseAddrInst case

Credit to https://github.com/stzn for initial work on the patch.

rdar://151401230
This commit is contained in:
stzn
2025-05-18 19:01:50 +09:00
committed by Michael Gottesman
parent 62c886e13b
commit 660263cf2c
3 changed files with 59 additions and 3 deletions

View File

@@ -141,7 +141,16 @@ struct AddressBaseComputingVisitor
return SILValue();
}
SILValue visitNonAccess(SILValue) { return SILValue(); }
SILValue visitNonAccess(SILValue value) {
// For now since it is late in 6.2, work around vector base addr not being
// treated as a projection.
if (auto *v = dyn_cast<VectorBaseAddrInst>(value)) {
isProjectedFromAggregate = true;
return v->getOperand();
}
return SILValue();
}
SILValue visitPhi(SILPhiArgument *phi) {
llvm_unreachable("Should never hit this");
@@ -312,6 +321,7 @@ static bool isStaticallyLookThroughInst(SILInstruction *inst) {
case SILInstructionKind::UncheckedEnumDataInst:
case SILInstructionKind::StructElementAddrInst:
case SILInstructionKind::TupleElementAddrInst:
case SILInstructionKind::VectorBaseAddrInst:
return true;
case SILInstructionKind::MoveValueInst:
// Look through if it isn't from a var decl.