[llvm] [InstCombine] Avoid foldCmpLoadFromIndexedGlobal for multi-use load (PR #151524)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 2 09:30:01 PDT 2025


dtcxzyw wrote:

> The llvm-opt-benchmark results look fairly mixed to me. One very common case is where the load is multi-use, but ends up being sunk into a branch behind the check, which is likely beneficial.
> 
> For OOO cores the transform may be valuable even in multi-use cases, because the condition can be computed without waiting for the load to complete.
> 
> Overall I'm not sure whether we should change something here or not. Or possibly we should use less aggressive checks.
> 
> Thoughts?

Make sense. Folding icmps with multi-use load looks better. But it deserves a comment here. Then we can avoid discussing the same problem in the future.
BTW, this patch still shows some missed optimizations (e.g., bench/icu/optimized/tzfmt.ll). Perhaps we can catch them in another way.



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


More information about the llvm-commits mailing list