1 //===-- NVPTX.h - Top-level interface for NVPTX representation --*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file contains the entry points for global functions defined in
10 // the LLVM NVPTX back-end.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTX_H
15 #define LLVM_LIB_TARGET_NVPTX_NVPTX_H
17 #include "llvm/IR/PassManager.h"
18 #include "llvm/Pass.h"
19 #include "llvm/Support/CodeGen.h"
23 class MachineFunctionPass
;
24 class NVPTXTargetMachine
;
38 FunctionPass
*createNVPTXISelDag(NVPTXTargetMachine
&TM
,
39 llvm::CodeGenOptLevel OptLevel
);
40 ModulePass
*createNVPTXAssignValidGlobalNamesPass();
41 ModulePass
*createGenericToNVVMLegacyPass();
42 ModulePass
*createNVPTXCtorDtorLoweringLegacyPass();
43 FunctionPass
*createNVVMIntrRangePass();
44 FunctionPass
*createNVVMReflectPass(unsigned int SmVersion
);
45 MachineFunctionPass
*createNVPTXPrologEpilogPass();
46 MachineFunctionPass
*createNVPTXReplaceImageHandlesPass();
47 FunctionPass
*createNVPTXImageOptimizerPass();
48 FunctionPass
*createNVPTXLowerArgsPass();
49 FunctionPass
*createNVPTXLowerAllocaPass();
50 FunctionPass
*createNVPTXLowerUnreachablePass(bool TrapUnreachable
,
51 bool NoTrapAfterNoreturn
);
52 MachineFunctionPass
*createNVPTXPeephole();
53 MachineFunctionPass
*createNVPTXProxyRegErasurePass();
55 struct NVVMIntrRangePass
: PassInfoMixin
<NVVMIntrRangePass
> {
56 PreservedAnalyses
run(Function
&F
, FunctionAnalysisManager
&AM
);
59 struct NVVMReflectPass
: PassInfoMixin
<NVVMReflectPass
> {
61 NVVMReflectPass(unsigned SmVersion
) : SmVersion(SmVersion
) {}
62 PreservedAnalyses
run(Function
&F
, FunctionAnalysisManager
&AM
);
68 struct GenericToNVVMPass
: PassInfoMixin
<GenericToNVVMPass
> {
69 PreservedAnalyses
run(Module
&M
, ModuleAnalysisManager
&AM
);
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
{
131 /// PTXCvtMode - Conversion code enumeration
132 namespace PTXCvtMode
{
152 /// PTXCmpMode - Comparison mode enumeration
153 namespace PTXCmpMode
{
180 namespace PTXPrmtMode
{
192 void initializeNVPTXDAGToDAGISelLegacyPass(PassRegistry
&);
195 // Defines symbolic names for NVPTX registers. This defines a mapping from
196 // register name to register number.
197 #define GET_REGINFO_ENUM
198 #include "NVPTXGenRegisterInfo.inc"
200 // Defines symbolic names for the NVPTX instructions.
201 #define GET_INSTRINFO_ENUM
202 #define GET_INSTRINFO_MC_HELPER_DECLS
203 #include "NVPTXGenInstrInfo.inc"