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

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 18 08:09:11 PST 2021


sdesmalen marked an inline comment as done.
sdesmalen added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:2348-2349
     SmallVectorImpl<SCEVOperand> &Worklist) {
-  if (BudgetRemaining < 0)
+  if (!BudgetRemaining.isValid() || BudgetRemaining < 0)
     return true; // Already run out of budget, give up.
 
----------------
lebedev.ri wrote:
> What happens without the `isValid()` check?
Without the `isValid()` check it defaults to the total ordering for InstructionCost where all valid costs < Invalid.
This means that `BudgetRemaining < 0` would evaluate to `false`, where instead we want to return `true` from this function to signal this is a high cost expansion.


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

https://reviews.llvm.org/D92238



More information about the llvm-commits mailing list