LLVM  15.0.0git
SPIRVTargetTransformInfo.h
Go to the documentation of this file.
1 //===- SPIRVTargetTransformInfo.h - SPIR-V 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 // \file
9 // This file contains a TargetTransformInfo::Concept conforming object specific
10 // to the SPIRV target machine. It uses the target's detailed information to
11 // provide more precise answers to certain TTI queries, while letting the
12 // target independent and default TTI implementations handle the rest.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_LIB_TARGET_SPIRV_SPIRVTARGETTRANSFORMINFO_H
17 #define LLVM_LIB_TARGET_SPIRV_SPIRVTARGETTRANSFORMINFO_H
18 
19 #include "SPIRV.h"
20 #include "SPIRVTargetMachine.h"
23 
24 namespace llvm {
25 class SPIRVTTIImpl : public BasicTTIImplBase<SPIRVTTIImpl> {
27 
28  friend BaseT;
29 
30  const SPIRVSubtarget *ST;
31  const SPIRVTargetLowering *TLI;
32 
33  const TargetSubtargetInfo *getST() const { return ST; }
34  const SPIRVTargetLowering *getTLI() const { return TLI; }
35 
36 public:
37  explicit SPIRVTTIImpl(const SPIRVTargetMachine *TM, const Function &F)
38  : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)),
39  TLI(ST->getTargetLowering()) {}
40 };
41 
42 } // namespace llvm
43 
44 #endif // LLVM_LIB_TARGET_SPIRV_SPIRVTARGETTRANSFORMINFO_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::Function
Definition: Function.h:60
llvm::SPIRVSubtarget
Definition: SPIRVSubtarget.h:36
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::TargetTransformInfoImplBase::getDataLayout
const DataLayout & getDataLayout() const
Definition: TargetTransformInfoImpl.h:46
SPIRVTargetMachine.h
llvm::SPIRVTTIImpl::SPIRVTTIImpl
SPIRVTTIImpl(const SPIRVTargetMachine *TM, const Function &F)
Definition: SPIRVTargetTransformInfo.h:37
llvm::BasicTTIImplBase
Base class which can be used to help build a TTI implementation.
Definition: BasicTTIImpl.h:77
SPIRV.h
llvm::SPIRVTargetLowering
Definition: SPIRVISelLowering.h:22
getParent
static const Function * getParent(const Value *V)
Definition: BasicAliasAnalysis.cpp:845
llvm::SPIRVTTIImpl
Definition: SPIRVTargetTransformInfo.h:25
llvm::TargetSubtargetInfo
TargetSubtargetInfo - Generic base class for all target subtargets.
Definition: TargetSubtargetInfo.h:60
llvm::SPIRVTargetMachine
Definition: SPIRVTargetMachine.h:20
TargetTransformInfo.h
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
BasicTTIImpl.h