Files
llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
Philip Reames b4c1e1a14e [RISCV] Expand fcanonicalize on vector types (#193842)
This change does a couple of related things:
1) It changes the default expansion strategy for scalable
   vectors for fcanonicalize.  This switches us from
   emitting a loop (directly parallel to unrolling)
   to using the already available fmul expansion.
2) Mark RISC-V legal scalable vector types as Expand
   to leverage the previous item.
3) Wrap fixed vector types in their corresponding
   scalable types to avoid unrolling.

The net effect is to improve the lowering for fixed vector cases and to
no longer crash for the scalable ones. We were crashing because the
scalable cases were marked Legal, not Expand. We could have just fixed that, but doing everyone at once seemed like a good investment.

Note that we can also choose to follow Aarch64 and consider a vfmin
based lowering. I left that until later thought it is worthwhile noting
that's what we do for scalar code.
2026-04-24 23:38:26 +00:00

86 KiB