diff --git a/llvm/lib/Transforms/Utils/SCCPSolver.cpp b/llvm/lib/Transforms/Utils/SCCPSolver.cpp index a185e8cd371c6..233c097f59180 100644 --- a/llvm/lib/Transforms/Utils/SCCPSolver.cpp +++ b/llvm/lib/Transforms/Utils/SCCPSolver.cpp @@ -210,6 +210,7 @@ static bool replaceSignedInst(SCCPSolver &Solver, // Wire up the new instruction and update state. assert(NewInst && "Expected replacement instruction"); + NewInst->copyMetadata(Inst); NewInst->takeName(&Inst); InsertedValues.insert(NewInst); Inst.replaceAllUsesWith(NewInst);