mirror-llvm-project/mlir/include
Md Abdullah Shahneous Bari 9e43e04108
[mlir][arith] Gate min/max expansion in arith-expand behind include-min-max (#211884)
`arith-expand` expanded `arith.maximumf`/`minimumf`/`maxnumf`/`minnumf`
and the signed/unsigned integer max/min ops into `cmpf`/`cmpi` +
`select` sequences. These ops also have a direct arith-to-llvm lowering
to the `llvm.intr.maximum`/`minimum`/... intrinsics, which are a single
hardware instruction on many targets. Pipelines that run arith-to-llvm
after arith-expand (e.g. the GPU-to-XeVM pipeline) therefore paid a
large, avoidable overhead.

Add `include-min-max-f` (the float ops
maximumf/minimumf/maxnumf/minnumf) and `include-min-max-i` (the
signed/unsigned integer ops maxsi/maxui/minsi/minui) option (default `false`, changing the existing
behavior) that controls whether these min/max ops are expanded. The
min/max converters are factored into new
`populateExpandMinMaxFPatterns` and
`populateExpandMinMaxIPatterns`; the ceil/floor-div and scaling ext/trunc
expansions (which have no LLVM lowering) always run.

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-30 12:05:27 -05:00
..
mlir [mlir][arith] Gate min/max expansion in arith-expand behind include-min-max (#211884) 2026-07-30 12:05:27 -05:00
mlir-c [MLIR][APFloat] Add Type definitions for UE5M3 type (#212712) 2026-07-30 18:45:58 +05:30