[PATCH] D112006: [DebugInfo][InstrRef] Add unit tests for transfer-function building

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 18 08:52:14 PDT 2021


jmorse added inline comments.


================
Comment at: llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp:1111-1114
-  // Analyse these only when solving the machine value location problem.
-  if (VTracker || TTracker)
-    return true;
-
----------------
a) the comment here was wrong, but b) it's important that DBG_PHI instructions are interpreted when building the machine-value transfer function. If there are register operands of DBG_PHIs, they and their subregisters should be tracked. We risk building in some assumption that they're not tracked if we don't do it immediately.

(In the past I've allocated some vectors for "all the registers", then found the number of registers being tracked changed later).


================
Comment at: llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp:1264-1270
+    // This will force SrcSubReg to be tracked, if it isn't yet. Will read
+    // mphi values if it wasn't tracked.
+    LocIdx SrcL = MTracker->lookupOrTrackRegister(SrcSubReg);
+    LocIdx DstL = MTracker->lookupOrTrackRegister(DstSubReg);
+    (void)SrcL;
     (void)DstL;
+    ValueIDNum CpyValue = MTracker->readReg(SrcSubReg);
----------------
The old implementation of this calculated a new value number for the copy-destinations subregisters, this now reads the source subregister.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112006



More information about the llvm-commits mailing list