Full analysis in: https://bugs.llvm.org/show_bug.cgi?id=46120
tl;dr: avoid jumpiness in line tables
Details
Diff Detail
Event Timeline
That's a pretty long test case for a one-line patch; there's no existing zext testcase where you can just add !dbg metadata?
Still looking for a reduced tescase but I noticed another bug, so I put another review online:
https://reviews.llvm.org/D81879
I tried really hard to reduce this one but I failed. I guess I can either drop this review or I'm happy to hear suggestions. @probinson
Lgtm with minor nitpicks inline, thanks!
llvm/lib/CodeGen/CodeGenPrepare.cpp | ||
---|---|---|
2652 | To quibble: s/would/could/ might be more fair, since we're conservatively dropping the location just in case the created instruction gets moved around after the fact -- it's just that this tends to happen a lot :). Also, maybe moving this to the TypePromotionAction class definition would serve as a more general warning? |
Committed
commit 1cbaf847ab84f37d9044d867b5ed8ae646c6ebc9 (HEAD -> master, origin/master, origin/HEAD) Author: Davide Italiano <ditaliano@apple.com> Date: Wed Jun 17 10:29:47 2020 -0700 [CGP] Reset the debug location when promoting zext(s). When the zext gets promoted, it used to retain the original location, which pessimizes the debugging experience causing an unexpected jump in stepping at -Og. Fixes https://bugs.llvm.org/show_bug.cgi?id=46120 (which also contains a full C repro). Differential Revision: https://reviews.llvm.org/D81437
Might be worth moving parts of this comment near the TypePromotionTransaction definition, to justify why those clear the IRBuilder debug loc?