[PATCH] D92238: [SCEVExpander] Migrate costAndCollectOperands to use InstructionCost.

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 26 09:50:20 PST 2021


ctetreau added a comment.

Aside from the change to the assert, this version looks good to me.



================
Comment at: llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h:239-249
+    InstructionCost Cost = 0;
     Worklist.emplace_back(-1, -1, Expr);
     while (!Worklist.empty()) {
       const SCEVOperand WorkItem = Worklist.pop_back_val();
-      if (isHighCostExpansionHelper(WorkItem, L, *At, BudgetRemaining,
+      if (isHighCostExpansionHelper(WorkItem, L, *At, Cost,
+                                    Budget * TargetTransformInfo::TCC_Basic,
                                     *TTI, Processed, Worklist))
----------------
If the scale factor to the budget changes, then this assert will be wrong. If TCC_Basic is not 1, then the assert is already wrong.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92238/new/

https://reviews.llvm.org/D92238



More information about the llvm-commits mailing list