[PATCH] D128101: [DebugInfo][InstrRef] Fix error in copy handling in InstrRefLDV

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 08:16:55 PDT 2022


StephenTozer added inline comments.


================
Comment at: llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp:1777
   if (TTracker && isCalleeSavedReg(DestReg) && SrcRegOp->isKill())
     TTracker->transferMlocs(MTracker->getRegMLoc(SrcReg),
                             MTracker->getRegMLoc(DestReg), MI.getIterator());
----------------
Orlando wrote:
> Is it significant that the "The copy might have clobbered variables based on the destination register" loop has moved above up above this part? 
Yes - the order in which we want these operations performed is:

  # Keep track of the variables in the Dest and what value(s) they referred to.
  # Update our location->value tracker to reflect the copy.
  # Find a new location for (or undef) the variables that were in Dest.
  # Now that "Dest" is empty, transfer the variables that were in Source to Dest.

Step 3 should come before step 4 because we want to empty out the bucket for Dest before moving other variables into it, otherwise TTracker may be confused about which variables were previously there and which ones have just been moved there.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128101



More information about the llvm-commits mailing list