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_TARGET_NVPTX_H
16 #define LLVM_TARGET_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");
63 createNVPTXISelDag(NVPTXTargetMachine &TM, llvm::CodeGenOpt::Level OptLevel);
64 FunctionPass *createLowerStructArgsPass(NVPTXTargetMachine &);
65 FunctionPass *createNVPTXReMatPass(NVPTXTargetMachine &);
66 FunctionPass *createNVPTXReMatBlockPass(NVPTXTargetMachine &);
67 ModulePass *createGenericToNVVMPass();
68 ModulePass *createNVVMReflectPass();
69 ModulePass *createNVVMReflectPass(const StringMap<int>& Mapping);
70 MachineFunctionPass *createNVPTXPrologEpilogPass();
72 bool isImageOrSamplerVal(const Value *, const Module *);
74 extern Target TheNVPTXTarget32;
75 extern Target TheNVPTXTarget64;
83 // A field inside TSFlags needs a shift and a mask. The usage is
84 // always as follows :
85 // ((TSFlags & fieldMask) >> fieldShift)
86 // The enum keeps the mask, the shift, and all valid values of the
87 // field in one place.
90 VecInstTypeMask = 0xF,
104 SimpleMoveMask = 0x10,
114 namespace PTXLdStInstCode {
135 } // end namespace llvm;
137 // Defines symbolic names for NVPTX registers. This defines a mapping from
138 // register name to register number.
139 #define GET_REGINFO_ENUM
140 #include "NVPTXGenRegisterInfo.inc"
142 // Defines symbolic names for the NVPTX instructions.
143 #define GET_INSTRINFO_ENUM
144 #include "NVPTXGenInstrInfo.inc"