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 FunctionPass *createNVPTXISelDag(NVPTXTargetMachine &TM,
45 llvm::CodeGenOpt::Level OptLevel);
46 ModulePass *createNVPTXAssignValidGlobalNamesPass();
47 ModulePass *createGenericToNVVMPass();
48 FunctionPass *createNVVMIntrRangePass(unsigned int SmVersion);
49 FunctionPass *createNVVMReflectPass(unsigned int SmVersion);
50 MachineFunctionPass *createNVPTXPrologEpilogPass();
51 MachineFunctionPass *createNVPTXReplaceImageHandlesPass();
52 FunctionPass *createNVPTXImageOptimizerPass();
53 FunctionPass *createNVPTXLowerArgsPass(const NVPTXTargetMachine *TM);
54 BasicBlockPass *createNVPTXLowerAllocaPass();
55 MachineFunctionPass *createNVPTXPeephole();
56 MachineFunctionPass *createNVPTXProxyRegErasurePass();
58 Target &getTheNVPTXTarget32();
59 Target &getTheNVPTXTarget64();
67 // A field inside TSFlags needs a shift and a mask. The usage is
68 // always as follows :
69 // ((TSFlags & fieldMask) >> fieldShift)
70 // The enum keeps the mask, the shift, and all valid values of the
71 // field in one place.
74 VecInstTypeMask = 0xF,
88 SimpleMoveMask = 0x10,
98 namespace PTXLdStInstCode {
120 /// PTXCvtMode - Conversion code enumeration
121 namespace PTXCvtMode {
139 /// PTXCmpMode - Comparison mode enumeration
140 namespace PTXCmpMode {
167 } // end namespace llvm;
169 // Defines symbolic names for NVPTX registers. This defines a mapping from
170 // register name to register number.
171 #define GET_REGINFO_ENUM
172 #include "NVPTXGenRegisterInfo.inc"
174 // Defines symbolic names for the NVPTX instructions.
175 #define GET_INSTRINFO_ENUM
176 #include "NVPTXGenInstrInfo.inc"