[llvm] [DebugInfo][NewGVN] Fix debug value loss (PR #147634)

Vladislav Dzhidzhoev via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 9 03:06:08 PDT 2025


================
@@ -4076,6 +4076,7 @@ bool NewGVN::eliminateInstructions(Function &F) {
                 if (!match(DefI, m_Intrinsic<Intrinsic::ssa_copy>()))
                   patchReplacementInstruction(DefI, DominatingLeader);
 
+                salvageDebugInfo(*DefI);
----------------
dzhidzhoev wrote:

Should this be moved inside the loop https://github.com/llvm/llvm-project/blob/95cb8336d1598780d66eeb85d8fcb1c9a433a459/llvm/lib/Transforms/Scalar/NewGVN.cpp#L3527 to salvage more instructions?

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


More information about the llvm-commits mailing list