LLVM 23.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;
26
27class R600TTIImpl final : public BasicTTIImplBase<R600TTIImpl> {
29 using TTI = TargetTransformInfo;
30
31 friend BaseT;
32
33 const R600Subtarget *ST;
34 const TargetLowering *TLI;
35 AMDGPUTTIImpl CommonTTI;
36
37public:
38 explicit R600TTIImpl(const AMDGPUTargetMachine *TM, const Function &F);
39
40 const R600Subtarget *getST() const { return ST; }
41 const TargetLowering *getTLI() const { return TLI; }
42
45 OptimizationRemarkEmitter *ORE) const override;
47 TTI::PeelingPreferences &PP) const override;
48 unsigned getHardwareNumberOfRegisters(bool Vec) const;
49 unsigned getNumberOfRegisters(unsigned ClassID) const override;
52 unsigned getMinVectorRegisterBitWidth() const override;
53 unsigned getLoadStoreVecRegBitWidth(unsigned AddrSpace) const override;
54 bool isLegalToVectorizeMemChain(unsigned ChainSizeInBytes, Align Alignment,
55 unsigned AddrSpace) const;
56 bool isLegalToVectorizeLoadChain(unsigned ChainSizeInBytes, Align Alignment,
57 unsigned AddrSpace) const override;
58 bool isLegalToVectorizeStoreChain(unsigned ChainSizeInBytes, Align Alignment,
59 unsigned AddrSpace) const override;
60 unsigned getMaxInterleaveFactor(ElementCount VF) const override;
62 const Instruction *I = nullptr) const override;
65 getVectorInstrCost(unsigned Opcode, Type *ValTy, TTI::TargetCostKind CostKind,
66 unsigned Index, const Value *Op0, const Value *Op1,
68 TTI::VectorInstrContext::None) 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:54
#define I(x, y, z)
Definition MD5.cpp:57
InstructionCost getVectorInstrCost(unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index, const Value *Op0, const Value *Op1, TTI::VectorInstrContext VIC=TTI::VectorInstrContext::None) 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.
bool isLegalToVectorizeMemChain(unsigned ChainSizeInBytes, Align Alignment, unsigned AddrSpace) const
InstructionCost getVectorInstrCost(unsigned Opcode, Type *ValTy, TTI::TargetCostKind CostKind, unsigned Index, const Value *Op0, const Value *Op1, TTI::VectorInstrContext VIC=TTI::VectorInstrContext::None) const override
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
unsigned getMaxInterleaveFactor(ElementCount VF) const override
unsigned getLoadStoreVecRegBitWidth(unsigned AddrSpace) const override
R600TTIImpl(const AMDGPUTargetMachine *TM, const Function &F)
unsigned getHardwareNumberOfRegisters(bool Vec) const
const TargetLowering * getTLI() 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 class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
VectorInstrContext
Represents a hint about the context in which an insert/extract is used.
@ None
The insert/extract is not used with a load/store.
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:46
LLVM Value Representation.
Definition Value.h:75
This is an optimization pass for GlobalISel generic memory operations.
Definition Types.h:26
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.