LLVM  9.0.0svn
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 
18 #include "llvm/ADT/StringMap.h"
19 #include "llvm/IR/Module.h"
20 #include "llvm/IR/Value.h"
23 #include <cassert>
24 #include <iosfwd>
25 
26 namespace llvm {
27 class NVPTXTargetMachine;
28 class FunctionPass;
29 class MachineFunctionPass;
30 class formatted_raw_ostream;
31 
32 namespace NVPTXCC {
33 enum CondCodes {
34  EQ,
35  NE,
36  LT,
37  LE,
38  GT,
40 };
41 }
42 
44  llvm::CodeGenOpt::Level OptLevel);
47 FunctionPass *createNVVMIntrRangePass(unsigned int SmVersion);
48 FunctionPass *createNVVMReflectPass(unsigned int SmVersion);
56 
57 namespace NVPTX {
61 };
62 
63 // A field inside TSFlags needs a shift and a mask. The usage is
64 // always as follows :
65 // ((TSFlags & fieldMask) >> fieldShift)
66 // The enum keeps the mask, the shift, and all valid values of the
67 // field in one place.
71 
72  VecNOP = 0,
73  VecLoad = 1,
74  VecStore = 2,
75  VecBuild = 3,
78  VecInsert = 6,
79  VecDest = 7,
80  VecOther = 15
81 };
82 
83 enum SimpleMove {
86 };
87 enum LoadStore {
88  isLoadMask = 0x20,
90  isStoreMask = 0x40,
92 };
93 
94 namespace PTXLdStInstCode {
96  GENERIC = 0,
97  GLOBAL = 1,
98  CONSTANT = 2,
99  SHARED = 3,
100  PARAM = 4,
101  LOCAL = 5
102 };
103 enum FromType {
104  Unsigned = 0,
108 };
109 enum VecType {
110  Scalar = 1,
111  V2 = 2,
112  V4 = 4
113 };
114 }
115 
116 /// PTXCvtMode - Conversion code enumeration
117 namespace PTXCvtMode {
118 enum CvtMode {
119  NONE = 0,
124  RN,
125  RZ,
126  RM,
127  RP,
128 
129  BASE_MASK = 0x0F,
130  FTZ_FLAG = 0x10,
131  SAT_FLAG = 0x20
132 };
133 }
134 
135 /// PTXCmpMode - Comparison mode enumeration
136 namespace PTXCmpMode {
137 enum CmpMode {
138  EQ = 0,
139  NE,
140  LT,
141  LE,
142  GT,
143  GE,
144  LO,
145  LS,
146  HI,
147  HS,
155  // NAN is a MACRO
157 
158  BASE_MASK = 0xFF,
159  FTZ_FLAG = 0x100
160 };
161 }
162 }
163 } // end namespace llvm;
164 
165 // Defines symbolic names for NVPTX registers. This defines a mapping from
166 // register name to register number.
167 #define GET_REGINFO_ENUM
168 #include "NVPTXGenRegisterInfo.inc"
169 
170 // Defines symbolic names for the NVPTX instructions.
171 #define GET_INSTRINFO_ENUM
172 #include "NVPTXGenInstrInfo.inc"
173 
174 #endif
MachineFunctionPass * createNVPTXProxyRegErasurePass()
This class represents lattice values for constants.
Definition: AllocatorList.h:23
ModulePass * createNVPTXAssignValidGlobalNamesPass()
SimpleMove
Definition: NVPTX.h:83
MachineFunctionPass * createNVPTXPrologEpilogPass()
ModulePass * createGenericToNVVMPass()
FunctionPass * createNVVMReflectPass(unsigned int SmVersion)
Definition: NVVMReflect.cpp:62
DrvInterface
Definition: NVPTX.h:58
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
FunctionPass * createNVPTXImageOptimizerPass()
MachineFunctionPass * createNVPTXReplaceImageHandlesPass()
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:284
VecInstType
Definition: NVPTX.h:68
BasicBlockPass class - This class is used to implement most local optimizations.
Definition: Pass.h:318
BasicBlockPass * createNVPTXLowerAllocaPass()
Module.h This file contains the declarations for the Module class.
NVPTXTargetMachine.
MachineFunctionPass * createNVPTXPeephole()
FunctionPass * createNVPTXISelDag(NVPTXTargetMachine &TM, llvm::CodeGenOpt::Level OptLevel)
createNVPTXISelDag - This pass converts a legalized DAG into a NVPTX-specific DAG, ready for instruction scheduling.
FunctionPass * createNVVMIntrRangePass(unsigned int SmVersion)
FunctionPass * createNVPTXLowerArgsPass(const NVPTXTargetMachine *TM)
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition: Pass.h:224