[llvm] [InstCombine] Allow min/max in constant BOp min/max folding (PR #142878)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 9 19:40:52 PDT 2025


AlexMaclean wrote:

> There is a willNotOverflow() helper in InstCombine you could use. Do the flags matter in practice for further optimization?

Thanks! I'm not sure about IR optimizations but this would improve our ability to reorder the BinOp and Min/Max instructions during ISel and enable some potential better folding. I've created https://github.com/llvm/llvm-project/pull/143471 so you can see what the change would look like.


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


More information about the llvm-commits mailing list