[llvm] [RFC][GlobalISel] Use Builders in MatchTable (PR #65955)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 22 03:34:46 PDT 2023
================
@@ -1239,8 +1258,11 @@ bool GIMatchTableExecutor::executeMatchTable(
DEBUG_WITH_TYPE(TgtExecutor::getName(),
dbgs() << CurrentIdx << ": GIR_EraseFromParent(MIs["
<< InsnID << "])\n");
- if (Observer)
- Observer->erasingInstr(*MI);
+ // If we're erasing the insertion point, ensure we don't leave a dangling
+ // pointer in the builder.
+ if (Builder.getInsertPt() == MI)
+ Builder.setInsertPt(*MI->getParent(), ++MI->getIterator());
+ Observer.erasingInstr(*MI);
----------------
qcolombet wrote:
I believe this fixes a problem that is independent from this PR.
Could you commit that part separately (and with a test if possible)?
https://github.com/llvm/llvm-project/pull/65955
More information about the llvm-commits
mailing list