LLVM 24.0.0git
NVPTXMachineFunctionInfo.h
Go to the documentation of this file.
1//===-- NVPTXMachineFunctionInfo.h - NVPTX-specific Function Info --------===//
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// This class is attached to a MachineFunction instance and tracks target-
10// dependent information
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXMACHINEFUNCTIONINFO_H
15#define LLVM_LIB_TARGET_NVPTX_NVPTXMACHINEFUNCTIONINFO_H
16
19#include <map>
20
21namespace llvm {
22class CallBase;
23class MCSymbol;
24
26private:
27 /// The parameter symbols whose image handles were replaced with image
28 /// references.
29 SmallPtrSet<const MCSymbol *, 8> ImageHandleSymbols;
30
31 /// Stores a mapping from a unique call-site id to the call instruction that
32 /// needs an indirect-call prototype emitted.
33 std::map<unsigned, const CallBase *> CallPrototypes;
34
35public:
37
41 const override {
42 return DestMF.cloneInfo<NVPTXMachineFunctionInfo>(*this);
43 }
44
45 /// Record that \p Symbol's handle was replaced with an image reference.
46 void addImageHandleSymbol(const MCSymbol *Symbol) {
47 ImageHandleSymbols.insert(Symbol);
48 }
49
50 /// Check whether \p Symbol's handle was replaced with an image reference.
51 bool checkImageHandleSymbol(const MCSymbol *Symbol) const {
52 return ImageHandleSymbols.contains(Symbol);
53 }
54
55 void addCallPrototype(unsigned Id, const CallBase *CB) {
56 CallPrototypes.try_emplace(Id, CB);
57 }
58
59 const std::map<unsigned, const CallBase *> &getCallPrototypes() const {
60 return CallPrototypes;
61 }
62};
63}
64
65#endif
#define F(x, y, z)
Definition MD5.cpp:54
Basic Register Allocator
This file defines the SmallPtrSet class.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition MCSymbol.h:42
Ty * cloneInfo(const Ty &Old)
void addImageHandleSymbol(const MCSymbol *Symbol)
Record that Symbol's handle was replaced with an image reference.
NVPTXMachineFunctionInfo(const Function &F, const TargetSubtargetInfo *STI)
const std::map< unsigned, const CallBase * > & getCallPrototypes() const
void addCallPrototype(unsigned Id, const CallBase *CB)
bool checkImageHandleSymbol(const MCSymbol *Symbol) const
Check whether Symbol's handle was replaced with an image reference.
MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
TargetSubtargetInfo - Generic base class for all target subtargets.
This is an optimization pass for GlobalISel generic memory operations.
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Definition Allocator.h:390
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...