[llvm] [LV] Optimize VPWidenIntOrFpInductionRecipe for known TC (PR #118828)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 02:43:12 PST 2024


================
@@ -661,6 +661,60 @@ static void recursivelyDeleteDeadRecipes(VPValue *V) {
   }
 }
 
+void VPlanTransforms::optimizeForTCAndVF(VPlan &Plan, unsigned TC,
+                                         ElementCount BestVF) {
+  assert(Plan.hasVF(BestVF) && "BestVF is not available in Plan");
+  if (!TC || !BestVF.isFixed())
+    return;
+
+  // Calculate the widest type required for known TC and VF.
+  uint64_t Width = BestVF.getKnownMinValue();
----------------
david-arm wrote:

I think you also need to multiply by the interleave count here as well.

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


More information about the llvm-commits mailing list