[PATCH] D64630: [DebugInfo] Address performance regression with r364515
Bjorn Pettersson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 9 06:08:08 PST 2019
bjope added inline comments.
================
Comment at: llvm/lib/CodeGen/RegisterCoalescer.cpp:3365
+
+ // If not, update current liveness record.
+ SlotIndex Slot = Slots.getInstructionIndex(MI);
----------------
I think it is enough to do this if the next instruction isDebugValue. So it could perhaps speed up things if we only do these liveness calculations for the first MI in a sequence of DebugValue (or DebugInstr) instructions?
One idea would be to keep track of if the previous instruction was a DebugValue, move these calculation into the `if (MI.isDebugValue)` above, and do it conditionally when the previous instruction wasn't a DebugValue. E.g. by saving the MachineInstr* pointing to the previous instruction (indicating that we should update RegIsLive/OtherIsLive) whenever a MI that isn't isDebugValue is found.
================
Comment at: llvm/lib/CodeGen/RegisterCoalescer.cpp:3367
+ SlotIndex Slot = Slots.getInstructionIndex(MI);
+ Slot = Slot.getRegSlot();
+ RegIsLive = RegLiveness.liveAt(Slot);
----------------
Is it correct to use the RegSlot here. Maybe it should be getDeadSlot() to make sure the liveAt call below will get "live out" from the MI rather than "live in" (although I'm still learning about these slot indices myself)?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64630/new/
https://reviews.llvm.org/D64630
More information about the llvm-commits
mailing list