[PATCH] D92237: [SCEVExpander] NFCI: Change Cost type in costAndCollectOperands from int -> unsigned.
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 27 10:06:46 PST 2020
sdesmalen created this revision.
sdesmalen added reviewers: reames, RKSimon, fhahn, lebedev.ri, CarolineConcatto.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
sdesmalen requested review of this revision.
This patch intends to be a non-functional change. It changes the
type of BudgetRemaining and Cost in costAndCollectOperands from 'int' to
'unsigned' so that the algorithm checks beforehand whether the resulting
budget is going to be exceeded or invalidated, rather than relying on
BudgetRemaining to end up < 0.
This refactoring is a preparation for InstructionCost added in D91174 <https://reviews.llvm.org/D91174>, which
has an Invalid state. By checking the 'invalidated' case early, InstructionCost
can be a drop-in replacement for unsigned when D91174 <https://reviews.llvm.org/D91174> lands.
rG LLVM Github Monorepo
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5122 bytes
Desc: not available
More information about the llvm-commits