[llvm] [LV] Add support for extended fadd reductions (PR #178447)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 29 06:47:29 PST 2026


================

----------------
sdesmalen-arm wrote:

> Nit: Maybe leave a note somewhere that Floating-point extended reductions are not currently supported and will be given an invalid cost? It's easy to get confused with the code matching reductions. Initially, I read that code and thought it would disallow all FP reductions, but it's only for extended reductions.

Specifically, it's for extended reductions to a scalar value. I've added a comment that the interface for `getExtendedReductionCost` doesn't yet handle FP reductions.

> I'm also wondering if it wouldn't be easier to just have the two TTI cost hooks to handle both FP and Integer? getExtendedReductionCost would return Invalid for FP types.

I think it would, but the interface for `getExtendedReductionCost` currently has a parameter named `bool IsUnsigned` which makes that a bit tricky to change. Oddly enough, it does take FastMathFlags :) I'll see if I can fix this in a follow-up patch.

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


More information about the llvm-commits mailing list