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

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 25 13:50:11 PST 2021


lebedev.ri added a comment.

In D92238#2521055 <https://reviews.llvm.org/D92238#2521055>, @sdesmalen wrote:

> An attempt to meet in the middle:
>
> - No need for `InstructionBudget` class.
> - No need for any changes to `return BudgetRemaining < 0` in `isHighCostExpansionHelper`.
>
> Instead, the check for `BudgetRemaining.isValid()` is now done at the end in `isHighCostExpansion`. If the helper function found the budget has exceeded, or if the resulting budget has been invalidated, the expansion is considered high cost.
>
> Is this a step in the right direction?

Won't we now not stop as soon as the budget is invalidated?
Perhaps if `InstructionCost::operator<` can't be fixed, it needs to be ripped out.
I'm sorry, i don't have useful feedback other than "the new abstraction is bad".


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

https://reviews.llvm.org/D92238



More information about the llvm-commits mailing list