[llvm] [VPlan] Materialize constant vector trip counts before final opts. (PR #142309)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 6 03:59:48 PDT 2025


================
@@ -3120,6 +3115,29 @@ void VPlanTransforms::materializeBroadcasts(VPlan &Plan) {
   }
 }
 
+void VPlanTransforms::materializeVectorTripCount(
+    VPlan &Plan, ElementCount BestVF, unsigned BestUF,
+    PredicatedScalarEvolution &PSE) {
+  assert(Plan.hasVF(BestVF) && "BestVF is not available in Plan");
+  assert(Plan.hasUF(BestUF) && "BestUF is not available in Plan");
+
+  VPValue *TC = Plan.getTripCount();
+  // Skip cases for which the trip count may be non-trivial to materialize.
----------------
fhahn wrote:

Clarifed, in 777c320e6c96e2de9d4c6dc52d6a85a5ef3b8569, thanks!

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


More information about the llvm-commits mailing list