[llvm] [LV][VPlan] Add initial support for CSA vectorization (PR #106560)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 22 13:20:06 PST 2024


================
@@ -1570,3 +1571,58 @@ bool InductionDescriptor::isInductionPHI(
   D = InductionDescriptor(StartValue, IK_PtrInduction, Step);
   return true;
 }
+
+/// Return CSADescriptor that describes a CSA that matches one of these
+/// patterns:
+///   phi loop_inv, (select cmp, value, phi)
+///   phi loop_inv, (select cmp, phi, value)
+///   phi (select cmp, value, phi), loop_inv
+///   phi (select cmp, phi, value), loop_inv
+/// If the CSA does not match any of these paterns, return a CSADescriptor
+/// that describes an InvalidCSA.
+bool CSADescriptor::isCSAPhi(PHINode *Phi, Loop *TheLoop, CSADescriptor &CSA) {
+
+  // Must be a scalar
----------------
fhahn wrote:

```suggestion
  // Must be a scalar.
```

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


More information about the llvm-commits mailing list