LLVM 22.0.0git
R600TargetTransformInfo.h
Go to the documentation of this file.
1//===- R600TargetTransformInfo.h - R600 specific TTI --------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9/// \file
10/// This file a TargetTransformInfoImplBase conforming object specific to the
11/// R600 target machine. It uses the target's detailed information to
12/// provide more precise answers to certain TTI queries, while letting the
13/// target independent and default TTI implementations handle the rest.
14//
15//===----------------------------------------------------------------------===//
16
17#ifndef LLVM_LIB_TARGET_AMDGPU_R600TARGETTRANSFORMINFO_H
18#define LLVM_LIB_TARGET_AMDGPU_R600TARGETTRANSFORMINFO_H
19
22
23namespace llvm {
24
25class R600Subtarget;
27
28class R600TTIImpl final : public BasicTTIImplBase<R600TTIImpl> {
30 using TTI = TargetTransformInfo;
31
32 friend BaseT;
33
34 const R600Subtarget *ST;
35 const AMDGPUTargetLowering *TLI;
36 AMDGPUTTIImpl CommonTTI;
37
38public:
39 explicit R600TTIImpl(const AMDGPUTargetMachine *TM, const Function &F);
40
41 const R600Subtarget *getST() const { return ST; }
42 const AMDGPUTargetLowering *getTLI() const { return TLI; }
43
46 OptimizationRemarkEmitter *ORE) const override;
48 TTI::PeelingPreferences &PP) const override;
49 unsigned getHardwareNumberOfRegisters(bool Vec) const;
50 unsigned getNumberOfRegisters(unsigned ClassID) const override;
53 unsigned getMinVectorRegisterBitWidth() const override;
54 unsigned getLoadStoreVecRegBitWidth(unsigned AddrSpace) const override;
55 bool isLegalToVectorizeMemChain(unsigned ChainSizeInBytes, Align Alignment,
56 unsigned AddrSpace) const;
57 bool isLegalToVectorizeLoadChain(unsigned ChainSizeInBytes, Align Alignment,
58 unsigned AddrSpace) const override;
59 bool isLegalToVectorizeStoreChain(unsigned ChainSizeInBytes, Align Alignment,
60 unsigned AddrSpace) const override;
61 unsigned getMaxInterleaveFactor(ElementCount VF) const override;
63 const Instruction *I = nullptr) const override;
65 InstructionCost getVectorInstrCost(unsigned Opcode, Type *ValTy,
67 unsigned Index, const Value *Op0,
68 const Value *Op1) const override;
69};
70
71} // end namespace llvm
72
73#endif // LLVM_LIB_TARGET_AMDGPU_R600TARGETTRANSFORMINFO_H
This file a TargetTransformInfoImplBase conforming object specific to the AMDGPU target machine.
This file provides a helper that implements much of the TTI interface in terms of the target-independ...
static cl::opt< OutputCostKind > CostKind("cost-kind", cl::desc("Target cost kind"), cl::init(OutputCostKind::RecipThroughput), cl::values(clEnumValN(OutputCostKind::RecipThroughput, "throughput", "Reciprocal throughput"), clEnumValN(OutputCostKind::Latency, "latency", "Instruction latency"), clEnumValN(OutputCostKind::CodeSize, "code-size", "Code size"), clEnumValN(OutputCostKind::SizeAndLatency, "size-latency", "Code size and latency"), clEnumValN(OutputCostKind::All, "all", "Print all cost kinds")))
#define F(x, y, z)
Definition MD5.cpp:55
#define I(x, y, z)
Definition MD5.cpp:58
InstructionCost getVectorInstrCost(unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index, const Value *Op0, const Value *Op1) const override
BasicTTIImplBase(const TargetMachine *TM, const DataLayout &DL)
Represents a single loop in the control flow graph.
Definition LoopInfo.h:40
The optimization diagnostic interface.
InstructionCost getVectorInstrCost(unsigned Opcode, Type *ValTy, TTI::TargetCostKind CostKind, unsigned Index, const Value *Op0, const Value *Op1) const override
bool isLegalToVectorizeMemChain(unsigned ChainSizeInBytes, Align Alignment, unsigned AddrSpace) const
void getUnrollingPreferences(Loop *L, ScalarEvolution &SE, TTI::UnrollingPreferences &UP, OptimizationRemarkEmitter *ORE) const override
bool isLegalToVectorizeStoreChain(unsigned ChainSizeInBytes, Align Alignment, unsigned AddrSpace) const override
unsigned getMinVectorRegisterBitWidth() const override
const R600Subtarget * getST() const
const AMDGPUTargetLowering * getTLI() const
unsigned getMaxInterleaveFactor(ElementCount VF) const override
unsigned getLoadStoreVecRegBitWidth(unsigned AddrSpace) const override
R600TTIImpl(const AMDGPUTargetMachine *TM, const Function &F)
unsigned getHardwareNumberOfRegisters(bool Vec) const
InstructionCost getCFInstrCost(unsigned Opcode, TTI::TargetCostKind CostKind, const Instruction *I=nullptr) const override
bool isLegalToVectorizeLoadChain(unsigned ChainSizeInBytes, Align Alignment, unsigned AddrSpace) const override
void getPeelingPreferences(Loop *L, ScalarEvolution &SE, TTI::PeelingPreferences &PP) const override
TypeSize getRegisterBitWidth(TargetTransformInfo::RegisterKind Vector) const override
unsigned getNumberOfRegisters(unsigned ClassID) const override
The main scalar evolution driver.
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
TargetCostKind
The kind of cost model.
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:45
LLVM Value Representation.
Definition Value.h:75
This is an optimization pass for GlobalISel generic memory operations.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39
Parameters that control the generic loop unrolling transformation.