[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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92237

Files:
  llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
  llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92237.308084.patch
Type: text/x-patch
Size: 5122 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201127/8390fb06/attachment.bin>


More information about the llvm-commits mailing list