[llvm] [InstCombine] Fold max(max(x, c1) << c2, c3) —> max(x << c2, c3) when c3 >= c1 * 2 ^ c2 (PR #140526)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 27 09:54:31 PDT 2025


Charukesh827 wrote:

I wrote rightDistributesOverLeft function with the knowledge i have on this opt, please let me know is anything to be added or removed.

I considered only Add, Sub, Mul, Shl operation, as i was able to verify only these.

another optimization(i didn't write) dominates this optimization
Alive2 : [https://alive2.llvm.org/ce/z/sMAnf_](https://alive2.llvm.org/ce/z/sMAnf_)

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


More information about the llvm-commits mailing list