[llvm] [RemoveDIs][DebugInfo] Handle DPVAssign in most transforms (PR #78986)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 11:19:47 PST 2024


================
@@ -1761,6 +1761,11 @@ bool SimplifyCFGOpt::hoistSuccIdenticalTerminatorToSwitchOrIf(
       OtherSuccTI->replaceAllUsesWith(NT);
     NT->takeName(I1);
   }
+  // Also clone DPValues from the existing terminator, and all others (to
+  // duplicate existing hoisting behaviour).
+  NT->cloneDebugInfoFrom(I1);
+  for (Instruction *OtherSuccTI : OtherSuccTIs)
+    NT->cloneDebugInfoFrom(OtherSuccTI);
----------------
SLTozer wrote:

This should probably be split out of here - I think this is a general DPValue bug that I found while validating the assignment tracking patches; I'll create a separate patch with a reduced reproducer as the test case.

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


More information about the llvm-commits mailing list