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

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 13 10:05:10 PST 2025


================
@@ -269,6 +269,12 @@ class LoopVectorizationLegality {
   /// induction descriptor.
   using InductionList = MapVector<PHINode *, InductionDescriptor>;
 
+  /// ConditionalScalarAssignmentList contains the
+  /// ConditionalScalarAssignmentDescriptors for all the conditional scalar
+  /// assignments  that were found in the loop, rooted by their phis.
+  using ConditionalScalarAssignmentList =
+      MapVector<PHINode *, ConditionalScalarAssignmentDescriptor>;
----------------
michaelmaitland wrote:

`isConditionalScalarAssignmentPhi` is using the lookup functionality. Using a SmallVector here would be bad for performance since we'd have to iterate through to find Phi.

This data structure is analogous to `ReductionList` and `InductionList` which are also using MapVector.

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


More information about the llvm-commits mailing list