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

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 4 11:37:43 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);
----------------
MatzeB wrote:

It just feels like a lot of trouble (or rather a lot of memory read) to go through the whole function just to count the number of conditional branches... So I am wondering if there is ways to limit this without having an extra pass over the whole function...

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


More information about the llvm-commits mailing list