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/IR/Module.h"
20 #include "llvm/IR/Value.h"
21 #include "llvm/Support/ErrorHandling.h"
22 #include "llvm/Target/TargetMachine.h"
27 class NVPTXTargetMachine;
29 class formatted_raw_ostream;
42 inline static const char *NVPTXCondCodeToString(NVPTXCC::CondCodes CC) {
57 llvm_unreachable("Unknown condition code");
61 createNVPTXISelDag(NVPTXTargetMachine &TM, llvm::CodeGenOpt::Level OptLevel);
62 FunctionPass *createLowerStructArgsPass(NVPTXTargetMachine &);
63 FunctionPass *createNVPTXReMatPass(NVPTXTargetMachine &);
64 FunctionPass *createNVPTXReMatBlockPass(NVPTXTargetMachine &);
66 bool isImageOrSamplerVal(const Value *, const Module *);
68 extern Target TheNVPTXTarget32;
69 extern Target TheNVPTXTarget64;
78 // A field inside TSFlags needs a shift and a mask. The usage is
79 // always as follows :
80 // ((TSFlags & fieldMask) >> fieldShift)
81 // The enum keeps the mask, the shift, and all valid values of the
82 // field in one place.
85 VecInstTypeMask = 0xF,
99 SimpleMoveMask = 0x10,
109 namespace PTXLdStInstCode {
130 } // end namespace llvm;
132 // Defines symbolic names for NVPTX registers. This defines a mapping from
133 // register name to register number.
134 #define GET_REGINFO_ENUM
135 #include "NVPTXGenRegisterInfo.inc"
137 // Defines symbolic names for the NVPTX instructions.
138 #define GET_INSTRINFO_ENUM
139 #include "NVPTXGenInstrInfo.inc"