[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


================
@@ -668,6 +672,94 @@ Value *VPInstruction::generatePerPart(VPTransformState &State, unsigned Part) {
     }
     return NewPhi;
   }
+  case VPInstruction::CSAInitMask: {
+    if (Part == 0) {
+      Value *InitMask = ConstantAggregateZero::get(VectorType::get(
+          Type::getInt1Ty(State.Builder.getContext()), State.VF));
+      State.set(this, InitMask, Part);
+      return InitMask;
+    }
+    Value *V = State.get(this, Part - 1);
+    return V;
+  }
+  case VPInstruction::CSAInitData: {
+    if (Part == 0) {
+      Type *ElemTyp = getOperand(0)->getUnderlyingValue()->getType();
+      Value *InitData = PoisonValue::get(VectorType::get(ElemTyp, State.VF));
+      State.set(this, InitData, Part);
+      return InitData;
+    }
+    Value *V = State.get(this, Part - 1);
+    return V;
----------------
artagnon wrote:

`return State.get(this, Part - 1)`, and above/below?

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


More information about the llvm-commits mailing list