[llvm] [DebugInfo][RemoveDIs] Instrument jump-threading to update DPValues (PR #73127)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 23 06:09:33 PST 2023


================
@@ -410,6 +410,10 @@ static bool replaceFoldableUses(Instruction *Cond, Value *ToVal,
   if (Cond->getParent() == KnownAtEndOfBB)
     Changed |= replaceNonLocalUsesWith(Cond, ToVal);
   for (Instruction &I : reverse(*KnownAtEndOfBB)) {
+    // Replace any debug-info record users of Cond with ToVal.
+    for (DPValue &DPV : I.getDbgValueRange())
+      DPV.replaceVariableLocationOp(Cond, ToVal, true);
----------------
OCHyams wrote:

Is the `AllowEmpty` (3rd parameter) situation something to do with use-before-defs?

https://github.com/llvm/llvm-project/pull/73127


More information about the llvm-commits mailing list