[llvm] [MachineBasicBlock] Fix use after free in SplitCriticalEdge (PR #68786)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 03:41:13 PDT 2023


================
@@ -156,12 +156,14 @@ void ilist_traits<MachineInstr>::addNodeToList(MachineInstr *N) {
   MachineFunction *MF = Parent->getParent();
   N->addRegOperandsToUseLists(MF->getRegInfo());
   MF->handleInsertion(*N);
+  Parent->noteInsertion(*N);
----------------
jayfoad wrote:

Also if we're going to have both per-MF and per-MBB delegates, I wonder if there is some clever way of implementing this so that we only require one `handleInsertion` call here, and the MBB handleInsertion automatically forwards to the MF handleInsertion. Or vice versa.

As you can probably tell I have not thought this through, just wondering if we can reduce the overhead when there are no MF delegates **and** no MBB delegates.

https://github.com/llvm/llvm-project/pull/68786


More information about the llvm-commits mailing list