[llvm] [SimplifyCFG] Preserve common TBAA metadata when hoisting instructions. (PR #97158)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 03:13:37 PST 2024


nikic wrote:

> Thanks, updated this PR to relax `EqTermsOnly` to allow hoisting for equivalent instructions. Could also limit to cases with 2 successors, similarly to `FoldTwoEntryPHINode`. Is that along the lines you had in mind?

Not really. What I had in mind is that we only allow early hoisting if it actually ends up deduplicating the blocks entirely, i.e. we either hoist everything including the terminators, or nothing. That seems in the spirit of what the EqTermsOnly condition was doing previously.

If you only allow hoisting identical instructions, then I think that's not really materially different from just allowing *all* hoisting. I think the only thing that would disable is the more sophisticated heuristics for finding those identical instructions?

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


More information about the llvm-commits mailing list