[llvm] [VPlan] Simplify live-ins early using SCEV. (PR #155304)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 12 05:39:33 PDT 2025


================
@@ -531,12 +532,29 @@ static void addInitialSkeleton(VPlan &Plan, Type *InductionTy, DebugLoc IVDL,
   createExtractsForLiveOuts(Plan, MiddleVPBB);
 }
 
+/// Check \p Plan's live-in and replace them with constants, if they can be
+/// simplified via SCEV.
+static void simplifyLiveInsWithSCEV(VPlan &Plan, ScalarEvolution &SE) {
+  auto GetSimplifiedLiveInViaSCEV = [&](VPValue *VPV) -> VPValue * {
+    const SCEV *Expr = vputils::getSCEVExprForVPValue(VPV, SE);
----------------
fhahn wrote:

This patch adds such a check, w/o this patch it is only ever used for VPValues that should be SCEV-able (mostly trip count expressions I think)

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


More information about the llvm-commits mailing list