Add handling for subrange updates in LiveInterval preservation.
This requires extending MachineBasicBlock::SplitCriticalEdge
to also update subrange intervals.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/LiveIntervals.cpp | ||
---|---|---|
865–866 | Probably should move to getOrCreateEmptyInterval helper |
There is a memory leak likely from this patch https://lab.llvm.org/buildbot/#/builders/5/builds/36572
Unfortunately build was broken by unrelated patch, not it's fixed, and we see the leak.
Please reply if you have a quick fix, or I will try to revert it.
llvm/lib/CodeGen/MachineBasicBlock.cpp | ||
---|---|---|
1169 | @arsenm / @foad - can you let me know if you are happy with this fix to obviously wrong use after free code that existed previously? Basically the old code takes pointers to terminators that will be removed by TII->removeBranch() then dereferences them later to update the maps. Other possible ways I can see to this:
The problems are: |
llvm/lib/CodeGen/MachineBasicBlock.cpp | ||
---|---|---|
1169 | I am not familiar with this code. Could you pass an optional SlotIndexes * into updateTerminator, and have it do the updates itself? |
llvm/lib/CodeGen/MachineBasicBlock.cpp | ||
---|---|---|
1169 | I'd expect these updates to happen at the time the actual mutation happens, so have updateTerminator doing t |
llvm/lib/CodeGen/MachineBasicBlock.cpp | ||
---|---|---|
1169 | Simply passing SlotIndexes to updateTerminator is insufficient. To truly pass SlotIndexes all the way down is an all targets change. |
llvm/lib/CodeGen/MachineBasicBlock.cpp | ||
---|---|---|
1169 | Hmm, I think it's probably still the right way to do it though. |
llvm/lib/CodeGen/MachineBasicBlock.cpp | ||
---|---|---|
1169 | I have put in a PR for fixing the SlotIndexes issue: https://github.com/llvm/llvm-project/pull/66188 |
Probably should move to getOrCreateEmptyInterval helper