Assert that MachineLICM does not move a debug instruction and then drop
its debug location. Later passes require each debug instruction to have
a location.
Testing: check-llvm, clang stage2 RelWithDebInfo build (x86_64)
Differential D80665
[MachineLICM] Assert that locations from debug insts are not lost vsk on May 27 2020, 2:17 PM. Authored by
Details Assert that MachineLICM does not move a debug instruction and then drop Testing: check-llvm, clang stage2 RelWithDebInfo build (x86_64)
Diff Detail
Event TimelineComment Actions As we discussed offline, I think the assertion makes sense, so LGTM. It's good to catch violations while we decide what to do with hoisting (what are the semantics et similia). Comment Actions That's a good point. I went ahead and took a stab at this: https://reviews.llvm.org/D80670. Comment Actions LGTM -- I'd suggest that the assertion messages could become something like "Shouldn't be hoisting debug instructions" or similar. IMO, as well as the matter of dropping DebugLocs, debug instructions should (almost?) never appears as a candidate to be moved around like another instruction. Comment Actions While I agree with you in theory, the classical counterexample for this claim is merging successors in predecessors, or all the CFG'ish transformations that SimplifyCFG is very good at doing. In that case you just move full blocks around and the likelihood of moving DebugInfo around is very high. Comment Actions LICM and MachineLICM really don't quite suffer from this problem, as you already pointed out. |