[DebugInfo] Fix jump threading failing to update cloned dbg.values
authorBen Mudd <Ben.Mudd@sony.com>
Mon, 9 Jan 2023 11:04:39 +0000 (11:04 +0000)
committerStephen Tozer <Stephen.Tozer@Sony.com>
Mon, 9 Jan 2023 11:42:33 +0000 (11:42 +0000)
commit1f11d1bd1261f8126b1d04faa9231cab87633e66
tree3bf7455eac5d4df69da75a98f9b0f5a231691d06
parentcad065da47600c8ebae19fe1e1e0f2f564536745
[DebugInfo] Fix jump threading failing to update cloned dbg.values

This is a patch to fix duplicated dbg.values in the JumpThreading pass not
pointing towards their local value, and instead towards the variable in the
original block.
JumpThreadingPass::cloneInstructions is the changed function to target metadata
as well as normal cloned values.

Reviewed By: jmorse, StephenTozer

Differential Revision: https://reviews.llvm.org/D140006
llvm/lib/Transforms/Scalar/JumpThreading.cpp
llvm/test/Transforms/JumpThreading/thread-debug-info.ll [new file with mode: 0644]