-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Copy missing metadata to new inst created from existing inst #84357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Copy missing debugloc for usigned inst created from signed inst
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-function-specialization @llvm/pr-subscribers-llvm-transforms Author: None (EnidXiong) ChangesPreviously in replaceSignedInst of SCCPSolver.cpp, the new usigned instructions created from the signed instructions are missing debug messages as the metadata are not being propagated over. Full diff: https://github.com/llvm/llvm-project/pull/84357.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Utils/SCCPSolver.cpp b/llvm/lib/Transforms/Utils/SCCPSolver.cpp
index a185e8cd371c60..233c097f591805 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);
|
|
Thanks for the patch! It looks like this patch needs a test, showing that without this patch the debug info metadata gets dropped.
Please also see this message above and set up Github to use a public email |
Previously in replaceSignedInst of SCCPSolver.cpp, the new usigned instructions created from the signed instructions are missing debug messages as the metadata are not being propagated over.
Added a line to copy the metadata of the old inst to the new one.