LLVM 19.0.0git
NVPTX.h
Go to the documentation of this file.
1//===-- NVPTX.h - Top-level interface for NVPTX representation --*- 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// This file contains the entry points for global functions defined in
10// the LLVM NVPTX back-end.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_NVPTX_NVPTX_H
15#define LLVM_LIB_TARGET_NVPTX_NVPTX_H
16
17#include "llvm/IR/PassManager.h"
18#include "llvm/Pass.h"
20
21namespace llvm {
22class FunctionPass;
23class MachineFunctionPass;
24class NVPTXTargetMachine;
25class PassRegistry;
26
27namespace NVPTXCC {
34 GE
35};
36}
37
38FunctionPass *createNVPTXISelDag(NVPTXTargetMachine &TM,
39 llvm::CodeGenOptLevel OptLevel);
51 bool NoTrapAfterNoreturn);
54
55struct NVVMIntrRangePass : PassInfoMixin<NVVMIntrRangePass> {
57};
58
59struct NVVMReflectPass : PassInfoMixin<NVVMReflectPass> {
61 NVVMReflectPass(unsigned SmVersion) : SmVersion(SmVersion) {}
63
64private:
65 unsigned SmVersion;
66};
67
68struct GenericToNVVMPass : PassInfoMixin<GenericToNVVMPass> {
70};
71
72namespace NVPTX {
75 CUDA
76};
77
78// A field inside TSFlags needs a shift and a mask. The usage is
79// always as follows :
80// ((TSFlags & fieldMask) >> fieldShift)
81// The enum keeps the mask, the shift, and all valid values of the
82// field in one place.
86
87 VecNOP = 0,
95 VecOther = 15
96};
97
106 isStoreShift = 6
108
109namespace PTXLdStInstCode {
111 NotAtomic = 0, // PTX calls these: "Weak"
116 RelaxedMMIO = 5
123 PARAM = 4,
124 LOCAL = 5
130 Untyped
134 V2 = 2,
135 V4 = 4
137}
138
139/// PTXCvtMode - Conversion code enumeration
140namespace PTXCvtMode {
142 NONE = 0,
152
153 BASE_MASK = 0x0F,
154 FTZ_FLAG = 0x10,
155 SAT_FLAG = 0x20,
156 RELU_FLAG = 0x40
158}
159
160/// PTXCmpMode - Comparison mode enumeration
161namespace PTXCmpMode {
163 EQ = 0,
180 // NAN is a MACRO
182
183 BASE_MASK = 0xFF,
184 FTZ_FLAG = 0x100
186}
187
188namespace PTXPrmtMode {
197};
198}
199}
201} // namespace llvm
202
203// Defines symbolic names for NVPTX registers. This defines a mapping from
204// register name to register number.
205#define GET_REGINFO_ENUM
206#include "NVPTXGenRegisterInfo.inc"
207
208// Defines symbolic names for the NVPTX instructions.
209#define GET_INSTRINFO_ENUM
210#define GET_INSTRINFO_MC_HELPER_DECLS
211#include "NVPTXGenInstrInfo.inc"
212
213#endif
#define F(x, y, z)
Definition: MD5.cpp:55
unsigned SmVersion
Definition: NVVMReflect.cpp:81
const char LLVMTargetMachineRef TM
This header defines various interfaces for pass management in LLVM.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:253
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:311
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition: Pass.h:251
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
Definition: PassRegistry.h:37
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:111
VecInstType
Definition: NVPTX.h:83
@ VecOther
Definition: NVPTX.h:95
@ VecInstTypeShift
Definition: NVPTX.h:84
@ VecExtract
Definition: NVPTX.h:92
@ VecInsert
Definition: NVPTX.h:93
@ VecShuffle
Definition: NVPTX.h:91
@ VecBuild
Definition: NVPTX.h:90
@ VecInstTypeMask
Definition: NVPTX.h:85
@ VecLoad
Definition: NVPTX.h:88
@ VecDest
Definition: NVPTX.h:94
@ VecStore
Definition: NVPTX.h:89
@ VecNOP
Definition: NVPTX.h:87
DrvInterface
Definition: NVPTX.h:73
@ NVCL
Definition: NVPTX.h:74
@ CUDA
Definition: NVPTX.h:75
@ isStoreShift
Definition: NVPTX.h:106
@ isLoadShift
Definition: NVPTX.h:104
@ isLoadMask
Definition: NVPTX.h:103
@ isStoreMask
Definition: NVPTX.h:105
SimpleMove
Definition: NVPTX.h:98
@ SimpleMoveShift
Definition: NVPTX.h:100
@ SimpleMoveMask
Definition: NVPTX.h:99
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
ModulePass * createNVPTXAssignValidGlobalNamesPass()
MachineFunctionPass * createNVPTXReplaceImageHandlesPass()
FunctionPass * createNVPTXLowerUnreachablePass(bool TrapUnreachable, bool NoTrapAfterNoreturn)
ModulePass * createGenericToNVVMLegacyPass()
FunctionPass * createNVVMReflectPass(unsigned int SmVersion)
Definition: NVVMReflect.cpp:68
MachineFunctionPass * createNVPTXPrologEpilogPass()
MachineFunctionPass * createNVPTXProxyRegErasurePass()
MachineFunctionPass * createNVPTXPeephole()
FunctionPass * createNVPTXISelDag(NVPTXTargetMachine &TM, llvm::CodeGenOptLevel OptLevel)
createNVPTXISelDag - This pass converts a legalized DAG into a NVPTX-specific DAG,...
FunctionPass * createNVPTXLowerArgsPass()
FunctionPass * createNVPTXImageOptimizerPass()
FunctionPass * createNVPTXLowerAllocaPass()
CodeGenOptLevel
Code generation optimization level.
Definition: CodeGen.h:54
ModulePass * createNVPTXCtorDtorLoweringLegacyPass()
FunctionPass * createNVVMIntrRangePass()
void initializeNVPTXDAGToDAGISelLegacyPass(PassRegistry &)
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
NVVMReflectPass(unsigned SmVersion)
Definition: NVPTX.h:61
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:69