This fixes an assertion failure with -early-live-intervals when trying
to update the live intervals for a dbug instruction, which don't even
have slot indexes.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Any other comments?
llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | ||
---|---|---|
958–959 | Adjust this - since we're not actually moving the debug instr copies |
llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | ||
---|---|---|
958–959 | Not quite sure what you mean. The instructions in the range [AfterMI,End) are a mixture of copies and debug instructions. We are moving all of them, but (with this patch) only updating LiveIntervals when we move a copy. I think the comment above is still accurate. Did you have a suggestion for improving it? |
Let's fix the condition then this is good to go.
llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | ||
---|---|---|
958–959 | I also needed a while to understand this comment, since it implies that there are only COPY instructions here. I think you should either tweak the comment to say that there may be debug or pseudo instructions mixed in or add a comment before the if (isDebugOrPseudoInstr(). | |
963–964 | The condition used in SlotIndexes.cpp and in skipDebugInstructionsForward (I wish it had a better name) seems to be isDebugOrPseudoInstr(). You could go for LiveIntervals::hasIndex() instead to be safe for future changes (at the cost of an extra map lookup). I'll let you make the call depending on how perf critical you judge this part. |
Adjust this - since we're not actually moving the debug instr copies