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

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 06:15:13 PDT 2024


================
@@ -0,0 +1,78 @@
+//===------------- CSADescriptors.h - CSA Descriptors -----------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file "describes" conditional scalar assignments (CSA).
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Analysis/LoopInfo.h"
+#include "llvm/IR/Instructions.h"
+#include "llvm/IR/Value.h"
+
+#ifndef LLVM_ANALYSIS_CSADESCRIPTORS_H
+#define LLVM_ANALYSIS_CSADESCRIPTORS_H
+
+namespace llvm {
+
+/// A Conditional Scalar Assignment (CSA) is an assignment from an initial
+/// scalar that may or may not occur.
+class CSADescriptor {
----------------
michaelmaitland wrote:

> Is there a reason to introduce a whole new class + analysis file instead of adding a new RecurKind in IVDescriptors?

I’ve gone ahead and put CSADescriptor inside the IVDescriptor file. But there isn't anything that CSADescriptor looks to reuse from RecurrenceDescriptor or InductionDescriptor, so I think it warrants a new class. CSADescriptor also adds  new functions and data members that aren't be relevant for other Recurrences or Inductions. I expect CSADescriptors class to diverge even further, as we extend CSA do support IR with control flow.

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


More information about the llvm-commits mailing list