LLVM 22.0.0git
NVPTXTargetMachine.cpp
Go to the documentation of this file.
1//===-- NVPTXTargetMachine.cpp - Define TargetMachine for NVPTX -----------===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8//
9// Top-level implementation for the NVPTX target.
10//
11//===----------------------------------------------------------------------===//
12
13#include "NVPTXTargetMachine.h"
14#include "NVPTX.h"
15#include "NVPTXAliasAnalysis.h"
16#include "NVPTXAllocaHoisting.h"
17#include "NVPTXAtomicLower.h"
26#include "llvm/CodeGen/Passes.h"
28#include "llvm/IR/IntrinsicsNVPTX.h"
30#include "llvm/Pass.h"
41#include <cassert>
42#include <optional>
43#include <string>
44
45using namespace llvm;
46
47// LSV is still relatively new; this switch lets us turn it off in case we
48// encounter (or suspect) a bug.
49static cl::opt<bool>
50 DisableLoadStoreVectorizer("disable-nvptx-load-store-vectorizer",
51 cl::desc("Disable load/store vectorizer"),
52 cl::init(false), cl::Hidden);
53
54// TODO: Remove this flag when we are confident with no regressions.
56 "disable-nvptx-require-structured-cfg",
57 cl::desc("Transitional flag to turn off NVPTX's requirement on preserving "
58 "structured CFG. The requirement should be disabled only when "
59 "unexpected regressions happen."),
60 cl::init(false), cl::Hidden);
61
63 "nvptx-short-ptr",
65 "Use 32-bit pointers for accessing const/local/shared address spaces."),
66 cl::init(false), cl::Hidden);
67
68// byval arguments in NVPTX are special. We're only allowed to read from them
69// using a special instruction, and if we ever need to write to them or take an
70// address, we must make a local copy and use it, instead.
71//
72// The problem is that local copies are very expensive, and we create them very
73// late in the compilation pipeline, so LLVM does not have much of a chance to
74// eliminate them, if they turn out to be unnecessary.
75//
76// One way around that is to create such copies early on, and let them percolate
77// through the optimizations. The copying itself will never trigger creation of
78// another copy later on, as the reads are allowed. If LLVM can eliminate it,
79// it's a win. It the full optimization pipeline can't remove the copy, that's
80// as good as it gets in terms of the effort we could've done, and it's
81// certainly a much better effort than what we do now.
82//
83// This early injection of the copies has potential to create undesireable
84// side-effects, so it's disabled by default, for now, until it sees more
85// testing.
87 "nvptx-early-byval-copy",
88 cl::desc("Create a copy of byval function arguments early."),
89 cl::init(false), cl::Hidden);
90
92 // Register the target.
95
97 // FIXME: This pass is really intended to be invoked during IR optimization,
98 // but it's very NVPTX-specific.
119}
120
121static std::string computeDataLayout(bool is64Bit, bool UseShortPointers) {
122 std::string Ret = "e";
123
124 // Tensor Memory (addrspace:6) is always 32-bits.
125 // Distributed Shared Memory (addrspace:7) follows shared memory
126 // (addrspace:3).
127 if (!is64Bit)
128 Ret += "-p:32:32-p6:32:32-p7:32:32";
129 else if (UseShortPointers)
130 Ret += "-p3:32:32-p4:32:32-p5:32:32-p6:32:32-p7:32:32";
131 else
132 Ret += "-p6:32:32";
133
134 Ret += "-i64:64-i128:128-i256:256-v16:16-v32:32-n16:32:64";
135
136 return Ret;
137}
138
140 StringRef CPU, StringRef FS,
141 const TargetOptions &Options,
142 std::optional<Reloc::Model> RM,
143 std::optional<CodeModel::Model> CM,
144 CodeGenOptLevel OL, bool is64bit)
145 // The pic relocation model is used regardless of what the client has
146 // specified, as it is the only relocation model currently supported.
149 TT, CPU, FS, Options, Reloc::PIC_,
150 getEffectiveCodeModel(CM, CodeModel::Small), OL),
151 is64bit(is64bit), TLOF(std::make_unique<NVPTXTargetObjectFile>()),
152 Subtarget(TT, std::string(CPU), std::string(FS), *this),
153 StrPool(StrAlloc) {
154 if (TT.getOS() == Triple::NVCL)
155 drvInterface = NVPTX::NVCL;
156 else
157 drvInterface = NVPTX::CUDA;
160 initAsmInfo();
161}
162
164
165void NVPTXTargetMachine32::anchor() {}
166
168 StringRef CPU, StringRef FS,
169 const TargetOptions &Options,
170 std::optional<Reloc::Model> RM,
171 std::optional<CodeModel::Model> CM,
172 CodeGenOptLevel OL, bool JIT)
173 : NVPTXTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false) {}
174
175void NVPTXTargetMachine64::anchor() {}
176
178 StringRef CPU, StringRef FS,
179 const TargetOptions &Options,
180 std::optional<Reloc::Model> RM,
181 std::optional<CodeModel::Model> CM,
182 CodeGenOptLevel OL, bool JIT)
183 : NVPTXTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, true) {}
184
185namespace {
186
187class NVPTXPassConfig : public TargetPassConfig {
188public:
189 NVPTXPassConfig(NVPTXTargetMachine &TM, PassManagerBase &PM)
190 : TargetPassConfig(TM, PM) {}
191
192 NVPTXTargetMachine &getNVPTXTargetMachine() const {
193 return getTM<NVPTXTargetMachine>();
194 }
195
196 void addIRPasses() override;
197 bool addInstSelector() override;
198 void addPreRegAlloc() override;
199 void addPostRegAlloc() override;
200 void addMachineSSAOptimization() override;
201
202 FunctionPass *createTargetRegisterAllocator(bool) override;
203 void addFastRegAlloc() override;
204 void addOptimizedRegAlloc() override;
205
206 bool addRegAssignAndRewriteFast() override {
207 llvm_unreachable("should not be used");
208 }
209
210 bool addRegAssignAndRewriteOptimized() override {
211 llvm_unreachable("should not be used");
212 }
213
214private:
215 // If the opt level is aggressive, add GVN; otherwise, add EarlyCSE. This
216 // function is only called in opt mode.
217 void addEarlyCSEOrGVNPass();
218
219 // Add passes that propagate special memory spaces.
220 void addAddressSpaceInferencePasses();
221
222 // Add passes that perform straight-line scalar optimizations.
223 void addStraightLineScalarOptimizationPasses();
224};
225
226} // end anonymous namespace
227
229 return new NVPTXPassConfig(*this, PM);
230}
231
233 BumpPtrAllocator &Allocator, const Function &F,
234 const TargetSubtargetInfo *STI) const {
235 return NVPTXMachineFunctionInfo::create<NVPTXMachineFunctionInfo>(Allocator,
236 F, STI);
237}
238
241}
242
244#define GET_PASS_REGISTRY "NVPTXPassRegistry.def"
246
248 [this](ModulePassManager &PM, OptimizationLevel Level) {
249 // We do not want to fold out calls to nvvm.reflect early if the user
250 // has not provided a target architecture just yet.
251 if (Subtarget.hasTargetName())
252 PM.addPass(NVVMReflectPass(Subtarget.getSmVersion()));
253
255 // Note: NVVMIntrRangePass was causing numerical discrepancies at one
256 // point, if issues crop up, consider disabling.
259 FPM.addPass(NVPTXCopyByValArgsPass());
260 PM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
261 });
262
263 if (!NoKernelInfoEndLTO) {
265 [this](ModulePassManager &PM, OptimizationLevel Level) {
267 FPM.addPass(KernelInfoPrinter(this));
268 PM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
269 });
270 }
271}
272
275 return TargetTransformInfo(std::make_unique<NVPTXTTIImpl>(this, F));
276}
277
278std::pair<const Value *, unsigned>
280 if (auto *II = dyn_cast<IntrinsicInst>(V)) {
281 switch (II->getIntrinsicID()) {
282 case Intrinsic::nvvm_isspacep_const:
283 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_CONST);
284 case Intrinsic::nvvm_isspacep_global:
285 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_GLOBAL);
286 case Intrinsic::nvvm_isspacep_local:
287 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_LOCAL);
288 case Intrinsic::nvvm_isspacep_shared:
289 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_SHARED);
290 case Intrinsic::nvvm_isspacep_shared_cluster:
291 return std::make_pair(II->getArgOperand(0),
293 default:
294 break;
295 }
296 }
297 return std::make_pair(nullptr, -1);
298}
299
300void NVPTXPassConfig::addEarlyCSEOrGVNPass() {
301 if (getOptLevel() == CodeGenOptLevel::Aggressive)
302 addPass(createGVNPass());
303 else
304 addPass(createEarlyCSEPass());
305}
306
307void NVPTXPassConfig::addAddressSpaceInferencePasses() {
308 // NVPTXLowerArgs emits alloca for byval parameters which can often
309 // be eliminated by SROA.
310 addPass(createSROAPass());
312 // TODO: Consider running InferAddressSpaces during opt, earlier in the
313 // compilation flow.
316}
317
318void NVPTXPassConfig::addStraightLineScalarOptimizationPasses() {
321 // ReassociateGEPs exposes more opportunites for SLSR. See
322 // the example in reassociate-geps-and-slsr.ll.
324 // SeparateConstOffsetFromGEP and SLSR creates common expressions which GVN or
325 // EarlyCSE can reuse. GVN generates significantly better code than EarlyCSE
326 // for some of our benchmarks.
327 addEarlyCSEOrGVNPass();
328 // Run NaryReassociate after EarlyCSE/GVN to be more effective.
329 addPass(createNaryReassociatePass());
330 // NaryReassociate on GEPs creates redundant common expressions, so run
331 // EarlyCSE after it.
332 addPass(createEarlyCSEPass());
333}
334
335void NVPTXPassConfig::addIRPasses() {
336 // The following passes are known to not play well with virtual regs hanging
337 // around after register allocation (which in our case, is *all* registers).
338 // We explicitly disable them here. We do, however, need some functionality
339 // of the PrologEpilogCodeInserter pass, so we emulate that behavior in the
340 // NVPTXPrologEpilog pass (see NVPTXPrologEpilogPass.cpp).
341 disablePass(&PrologEpilogCodeInserterID);
342 disablePass(&MachineLateInstrsCleanupID);
343 disablePass(&MachineCopyPropagationID);
344 disablePass(&TailDuplicateLegacyID);
345 disablePass(&StackMapLivenessID);
346 disablePass(&PostRAMachineSinkingID);
347 disablePass(&PostRASchedulerID);
348 disablePass(&FuncletLayoutID);
349 disablePass(&PatchableFunctionID);
350 disablePass(&ShrinkWrapID);
351 disablePass(&RemoveLoadsIntoFakeUsesID);
352
353 addPass(createNVPTXAAWrapperPass());
355
356 // NVVMReflectPass is added in addEarlyAsPossiblePasses, so hopefully running
357 // it here does nothing. But since we need it for correctness when lowering
358 // to NVPTX, run it here too, in case whoever built our pass pipeline didn't
359 // call addEarlyAsPossiblePasses.
360 const NVPTXSubtarget &ST = *getTM<NVPTXTargetMachine>().getSubtargetImpl();
361 addPass(createNVVMReflectPass(ST.getSmVersion()));
362
363 if (getOptLevel() != CodeGenOptLevel::None)
367
368 // NVPTXLowerArgs is required for correctness and should be run right
369 // before the address space inference passes.
370 addPass(createNVPTXLowerArgsPass());
371 if (getOptLevel() != CodeGenOptLevel::None) {
372 addAddressSpaceInferencePasses();
373 addStraightLineScalarOptimizationPasses();
374 }
375
379
380 // === LSR and other generic IR passes ===
382 // EarlyCSE is not always strong enough to clean up what LSR produces. For
383 // example, GVN can combine
384 //
385 // %0 = add %a, %b
386 // %1 = add %b, %a
387 //
388 // and
389 //
390 // %0 = shl nsw %a, 2
391 // %1 = shl %a, 2
392 //
393 // but EarlyCSE can do neither of them.
394 if (getOptLevel() != CodeGenOptLevel::None) {
395 addEarlyCSEOrGVNPass();
398 addPass(createSROAPass());
400 }
401
402 if (ST.hasPTXASUnreachableBug()) {
403 // Run LowerUnreachable to WAR a ptxas bug. See the commit description of
404 // 1ee4d880e8760256c606fe55b7af85a4f70d006d for more details.
405 const auto &Options = getNVPTXTargetMachine().Options;
406 addPass(createNVPTXLowerUnreachablePass(Options.TrapUnreachable,
407 Options.NoTrapAfterNoreturn));
408 }
409}
410
411bool NVPTXPassConfig::addInstSelector() {
412 addPass(createLowerAggrCopies());
413 addPass(createAllocaHoisting());
414 addPass(createNVPTXISelDag(getNVPTXTargetMachine(), getOptLevel()));
416
417 return false;
418}
419
420void NVPTXPassConfig::addPreRegAlloc() {
422 // Remove Proxy Register pseudo instructions used to keep `callseq_end` alive.
424}
425
426void NVPTXPassConfig::addPostRegAlloc() {
428 if (getOptLevel() != CodeGenOptLevel::None) {
429 // NVPTXPrologEpilogPass calculates frame object offset and replace frame
430 // index with VRFrame register. NVPTXPeephole need to be run after that and
431 // will replace VRFrame with VRFrameLocal when possible.
432 addPass(createNVPTXPeephole());
433 }
434}
435
436FunctionPass *NVPTXPassConfig::createTargetRegisterAllocator(bool) {
437 return nullptr; // No reg alloc
438}
439
440void NVPTXPassConfig::addFastRegAlloc() {
441 addPass(&PHIEliminationID);
443}
444
445void NVPTXPassConfig::addOptimizedRegAlloc() {
446 addPass(&ProcessImplicitDefsID);
447 addPass(&LiveVariablesID);
448 addPass(&MachineLoopInfoID);
449 addPass(&PHIEliminationID);
450
452 addPass(&RegisterCoalescerID);
453
454 // PreRA instruction scheduling.
455 if (addPass(&MachineSchedulerID))
456 printAndVerify("After Machine Scheduling");
457
458 addPass(&StackSlotColoringID);
459
460 // FIXME: Needs physical registers
461 // addPass(&MachineLICMID);
462
463 printAndVerify("After StackSlotColoring");
464}
465
466void NVPTXPassConfig::addMachineSSAOptimization() {
467 // Pre-ra tail duplication.
468 if (addPass(&EarlyTailDuplicateLegacyID))
469 printAndVerify("After Pre-RegAlloc TailDuplicate");
470
471 // Optimize PHIs before DCE: removing dead PHI cycles may make more
472 // instructions dead.
473 addPass(&OptimizePHIsLegacyID);
474
475 // This pass merges large allocas. StackSlotColoring is a different pass
476 // which merges spill slots.
477 addPass(&StackColoringLegacyID);
478
479 // If the target requests it, assign local variables to stack slots relative
480 // to one another and simplify frame index references where possible.
482
483 // With optimization, dead code should already be eliminated. However
484 // there is one known exception: lowered code for arguments that are only
485 // used by tail calls, where the tail calls reuse the incoming stack
486 // arguments directly (see t11 in test/CodeGen/X86/sibcall.ll).
488 printAndVerify("After codegen DCE pass");
489
490 // Allow targets to insert passes that improve instruction level parallelism,
491 // like if-conversion. Such passes will typically need dominator trees and
492 // loop info, just like LICM and CSE below.
493 if (addILPOpts())
494 printAndVerify("After ILP optimizations");
495
496 addPass(&EarlyMachineLICMID);
497 addPass(&MachineCSELegacyID);
498
499 addPass(&MachineSinkingLegacyID);
500 printAndVerify("After Machine LICM, CSE and Sinking passes");
501
503 printAndVerify("After codegen peephole optimization pass");
504}
#define LLVM_ABI
Definition: Compiler.h:213
#define LLVM_EXTERNAL_VISIBILITY
Definition: Compiler.h:132
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
This file provides the interface for LLVM's Global Value Numbering pass which eliminates fully redund...
static LVOptions Options
Definition: LVOptions.cpp:25
static std::string computeDataLayout()
#define F(x, y, z)
Definition: MD5.cpp:55
This is the NVPTX address space based alias analysis pass.
static cl::opt< bool > DisableLoadStoreVectorizer("disable-nvptx-load-store-vectorizer", cl::desc("Disable load/store vectorizer"), cl::init(false), cl::Hidden)
static cl::opt< bool > DisableRequireStructuredCFG("disable-nvptx-require-structured-cfg", cl::desc("Transitional flag to turn off NVPTX's requirement on preserving " "structured CFG. The requirement should be disabled only when " "unexpected regressions happen."), cl::init(false), cl::Hidden)
static cl::opt< bool > UseShortPointersOpt("nvptx-short-ptr", cl::desc("Use 32-bit pointers for accessing const/local/shared address spaces."), cl::init(false), cl::Hidden)
static cl::opt< bool > EarlyByValArgsCopy("nvptx-early-byval-copy", cl::desc("Create a copy of byval function arguments early."), cl::init(false), cl::Hidden)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeNVPTXTarget()
This file a TargetTransformInfoImplBase conforming object specific to the NVPTX target machine.
uint64_t IntrinsicInst * II
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
PassBuilder PB(Machine, PassOpts->PTO, std::nullopt, &PIC)
Basic Register Allocator
Target-Independent Code Generator Pass Configuration Options pass.
This pass exposes codegen information to IR-level passes.
static bool is64Bit(const char *name)
A manager for alias analyses.
void registerFunctionAnalysis()
Register a specific AA result.
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:67
implements a set of functionality in the TargetMachine class for targets that make use of the indepen...
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:314
Analysis pass providing a never-invalidated alias analysis result.
unsigned int getSmVersion() const
bool hasTargetName() const
NVPTXTargetMachine32(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM, CodeGenOptLevel OL, bool JIT)
NVPTXTargetMachine64(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM, CodeGenOptLevel OL, bool JIT)
TargetTransformInfo getTargetTransformInfo(const Function &F) const override
Get a TargetTransformInfo implementation for the target.
std::pair< const Value *, unsigned > getPredicatedAddrSpace(const Value *V) const override
If the specified predicate checks whether a generic pointer falls within a specified address space,...
void registerPassBuilderCallbacks(PassBuilder &PB) override
Allow the target to modify the pass pipeline.
void registerEarlyDefaultAliasAnalyses(AAManager &AAM) override
Allow the target to register early alias analyses (AA before BasicAA) with the AAManager for use with...
~NVPTXTargetMachine() override
NVPTXTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM, CodeGenOptLevel OP, bool is64bit)
MachineFunctionInfo * createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F, const TargetSubtargetInfo *STI) const override
Create the target's instance of MachineFunctionInfo.
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
This class provides access to building LLVM's passes.
Definition: PassBuilder.h:110
void registerPipelineStartEPCallback(const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:494
void registerFullLinkTimeOptimizationLastEPCallback(const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:542
LLVM_ATTRIBUTE_MINSIZE std::enable_if_t<!std::is_same_v< PassT, PassManager > > addPass(PassT &&Pass)
Definition: PassManager.h:196
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
Definition: PassRegistry.h:38
static LLVM_ABI PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
void setRequiresStructuredCFG(bool Value)
std::unique_ptr< const MCSubtargetInfo > STI
Target-Independent Code Generator Pass Configuration Options.
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
TargetSubtargetInfo - Generic base class for all target subtargets.
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:47
LLVM Value Representation.
Definition: Value.h:75
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
Interfaces for registering analysis passes, producing common pass manager configurations,...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_ABI llvm::cl::opt< bool > NoKernelInfoEndLTO
This file defines the TargetMachine class.
@ ADDRESS_SPACE_SHARED_CLUSTER
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:444
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
void initializeNVPTXLowerAllocaPass(PassRegistry &)
LLVM_ABI char & EarlyMachineLICMID
This pass performs loop invariant code motion on machine instructions.
ModulePass * createNVPTXAssignValidGlobalNamesPass()
void initializeNVPTXPrologEpilogPassPass(PassRegistry &)
MachineFunctionPass * createNVPTXReplaceImageHandlesPass()
FunctionPass * createNVPTXLowerUnreachablePass(bool TrapUnreachable, bool NoTrapAfterNoreturn)
void initializeNVPTXAssignValidGlobalNamesPass(PassRegistry &)
ModulePass * createExpandVariadicsPass(ExpandVariadicsMode)
LLVM_ABI char & RegisterCoalescerID
RegisterCoalescer - This pass merges live ranges to eliminate copies.
ModuleToFunctionPassAdaptor createModuleToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false)
A function to deduce a function pass type and wrap it in the templated adaptor.
Definition: PassManager.h:877
ModulePass * createGenericToNVVMLegacyPass()
void initializeNVPTXLowerAggrCopiesPass(PassRegistry &)
void initializeNVPTXExternalAAWrapperPass(PassRegistry &)
MachineFunctionPass * createNVPTXPrologEpilogPass()
MachineFunctionPass * createNVPTXProxyRegErasurePass()
LLVM_ABI char & TailDuplicateLegacyID
TailDuplicate - Duplicate blocks with unconditional branches into tails of their predecessors.
LLVM_ABI Pass * createLoadStoreVectorizerPass()
Create a legacy pass manager instance of the LoadStoreVectorizer pass.
LLVM_ABI FunctionPass * createNaryReassociatePass()
LLVM_ABI char & PatchableFunctionID
This pass implements the "patchable-function" attribute.
ImmutablePass * createNVPTXExternalAAWrapperPass()
void initializeNVPTXLowerArgsLegacyPassPass(PassRegistry &)
LLVM_ABI char & PostRASchedulerID
PostRAScheduler - This pass performs post register allocation scheduling.
LLVM_ABI char & RemoveLoadsIntoFakeUsesID
RemoveLoadsIntoFakeUses pass.
MachineFunctionPass * createNVPTXPeephole()
LLVM_ABI char & MachineSchedulerID
MachineScheduler - This pass schedules machine instructions.
LLVM_ABI char & PeepholeOptimizerLegacyID
PeepholeOptimizer - This pass performs peephole optimizations - like extension and comparison elimina...
FunctionPass * createNVPTXISelDag(NVPTXTargetMachine &TM, llvm::CodeGenOptLevel OptLevel)
createNVPTXISelDag - This pass converts a legalized DAG into a NVPTX-specific DAG,...
LLVM_ABI char & PrologEpilogCodeInserterID
PrologEpilogCodeInserter - This pass inserts prolog and epilog code, and eliminates abstract frame re...
void initializeGenericToNVVMLegacyPassPass(PassRegistry &)
void initializeNVPTXPeepholePass(PassRegistry &)
void initializeNVPTXCtorDtorLoweringLegacyPass(PassRegistry &)
void initializeNVPTXLowerUnreachablePass(PassRegistry &)
FunctionPass * createNVPTXTagInvariantLoadsPass()
LLVM_ABI char & MachineLoopInfoID
MachineLoopInfo - This pass is a loop analysis pass.
void initializeNVVMReflectLegacyPassPass(PassRegistry &)
FunctionPass * createNVPTXLowerArgsPass()
CodeModel::Model getEffectiveCodeModel(std::optional< CodeModel::Model > CM, CodeModel::Model Default)
Helper method for getting the code model, returning Default if CM does not have a value.
LLVM_ABI char & ShrinkWrapID
ShrinkWrap pass. Look for the best place to insert save and restore.
Definition: ShrinkWrap.cpp:292
LLVM_ABI char & MachineLateInstrsCleanupID
MachineLateInstrsCleanup - This pass removes redundant identical instructions after register allocati...
void initializeNVPTXAAWrapperPassPass(PassRegistry &)
FunctionPass * createNVPTXImageOptimizerPass()
FunctionPass * createNVPTXLowerAllocaPass()
MachineFunctionPass * createNVPTXForwardParamsPass()
LLVM_ABI char & OptimizePHIsLegacyID
OptimizePHIs - This pass optimizes machine instruction PHIs to take advantage of opportunities create...
LLVM_ABI FunctionPass * createSpeculativeExecutionPass()
LLVM_ABI char & StackMapLivenessID
StackMapLiveness - This pass analyses the register live-out set of stackmap/patchpoint intrinsics and...
LLVM_ABI char & FuncletLayoutID
This pass lays out funclets contiguously.
FunctionPass * createAllocaHoisting()
void initializeNVVMIntrRangePass(PassRegistry &)
LLVM_ABI char & PostRAMachineSinkingID
This pass perform post-ra machine sink for COPY instructions.
CodeGenOptLevel
Code generation optimization level.
Definition: CodeGen.h:82
LLVM_ABI char & StackSlotColoringID
StackSlotColoring - This pass performs stack slot coloring.
void initializeNVPTXAsmPrinterPass(PassRegistry &)
LLVM_ABI FunctionPass * createSeparateConstOffsetFromGEPPass(bool LowerGEP=false)
FunctionPass * createLowerAggrCopies()
LLVM_ABI char & ProcessImplicitDefsID
ProcessImpicitDefs pass - This pass removes IMPLICIT_DEFs.
void initializeNVPTXTagInvariantLoadLegacyPassPass(PassRegistry &)
LLVM_ABI FunctionPass * createGVNPass()
Create a legacy GVN pass.
Definition: GVN.cpp:3448
FunctionPass * createNVPTXAtomicLowerPass()
ModulePass * createNVPTXCtorDtorLoweringLegacyPass()
LLVM_ABI char & MachineCSELegacyID
MachineCSE - This pass performs global CSE on machine instructions.
Definition: MachineCSE.cpp:163
LLVM_ABI char & LiveVariablesID
LiveVariables pass - This pass computes the set of blocks in which each variable is life and sets mac...
LLVM_ABI char & EarlyTailDuplicateLegacyID
Duplicate blocks with unconditional branches into tails of their predecessors.
void initializeNVPTXAllocaHoistingPass(PassRegistry &)
Target & getTheNVPTXTarget64()
LLVM_ABI char & StackColoringLegacyID
StackSlotColoring - This pass performs stack coloring and merging.
LLVM_ABI FunctionPass * createInferAddressSpacesPass(unsigned AddressSpace=~0u)
void initializeNVPTXProxyRegErasurePass(PassRegistry &)
ImmutablePass * createNVPTXAAWrapperPass()
LLVM_ABI char & MachineSinkingLegacyID
MachineSinking - This pass performs sinking on machine instructions.
ModulePass * createNVVMReflectPass(unsigned int SmVersion)
LLVM_ABI char & TwoAddressInstructionPassID
TwoAddressInstruction - This pass reduces two-address instructions to use two operands.
LLVM_ABI FunctionPass * createAtomicExpandLegacyPass()
AtomicExpandPass - At IR level this pass replace atomic instructions with __atomic_* library calls,...
LLVM_ABI char & LocalStackSlotAllocationID
LocalStackSlotAllocation - This pass assigns local frame indices to stack slots relative to one anoth...
LLVM_ABI FunctionPass * createStraightLineStrengthReducePass()
LLVM_ABI FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
Definition: EarlyCSE.cpp:1946
LLVM_ABI char & PHIEliminationID
PHIElimination - This pass eliminates machine instruction PHI nodes by inserting copy instructions.
LLVM_ABI FunctionPass * createSROAPass(bool PreserveCFG=true)
Definition: SROA.cpp:5805
void initializeNVPTXAtomicLowerPass(PassRegistry &)
void initializeNVPTXForwardParamsPassPass(PassRegistry &)
LLVM_ABI char & MachineCopyPropagationID
MachineCopyPropagation - This pass performs copy propagation on machine instructions.
LLVM_ABI char & DeadMachineInstructionElimID
DeadMachineInstructionElim - This pass removes dead machine instructions.
Target & getTheNVPTXTarget32()
void initializeNVPTXDAGToDAGISelLegacyPass(PassRegistry &)
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:856
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
RegisterTargetMachine - Helper template for registering a target machine implementation,...