LLVM 23.0.0git
DirectXTargetTransformInfo.h
Go to the documentation of this file.
1//===- DirectXTargetTransformInfo.h - DirectX 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//===----------------------------------------------------------------------===//
10
11#ifndef LLVM_DIRECTX_DIRECTXTARGETTRANSFORMINFO_H
12#define LLVM_DIRECTX_DIRECTXTARGETTRANSFORMINFO_H
13
14#include "DirectXSubtarget.h"
17#include "llvm/IR/Function.h"
18
19namespace llvm {
20class DirectXTTIImpl final : public BasicTTIImplBase<DirectXTTIImpl> {
22 using TTI = TargetTransformInfo;
23
24 friend BaseT;
25
26 const DirectXSubtarget *ST;
27 const DirectXTargetLowering *TLI;
28
29 const DirectXSubtarget *getST() const { return ST; }
30 const DirectXTargetLowering *getTLI() const { return TLI; }
31
32public:
33 explicit DirectXTTIImpl(const DirectXTargetMachine *TM, const Function &F)
34 : BaseT(TM, F.getDataLayout()), ST(TM->getSubtargetImpl(F)),
35 TLI(ST->getTargetLowering()) {}
36 unsigned getMinVectorRegisterBitWidth() const override { return 32; }
39 unsigned ScalarOpdIdx) const override;
41 int OpdIdx) const override;
42
44 unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType,
46 TTI::PartialReductionExtendKind OpBExtend, std::optional<unsigned> BinOp,
48 std::optional<FastMathFlags> FMF) const override {
50 }
51};
52} // namespace llvm
53
54#endif // LLVM_DIRECTX_DIRECTXTARGETTRANSFORMINFO_H
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
BasicTTIImplBase(const TargetMachine *TM, const DataLayout &DL)
InstructionCost getPartialReductionCost(unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType, ElementCount VF, TTI::PartialReductionExtendKind OpAExtend, TTI::PartialReductionExtendKind OpBExtend, std::optional< unsigned > BinOp, TTI::TargetCostKind CostKind, std::optional< FastMathFlags > FMF) const override
bool isTargetIntrinsicWithScalarOpAtArg(Intrinsic::ID ID, unsigned ScalarOpdIdx) const override
DirectXTTIImpl(const DirectXTargetMachine *TM, const Function &F)
bool isTargetIntrinsicTriviallyScalarizable(Intrinsic::ID ID) const override
unsigned getMinVectorRegisterBitWidth() const override
bool isTargetIntrinsicWithOverloadTypeAtArg(Intrinsic::ID ID, int OpdIdx) const override
static InstructionCost getInvalid(CostType Val=0)
virtual const DataLayout & getDataLayout() const
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:46
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24
This is an optimization pass for GlobalISel generic memory operations.