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 ImmutablePass *createNVPTXTargetTransformInfoPass(const NVPTXTargetMachine *TM);
64 createNVPTXISelDag(NVPTXTargetMachine &TM, llvm::CodeGenOpt::Level OptLevel);
65 ModulePass *createNVPTXAssignValidGlobalNamesPass();
66 ModulePass *createGenericToNVVMPass();
67 FunctionPass *createNVPTXFavorNonGenericAddrSpacesPass();
68 ModulePass *createNVVMReflectPass();
69 ModulePass *createNVVMReflectPass(const StringMap<int>& Mapping);
70 MachineFunctionPass *createNVPTXPrologEpilogPass();
71 MachineFunctionPass *createNVPTXReplaceImageHandlesPass();
72 FunctionPass *createNVPTXImageOptimizerPass();
73 FunctionPass *createNVPTXLowerStructArgsPass();
75 bool isImageOrSamplerVal(const Value *, const Module *);
77 extern Target TheNVPTXTarget32;
78 extern Target TheNVPTXTarget64;
86 // A field inside TSFlags needs a shift and a mask. The usage is
87 // always as follows :
88 // ((TSFlags & fieldMask) >> fieldShift)
89 // The enum keeps the mask, the shift, and all valid values of the
90 // field in one place.
93 VecInstTypeMask = 0xF,
107 SimpleMoveMask = 0x10,
117 namespace PTXLdStInstCode {
138 /// PTXCvtMode - Conversion code enumeration
139 namespace PTXCvtMode {
157 /// PTXCmpMode - Comparison mode enumeration
158 namespace PTXCmpMode {
185 } // end namespace llvm;
187 // Defines symbolic names for NVPTX registers. This defines a mapping from
188 // register name to register number.
189 #define GET_REGINFO_ENUM
190 #include "NVPTXGenRegisterInfo.inc"
192 // Defines symbolic names for the NVPTX instructions.
193 #define GET_INSTRINFO_ENUM
194 #include "NVPTXGenInstrInfo.inc"