[PATCH] D113123: [TwoAddressInstruction] Fix handling of operands tied to early-clobbers

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 8 08:55:39 PST 2021


MatzeB added a comment.

I can't shake the feeling that we would be better of having the `convertToThreeAddress` callback fix the liveness information like it is doing with `LV`, rather than guessing around after the fact with `repairIntervalsInRange`... Not sure what the original intention here was and if its fair to ask for that big refactoring now...



================
Comment at: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:708-718
+  if (LIS && SingleInst) {
+    SlotIndex Idx = LIS->ReplaceMachineInstrInMaps(*mi, *NewMI);
+
+    // RegB was tied to RegA. If RegA is early-clobber then the live range of
+    // RegB would have ended at an early-clobber slot, but now they are not tied
+    // we need to update it to the normal register slot.
+    LiveInterval &LI = LIS->getInterval(RegB);
----------------
You fix the early-clobber -> register case, but I guess register->early clobber could happen too, given that we don't really know what instruction is involved here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113123/new/

https://reviews.llvm.org/D113123



More information about the llvm-commits mailing list