[PATCH] D79483: [RFC][CostModel] Remove getInstructionCost.

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 6 05:52:43 PDT 2020


samparker created this revision.
samparker added reviewers: RKSimon, craig.topper, spatel, lebedev.ri.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

In a continuing attempt to reduce the cost interface, this patch proposes removing getInstructionCost and folds the functionality into getUserCost - the one call to rule them all. I would have preferred to remove getUserCost but some backends have their own implementations, though I wonder how many non-instructions are passed to getUserCost which could allow just a renaming.

This patch builds from D79002 <https://reviews.llvm.org/D79002> and then applies, D78922 <https://reviews.llvm.org/D78922>, D79164 <https://reviews.llvm.org/D79164> and D78918 <https://reviews.llvm.org/D78918> and, while it's a hack which has basically broken all of the x86 intrinsic costs, there's (a only half a dozen small transform tests failures. Ideally getInstructionLatency would be folded in as well, but since the current implementation is a husk, I haven't bothered here.

Currently the implementation gets the cost and then makes another decision based upon the CostKind being queried. The next steps would ensure that each implementation of each get**Cost method would return a sane and expected result which would allow getUserCost to directly return that value.


https://reviews.llvm.org/D79483

Files:
  llvm/include/llvm/Analysis/TargetTransformInfo.h
  llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
  llvm/lib/Analysis/CostModel.cpp
  llvm/lib/Analysis/TargetTransformInfo.cpp
  llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
  llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
  llvm/lib/Transforms/IPO/HotColdSplitting.cpp
  llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79483.262346.patch
Type: text/x-patch
Size: 38116 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200506/1b12966d/attachment.bin>


More information about the llvm-commits mailing list