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

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 30 13:22:37 PDT 2024


================
@@ -1435,6 +1439,51 @@ bool VPlanTransforms::tryAddExplicitVectorLength(VPlan &Plan) {
   return true;
 }
 
+void VPlanTransforms::addExplicitVectorLengthForCSA(
+    VPInstruction *VPEVL, const MapVector<PHINode *, VPCSAState *> &CSAStates,
+    bool PlanHasScalarVFOnly) {
+
+  // We build the scalar version of a CSA when VF=ElementCount::getFixed(1),
+  // which does not require an EVL.
+  if (PlanHasScalarVFOnly)
+    return;
+
+  for (auto CSA : CSAStates) {
----------------
artagnon wrote:

`auto &[_, CSAState] : CSAStates`?

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


More information about the llvm-commits mailing list