[llvm] [DebugInfo][RemoveDIs] Instrument loop-rotate for DPValues (PR #72997)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 21 14:50:30 PST 2023
================
@@ -539,6 +575,20 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) {
if (auto *Decl = dyn_cast<NoAliasScopeDeclInst>(&I))
NoAliasDeclInstructions.push_back(Decl);
+ Module *M = OrigHeader->getModule();
+
+ // Track the next DPValue to clone. If we have a sequence where an
+ // instruction is hoisted instead of being cloned:
+ // DPValue blah
+ // %foo = add i32 0, 0
+ // DPValue xyzzy
+ // %bar = call i32 @foobar()
+ // where %foo is hoisted, then the DPValue "blah" will be seen twice, once
+ // attached to %foo, then to %bar as it will "fall down" onto the call.
+ // cloneDebugInfoFrom takes an optional "start cloning from here" position
+ // to account for this behaviour.
----------------
OCHyams wrote:
"will be seen twice" - is that behaviour that occurs without some intervention or behaviour you're intending to cause? It's not obvious from the comment IMO. Are you able to reword it a bit to make it clearer?
https://github.com/llvm/llvm-project/pull/72997
More information about the llvm-commits
mailing list