By default these will expand back to cmp/sel, but some targets (X86) has optimized costs for scalar integer min/max patterns which are lower than the default expansion (pre-SSE41 is particularly weak for vector min/max support).
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I was considering updating all the LoopUtils minmax reduction helpers to work with the intrinsics directly (createMinMaxOp in particular), but I'm concerned that we don't guarantee minnum/maxnum handling on all backends. I could still do this for the integer cases at least?
For integers using the intrinsics definitely makes sense. For FP, that depends on whether non-nnan reductions are supported. If these are always nnan then minnum/maxnum should be fine (at least I think we consider those to be the canonical form).