[all-commits] [llvm/llvm-project] de71de: [CostModel] Unify Intrinsic Costs.

Sam Parker via All-commits all-commits at lists.llvm.org
Wed May 20 23:39:12 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: de71def3f59dc9f12f67141b5040d8e15c84d08a
      https://github.com/llvm/llvm-project/commit/de71def3f59dc9f12f67141b5040d8e15c84d08a
  Author: Sam Parker <sam.parker at arm.com>
  Date:   2020-05-21 (Thu, 21 May 2020)

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

  Log Message:
  -----------
  [CostModel] Unify Intrinsic Costs.

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 had required a change in the AMDGPU backend for fabs and its
always 'free'. I've also changed the X86 backend to return '1' for
any intrinsic when the CostKind isn't RecipThroughput.

Though this intended to be a non-functional change, there are many
paths being combined here so I would be very surprised if this didn't
have an effect.

Differential Revision: https://reviews.llvm.org/D80012




More information about the All-commits mailing list