Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
Show All 9 Lines | |||||
// This file implements a TargetTransformInfo analysis pass specific to the | // This file implements a TargetTransformInfo analysis pass specific to the | ||||
// AMDGPU target machine. It uses the target's detailed information to provide | // AMDGPU target machine. It uses the target's detailed information to provide | ||||
// more precise answers to certain TTI queries, while letting the target | // more precise answers to certain TTI queries, while letting the target | ||||
// independent and default TTI implementations handle the rest. | // independent and default TTI implementations handle the rest. | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
#include "AMDGPUTargetTransformInfo.h" | #include "AMDGPUTargetTransformInfo.h" | ||||
#include "AMDGPU.h" | |||||
#include "AMDGPUTargetMachine.h" | #include "AMDGPUTargetMachine.h" | ||||
#include "MCTargetDesc/AMDGPUMCTargetDesc.h" | #include "MCTargetDesc/AMDGPUMCTargetDesc.h" | ||||
#include "llvm/Analysis/LoopInfo.h" | #include "llvm/Analysis/LoopInfo.h" | ||||
#include "llvm/Analysis/ValueTracking.h" | #include "llvm/Analysis/ValueTracking.h" | ||||
#include "llvm/IR/IRBuilder.h" | #include "llvm/IR/IRBuilder.h" | ||||
#include "llvm/IR/IntrinsicsAMDGPU.h" | #include "llvm/IR/IntrinsicsAMDGPU.h" | ||||
#include "llvm/IR/PatternMatch.h" | #include "llvm/IR/PatternMatch.h" | ||||
#include "llvm/Support/KnownBits.h" | #include "llvm/Support/KnownBits.h" | ||||
▲ Show 20 Lines • Show All 1,211 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
int GCNTTIImpl::get64BitInstrCost(TTI::TargetCostKind CostKind) const { | int GCNTTIImpl::get64BitInstrCost(TTI::TargetCostKind CostKind) const { | ||||
return ST->hasFullRate64Ops() | return ST->hasFullRate64Ops() | ||||
? getFullRateInstrCost() | ? getFullRateInstrCost() | ||||
: ST->hasHalfRate64Ops() ? getHalfRateInstrCost(CostKind) | : ST->hasHalfRate64Ops() ? getHalfRateInstrCost(CostKind) | ||||
: getQuarterRateInstrCost(CostKind); | : getQuarterRateInstrCost(CostKind); | ||||
} | } | ||||
unsigned GCNTTIImpl::getFlatAddressSpace() const { | |||||
// Don't bother running InferAddressSpaces pass on graphics shaders which | |||||
// don't use flat addressing. | |||||
if (IsGraphics) | |||||
return -1; | |||||
return AMDGPUAS::FLAT_ADDRESS; | |||||
} |