[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
Thu Nov 7 09:54:12 PST 2024


dwblaikie wrote:

Perhaps the simplest way to think of it is that replacing, say "add(a, add(b, c))" with "add(a, b, c)" isn't /replacing/ the second add, so it's not merging two adds, it's only replacing the outer add - which has the effect of adding a, b, and c (initially by relying on the result of the add(b, c), but then without relying on that anymore - the add(b, c) might still continue to exist, be used by other things, etc.

So it might be more consistent with our existing guidance than it first apperas - still good to write it up, but that might be a way to describe it that makes the unifying principles simpler/clearer as to why this conclusion applies.

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


More information about the llvm-commits mailing list