[llvm] Support CSA for floating-point & pointer types (PR #182313)

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 19 09:28:16 PST 2026


================
@@ -882,7 +882,9 @@ bool LoopVectorizationLegality::canVectorizeInstr(Instruction &I) {
 
     RecurrenceDescriptor RedDes;
     if (RecurrenceDescriptor::isReductionPHI(Phi, TheLoop, RedDes, DB, AC, DT,
-                                             PSE.getSE())) {
+                                             PSE.getSE()) &&
+        (RedDes.getRecurrenceKind() != RecurKind::FFindLast || !TTI ||
+         TTI->isLegalToVectorizeReduction(RedDes, ElementCount::getFixed(4)))) {
----------------
huntergr-arm wrote:

This seems overly specific (VF of 4, when we haven't assembled any plans? was it just to check against the default implementation you added?), and shouldn't really be needed anyway. We should be able to generate this for any fixed VF, even if it requires scalarization.

For scalable types, `isScalableVectorizationAllowed()` will reject loops with an unsupported reduction, since we don't scalarize for those types.

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


More information about the llvm-commits mailing list