[llvm] [LV] Move check if any vector insts will be generated to VPlan. (PR #96622)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 7 05:14:44 PDT 2024


================
@@ -4795,9 +4783,101 @@ static void emitInvalidCostRemarks(SmallVector<InstructionVFPair> InvalidCosts,
   } while (!Tail.empty());
 }
 
+/// Check if any recipe of \p Plan will generate a vector value, which will be
+/// assigned a vector register.
+static bool willGenerateVectors(VPlan &Plan, ElementCount VF,
+                                const TargetTransformInfo &TTI) {
+  assert(VF.isVector() && "Checking a scalar VF?");
+  VPTypeAnalysis TypeInfo(Plan.getCanonicalIV()->getScalarType(),
+                          Plan.getCanonicalIV()->getScalarType()->getContext());
+  // Set of types known to not generate vector values.
+  DenseSet<Type *> WillNotWiden;
----------------
ayalz wrote:

```suggestion
  // Set of types already visited.
  DenseSet<Type *> Visited;
```

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


More information about the llvm-commits mailing list