LLVM 24.0.0git
AMDGPUTargetTransformInfo.cpp File Reference
#include "AMDGPUTargetTransformInfo.h"
#include "AMDGPUSubtarget.h"
#include "AMDGPUTargetMachine.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
#include "SIModeRegisterDefaults.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/Analysis/InlineCost.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/Analysis.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicsAMDGPU.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/KnownBits.h"
#include <optional>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "AMDGPUtti"

Functions

static bool dependsOnLocalPhi (const Loop *L, const Value *Cond, unsigned Depth=0)
static bool canFuseFMulWithFAddSub (const SITargetLowering &TLI, Type *Ty, const Instruction *FMul, const Instruction *FAddSub)
static const Instruction * getFusedFMul (const SITargetLowering &TLI, Type *Ty, const Instruction *FAddSub)
 An fma holds one multiply, so only one fmul operand fuses with FAddSub.
static bool isFusedFMul (const SITargetLowering &TLI, Type *Ty, const Instruction *FMul, const Instruction *FAddSub)
static bool intrinsicHasPackedVectorBenefit (Intrinsic::ID ID)
static std::optional< unsigned > getNumberOfPackedMaskElts (Type *Ty)
static unsigned adjustInliningThresholdUsingCallee (const CallBase *CB, const SITargetLowering *TLI, const GCNTTIImpl *TTIImpl)
static TypeSize getCallArgsTotalAllocaSize (const CallBase *CB, const DataLayout &DL)
static unsigned getNumMemoryInsts (unsigned Bytes, unsigned MaxBytes, bool HasDwordx3)
static bool hasUniformPointerOperand (const Instruction *I)
static std::pair< bool, bool > getKnownBufferOobProperties (const GCNSubtarget &ST, const DataLayout &DL, const Instruction *I, unsigned Bytes)

Variables

static constexpr unsigned MaskPackCostPerElt = 4
static constexpr unsigned MaskUnpackCostPerElt = 3

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "AMDGPUtti"

Definition at line 36 of file AMDGPUTargetTransformInfo.cpp.

Function Documentation

◆ adjustInliningThresholdUsingCallee()

◆ canFuseFMulWithFAddSub()

bool canFuseFMulWithFAddSub ( const SITargetLowering & TLI,
Type * Ty,
const Instruction * FMul,
const Instruction * FAddSub )
static
Returns
true if FMul and its single fadd/fsub user FAddSub are expected to fuse during instruction selection. Ty is the type the fused operation runs on.

Definition at line 480 of file AMDGPUTargetTransformInfo.cpp.

References assert(), F, llvm::FMul, llvm::Instruction::getFunction(), llvm::Instruction::getOpcode(), llvm::Instruction::hasAllowContract(), and TLI.

Referenced by getFusedFMul(), and isFusedFMul().

◆ dependsOnLocalPhi()

bool dependsOnLocalPhi ( const Loop * L,
const Value * Cond,
unsigned Depth = 0 )
static

◆ getCallArgsTotalAllocaSize()

◆ getFusedFMul()

const Instruction * getFusedFMul ( const SITargetLowering & TLI,
Type * Ty,
const Instruction * FAddSub )
static

An fma holds one multiply, so only one fmul operand fuses with FAddSub.

Definition at line 500 of file AMDGPUTargetTransformInfo.cpp.

References canFuseFMulWithFAddSub(), llvm::dyn_cast(), llvm::FMul, llvm::User::operands(), and TLI.

Referenced by isFusedFMul(), and llvm::GCNTTIImpl::isProfitableToSinkOperands().

◆ getKnownBufferOobProperties()

◆ getNumberOfPackedMaskElts()

std::optional< unsigned > getNumberOfPackedMaskElts ( Type * Ty)
static

◆ getNumMemoryInsts()

unsigned getNumMemoryInsts ( unsigned Bytes,
unsigned MaxBytes,
bool HasDwordx3 )
static

Definition at line 2154 of file AMDGPUTargetTransformInfo.cpp.

References llvm::popcount().

Referenced by llvm::GCNTTIImpl::getMemoryOpCost().

◆ hasUniformPointerOperand()

◆ intrinsicHasPackedVectorBenefit()

bool intrinsicHasPackedVectorBenefit ( Intrinsic::ID ID)
static

◆ isFusedFMul()

Variable Documentation

◆ MaskPackCostPerElt

unsigned MaskPackCostPerElt = 4
staticconstexpr

◆ MaskUnpackCostPerElt

unsigned MaskUnpackCostPerElt = 3
staticconstexpr

Definition at line 994 of file AMDGPUTargetTransformInfo.cpp.

Referenced by llvm::GCNTTIImpl::getCastInstrCost().