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

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 08:09:44 PDT 2023


qcolombet wrote:

> > Could we fix `SplitCriticalEdges` instead of pushing the burden of the SlotIndex update to all backends?
> 
> I am open to alternatives. From my perspective it is this, or add some kind of listener pattern to `MachineBasicBlock` so `SplitCriticalEdges` can intercept instructions added or removed by target specific code.

The listener alternative sounds better to me.
This is how we handle this kind of things in MIR in general (look for Delegate in MachineFunction, MachineRegisterInfo, etc.)

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


More information about the llvm-commits mailing list