1 //===-- NVPTX.h - Top-level interface for NVPTX representation --*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the entry points for global functions defined in
11 // the LLVM NVPTX back-end.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTX_H
16 #define LLVM_LIB_TARGET_NVPTX_NVPTX_H
18 #include "MCTargetDesc/NVPTXBaseInfo.h"
19 #include "llvm/ADT/StringMap.h"
20 #include "llvm/IR/Module.h"
21 #include "llvm/IR/Value.h"
22 #include "llvm/Support/ErrorHandling.h"
23 #include "llvm/Target/TargetMachine.h"
28 class NVPTXTargetMachine;
30 class MachineFunctionPass;
31 class formatted_raw_ostream;
44 inline static const char *NVPTXCondCodeToString(NVPTXCC::CondCodes CC) {
59 llvm_unreachable("Unknown condition code");
62 FunctionPass *createNVPTXISelDag(NVPTXTargetMachine &TM,
63 llvm::CodeGenOpt::Level OptLevel);
64 ModulePass *createNVPTXAssignValidGlobalNamesPass();
65 ModulePass *createGenericToNVVMPass();
66 FunctionPass *createNVPTXFavorNonGenericAddrSpacesPass();
67 ModulePass *createNVVMReflectPass();
68 ModulePass *createNVVMReflectPass(const StringMap<int>& Mapping);
69 MachineFunctionPass *createNVPTXPrologEpilogPass();
70 MachineFunctionPass *createNVPTXReplaceImageHandlesPass();
71 FunctionPass *createNVPTXImageOptimizerPass();
72 FunctionPass *createNVPTXLowerStructArgsPass();
74 bool isImageOrSamplerVal(const Value *, const Module *);
76 extern Target TheNVPTXTarget32;
77 extern Target TheNVPTXTarget64;
85 // A field inside TSFlags needs a shift and a mask. The usage is
86 // always as follows :
87 // ((TSFlags & fieldMask) >> fieldShift)
88 // The enum keeps the mask, the shift, and all valid values of the
89 // field in one place.
92 VecInstTypeMask = 0xF,
106 SimpleMoveMask = 0x10,
116 namespace PTXLdStInstCode {
137 /// PTXCvtMode - Conversion code enumeration
138 namespace PTXCvtMode {
156 /// PTXCmpMode - Comparison mode enumeration
157 namespace PTXCmpMode {
184 } // end namespace llvm;
186 // Defines symbolic names for NVPTX registers. This defines a mapping from
187 // register name to register number.
188 #define GET_REGINFO_ENUM
189 #include "NVPTXGenRegisterInfo.inc"
191 // Defines symbolic names for the NVPTX instructions.
192 #define GET_INSTRINFO_ENUM
193 #include "NVPTXGenInstrInfo.inc"