[llvm] [polly] [llvm][ConstraintElimination]Insert ConditionFact into loop header in case of monotonic induction variables (PR #112080)

Grigory Pastukhov via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 4 10:18:03 PST 2024


================
@@ -1680,7 +1761,9 @@ static bool eliminateConstraints(Function &F, DominatorTree &DT, LoopInfo &LI,
   for (Value &Arg : F.args())
     FunctionArgs.push_back(&Arg);
   ConstraintInfo Info(F.getDataLayout(), FunctionArgs);
-  State S(DT, LI, SE);
+  unsigned int NumCondBranches = getNumConditionalBranches(F);
+  State S(DT, LI, SE,
+          /* AddInductionInfoIntoHeader= */ NumCondBranches < MaxRows / 5);
----------------
grigorypas wrote:

The reason I added this condition is to avoid regression in some edge cases (see analysis by @dtcxzyw). If we add extra constrains in loop headers and reach MaxRows limit, some constraints are dropped that are not otherwise. I am happy to remove it if we are OK with those regressions.

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


More information about the llvm-commits mailing list