[Mlir-commits] [mlir] [mlir] [arith] Fold trunc(extremum(ext(lhs), ext(rhs))) (PR #214658)

Renato Golin llvmlistbot at llvm.org
Fri Aug 7 02:11:39 PDT 2026


rengolin wrote:

> I was told this may be intentional as some old hardware doesn't have instructions to deal with maximum with fp16. But I think in the higher level we should do such optimizations. And specific hardware can make their own transformations according to their specific details.

It's not that simple. If you add this to the canonical folding, it will always end up folded. If a particular hardware pass _creates_ that pattern because it doesn't support BF16 MAX, it will be reversed in the first canonicalization pass.

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


More information about the Mlir-commits mailing list