[llvm-branch-commits] [llvm] [LV][REVEC][AArch64] Proof of concept for re-vectorisation (PR #208213)

Gaƫtan Bossu via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jul 30 07:09:00 PDT 2026


================
@@ -299,11 +299,31 @@ Value *VPTransformState::get(const VPValue *Def, const VPLane &Lane) {
 
   assert(hasVectorValue(Def));
   auto *VecPart = Data.VPV2Vector[Def];
-  if (!VecPart->getType()->isVectorTy()) {
+  // If VecPart's type is the same as the initial pre-vectorisation type,
+  // Def hasn't been vectorised. We are done.
+  Type *InitialTy = Def->getScalarType();
+  if (VecPart->getType() == InitialTy) {
     assert(Lane.isFirstLane() && "cannot get lane > 0 for scalar");
     return VecPart;
   }
+
+  // Last case: Extract a lane of type InitialTy from a vectorised value.
   // TODO: Cache created scalar values.
+  if (auto *InitVTy = dyn_cast<VectorType>(InitialTy)) {
----------------
gbossu wrote:

I'm open to suggestions on how to model this better. The way I view it, we are still extracting a lane. The difference is that the lane is vector (segment), not a scalar. Hence using `CreateExtractVector` instead of `CreateExtractElement`.

Note that this change might not be needed in this first PR. IIRC this is relevant for first order recurrences, and they aren't supported by this PoC.

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


More information about the llvm-branch-commits mailing list