[llvm] [RISCV][CostModel] Estimate cost of llvm.vector.reduce.fmaximum/fminimum (PR #80697)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 14:35:25 PDT 2024


preames wrote:

Not by any means an FP expert, but isn't there a massively better lowering available here?

Written as a vector pseudo language:

```
masknan = foreach lane in input, isnan(lane)
masknegzero  = foreach lane in input, isnegzero(lane)
scalar = reduce.fmin(input)
if anyof(masknan)
  scalar = v[clz(masknan);
if scalar == 0.0 and anyof(masknegzero)
  scalar = 0.0

```
If so, I'd be tempted to fix that before worrying about the costing in TTI. 

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


More information about the llvm-commits mailing list