`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> |
||
|---|---|---|
| .. | ||
| mlir | ||
| mlir-c | ||