[llvm] [DebugInfo][InstCombine] When replacing bswap idiom, add DebugLoc to new insts (PR #114231)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 4 11:34:26 PST 2024


dwblaikie wrote:

In terms of a policy change - I could see an argument for "we didn't merge these instructions, we replaced the last instruction with some other instruction and optimized the rest of the instructions away" - though how do we differentiate these cases, does this apply to every "merged" instruction? 

Oh, I guess there's a real difference here - merged instructions that come from things like hoisting and lowering (we took two equivalent instructions in different branches and effectively deduplicated them at some common point before or after) versus we took a series of instructions and collapsed them into one.

Perhaps we could say in the latter case, we always use the location of the final instruction in the original sequence? (do we define fallbacks? if that final instruction doesn't have a location we should use one of the others? If they're in the same basic block? (though sounds like you folks would be pushing back on implementing such a fallback here as tracking the set of locations that flow into this transformation is too expensive?))

https://github.com/llvm/llvm-project/pull/114231


More information about the llvm-commits mailing list