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();
57 Target
&getTheNVPTXTarget32();
58 Target
&getTheNVPTXTarget64();
66 // A field inside TSFlags needs a shift and a mask. The usage is
67 // always as follows :
68 // ((TSFlags & fieldMask) >> fieldShift)
69 // The enum keeps the mask, the shift, and all valid values of the
70 // field in one place.
73 VecInstTypeMask
= 0xF,
87 SimpleMoveMask
= 0x10,
97 namespace PTXLdStInstCode
{
119 /// PTXCvtMode - Conversion code enumeration
120 namespace PTXCvtMode
{
138 /// PTXCmpMode - Comparison mode enumeration
139 namespace PTXCmpMode
{
166 } // end namespace llvm;
168 // Defines symbolic names for NVPTX registers. This defines a mapping from
169 // register name to register number.
170 #define GET_REGINFO_ENUM
171 #include "NVPTXGenRegisterInfo.inc"
173 // Defines symbolic names for the NVPTX instructions.
174 #define GET_INSTRINFO_ENUM
175 #include "NVPTXGenInstrInfo.inc"