[PATCH] D68881: [AMDGPU] Improve code size cost model

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 13:10:02 PDT 2019


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp:698
+                                 ArrayRef<const Value *> Operands) {
+  // Estimate extractelement elimination
+  if (const ExtractElementInst *EE = dyn_cast<ExtractElementInst>(U)) {
----------------
dfukalov wrote:
> arsenm wrote:
> > We already report vector insert/extract as free. Why does this need to look at these specifically? What is the purpose of Operands which seems to be ignored?
> > 
> > What uses this version? I thought the set of cost model function with specific value contexts were only used by the vectorizers
> CostModel has three estimation modes: RecipThroughput, Latency and CodeSize. Vectorizer uses the first one but inliner and unroller use code size estimations.
> Insert/extract and other estimations were implemented for RecipThroughput path only so e.g. inliner got wrong code size costs estimations for such instructions. The change introduces the same estimations for some trivial cases by overloading getUserCost().
Nothing here looks target specific though? It's just forwarding the calls. Why doesn't the base implementation do this?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68881





More information about the llvm-commits mailing list