[PATCH] D80012: [CostModel] Unify Intrinsic Costs.

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 15 08:06:28 PDT 2020


samparker created this revision.
samparker added reviewers: SjoerdMeijer, RKSimon, dmgreen, dfukalov, rampitec.
Herald added subscribers: kerbowa, hiraditya, tpr, nhaehnle, jvesely, arsenm.
Herald added a project: LLVM.
samparker added a parent revision: D79941: [NFCI][CostModel] Refactor getIntrinsicInstrCost.

With the two getIntrinsicInstrCosts folded into one, now fold in the scalar/code-size orientated getIntrinsicCost. This involved sinking cost of the TTIImpl into the base implementation, as it performs no target checks. The opcodes remaining were memcpy, cttz and ctlz which now have special handling in the BasicTTI implementation. getInstructionThroughput can now directly return the result of getUserCost.
This has required a change in the AMDGPU backend for fabs and it as the tests suggest that they should always be 'free'. I've also changed the X86 backend to return '1' for any intrinsic when the CostKind isn't RecipThroughput.


https://reviews.llvm.org/D80012

Files:
  llvm/include/llvm/Analysis/TargetTransformInfo.h
  llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
  llvm/include/llvm/CodeGen/BasicTTIImpl.h
  llvm/lib/Analysis/TargetTransformInfo.cpp
  llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
  llvm/lib/Target/X86/X86TargetTransformInfo.cpp
  llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80012.264245.patch
Type: text/x-patch
Size: 19944 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200515/efcdd44c/attachment-0001.bin>


More information about the llvm-commits mailing list