[clang] [llvm] [InstCombine] fold float clamp pattern into llvm.max/min (PR #159652)

Joshua Cranmer via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 25 07:55:48 PDT 2025


jcranmer-intel wrote:

> On second thought, why does instcombine need to do this? Don't we already do this late, in CodeGenPrepare or DAGBuilder? The exact min/max operation you want will be target dependent, and this is introducing new constraints to the operation

There is some value in canonicalizing on a particular form for FP min/max operations, but given that there are four slightly different definitions and that hardware ISAs vary as to which one(s) they implement, I'm not sure I could in good conscience advocate one to canonicalize on.

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


More information about the llvm-commits mailing list