[PATCH] D91174: [Analysis] Introduce a new InstructionCost class

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 04:28:28 PST 2020


david-arm updated this revision to Diff 305097.
david-arm added a comment.

- Changed comparison operators to explicitly treat invalid as infinitely expensive and return the appropriate result.
- Added setValid() function.
- Changed enum states to Valid and Invalid.
- Removed template from the InstructionCost class and defaulted to 'int'. I think 32 bits is enough for costs, since everywhere in the codebase uses int or unsigned. However, the cost type can be easily changed since I made it a typedef. Not having the template meant I could also simplify the list of operators.
- Changed lib/Transforms/Scalar/CallSiteSplitting.cpp so that we no longer explicitly check isInvalid() before comparing with DuplicationThreshold. This is because the ">=" operator now takes the invalid state into account.


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

https://reviews.llvm.org/D91174

Files:
  llvm/include/llvm/Analysis/InstructionCost.h
  llvm/include/llvm/Analysis/TargetTransformInfo.h
  llvm/include/llvm/IR/DiagnosticInfo.h
  llvm/lib/Analysis/CostModel.cpp
  llvm/lib/Analysis/TargetTransformInfo.cpp
  llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
  llvm/lib/IR/DiagnosticInfo.cpp
  llvm/lib/Transforms/IPO/HotColdSplitting.cpp
  llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/unittests/Analysis/CMakeLists.txt
  llvm/unittests/Analysis/InstructionCostTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91174.305097.patch
Type: text/x-patch
Size: 18042 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201113/582de15f/attachment.bin>


More information about the llvm-commits mailing list