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/Module.h"
20 #include "llvm/Support/ErrorHandling.h"
21 #include "llvm/Target/TargetMachine.h"
22 #include "llvm/Value.h"
27 class NVPTXTargetMachine;
29 class formatted_raw_ostream;
42 inline static const char *NVPTXCondCodeToString(NVPTXCC::CondCodes CC) {
44 case NVPTXCC::NE: return "ne";
45 case NVPTXCC::EQ: return "eq";
46 case NVPTXCC::LT: return "lt";
47 case NVPTXCC::LE: return "le";
48 case NVPTXCC::GT: return "gt";
49 case NVPTXCC::GE: return "ge";
51 llvm_unreachable("Unknown condition code");
54 FunctionPass *createNVPTXISelDag(NVPTXTargetMachine &TM,
55 llvm::CodeGenOpt::Level OptLevel);
56 FunctionPass *createVectorElementizePass(NVPTXTargetMachine &);
57 FunctionPass *createLowerStructArgsPass(NVPTXTargetMachine &);
58 FunctionPass *createNVPTXReMatPass(NVPTXTargetMachine &);
59 FunctionPass *createNVPTXReMatBlockPass(NVPTXTargetMachine &);
61 bool isImageOrSamplerVal(const Value *, const Module *);
63 extern Target TheNVPTXTarget32;
64 extern Target TheNVPTXTarget64;
74 // A field inside TSFlags needs a shift and a mask. The usage is
75 // always as follows :
76 // ((TSFlags & fieldMask) >> fieldShift)
77 // The enum keeps the mask, the shift, and all valid values of the
78 // field in one place.
81 VecInstTypeMask = 0xF,
95 SimpleMoveMask = 0x10,
105 namespace PTXLdStInstCode {
126 } // end namespace llvm;
128 // Defines symbolic names for NVPTX registers. This defines a mapping from
129 // register name to register number.
130 #define GET_REGINFO_ENUM
131 #include "NVPTXGenRegisterInfo.inc"
133 // Defines symbolic names for the NVPTX instructions.
134 #define GET_INSTRINFO_ENUM
135 #include "NVPTXGenInstrInfo.inc"