PassManager: invalidate analysis if a pass forgot to do so.

If a pass forgot to call invalidateAnalysis but deleted some instructions, the pass-manager can fix this.

Currently following passes do not invalidate analysis when they change the SIL:
* LowerTupleAddrConstructor
* DestroyAddrHoisting
* MoveOnlyChecker
* PredictableDeadAllocationElimination

Ideally we should fix those passes. But with this addition in the pass-manager it's not strictly necessary.

Fixes a compiler crash.
This commit is contained in:
Erik Eckstein
2025-02-14 08:08:22 +01:00
parent 5c1a02adfd
commit 9b143d876b
2 changed files with 15 additions and 0 deletions

View File

@@ -1056,6 +1056,10 @@ public:
/// See scheduledForDeletion for details.
void flushDeletedInsts();
bool hasInstructionsScheduledForDeletion() const {
return !scheduledForDeletion.empty();
}
/// Looks up the llvm intrinsic ID and type for the builtin function.
///
/// \returns Returns llvm::Intrinsic::not_intrinsic if the function is not an