LLVM 20.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"
25#include "llvm/CodeGen/Passes.h"
27#include "llvm/IR/IntrinsicsNVPTX.h"
29#include "llvm/Pass.h"
39#include <cassert>
40#include <optional>
41#include <string>
42
43using namespace llvm;
44
45// LSV is still relatively new; this switch lets us turn it off in case we
46// encounter (or suspect) a bug.
47static cl::opt<bool>
48 DisableLoadStoreVectorizer("disable-nvptx-load-store-vectorizer",
49 cl::desc("Disable load/store vectorizer"),
50 cl::init(false), cl::Hidden);
51
52// TODO: Remove this flag when we are confident with no regressions.
54 "disable-nvptx-require-structured-cfg",
55 cl::desc("Transitional flag to turn off NVPTX's requirement on preserving "
56 "structured CFG. The requirement should be disabled only when "
57 "unexpected regressions happen."),
58 cl::init(false), cl::Hidden);
59
61 "nvptx-short-ptr",
63 "Use 32-bit pointers for accessing const/local/shared address spaces."),
64 cl::init(false), cl::Hidden);
65
66// byval arguments in NVPTX are special. We're only allowed to read from them
67// using a special instruction, and if we ever need to write to them or take an
68// address, we must make a local copy and use it, instead.
69//
70// The problem is that local copies are very expensive, and we create them very
71// late in the compilation pipeline, so LLVM does not have much of a chance to
72// eliminate them, if they turn out to be unnecessary.
73//
74// One way around that is to create such copies early on, and let them percolate
75// through the optimizations. The copying itself will never trigger creation of
76// another copy later on, as the reads are allowed. If LLVM can eliminate it,
77// it's a win. It the full optimization pipeline can't remove the copy, that's
78// as good as it gets in terms of the effort we could've done, and it's
79// certainly a much better effort than what we do now.
80//
81// This early injection of the copies has potential to create undesireable
82// side-effects, so it's disabled by default, for now, until it sees more
83// testing.
85 "nvptx-early-byval-copy",
86 cl::desc("Create a copy of byval function arguments early."),
87 cl::init(false), cl::Hidden);
88
89namespace llvm {
90
106
107} // end namespace llvm
108
110 // Register the target.
113
115 // FIXME: This pass is really intended to be invoked during IR optimization,
116 // but it's very NVPTX-specific.
132}
133
134static std::string computeDataLayout(bool is64Bit, bool UseShortPointers) {
135 std::string Ret = "e";
136
137 if (!is64Bit)
138 Ret += "-p:32:32";
139 else if (UseShortPointers)
140 Ret += "-p3:32:32-p4:32:32-p5:32:32";
141
142 Ret += "-i64:64-i128:128-v16:16-v32:32-n16:32:64";
143
144 return Ret;
145}
146
148 StringRef CPU, StringRef FS,
149 const TargetOptions &Options,
150 std::optional<Reloc::Model> RM,
151 std::optional<CodeModel::Model> CM,
152 CodeGenOptLevel OL, bool is64bit)
153 // The pic relocation model is used regardless of what the client has
154 // specified, as it is the only relocation model currently supported.
157 TT, CPU, FS, Options, Reloc::PIC_,
158 getEffectiveCodeModel(CM, CodeModel::Small), OL),
159 is64bit(is64bit), TLOF(std::make_unique<NVPTXTargetObjectFile>()),
160 Subtarget(TT, std::string(CPU), std::string(FS), *this),
161 StrPool(StrAlloc) {
162 if (TT.getOS() == Triple::NVCL)
163 drvInterface = NVPTX::NVCL;
164 else
165 drvInterface = NVPTX::CUDA;
168 initAsmInfo();
169}
170
172
173void NVPTXTargetMachine32::anchor() {}
174
176 StringRef CPU, StringRef FS,
177 const TargetOptions &Options,
178 std::optional<Reloc::Model> RM,
179 std::optional<CodeModel::Model> CM,
180 CodeGenOptLevel OL, bool JIT)
181 : NVPTXTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false) {}
182
183void NVPTXTargetMachine64::anchor() {}
184
186 StringRef CPU, StringRef FS,
187 const TargetOptions &Options,
188 std::optional<Reloc::Model> RM,
189 std::optional<CodeModel::Model> CM,
190 CodeGenOptLevel OL, bool JIT)
191 : NVPTXTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, true) {}
192
193namespace {
194
195class NVPTXPassConfig : public TargetPassConfig {
196public:
197 NVPTXPassConfig(NVPTXTargetMachine &TM, PassManagerBase &PM)
198 : TargetPassConfig(TM, PM) {}
199
200 NVPTXTargetMachine &getNVPTXTargetMachine() const {
201 return getTM<NVPTXTargetMachine>();
202 }
203
204 void addIRPasses() override;
205 bool addInstSelector() override;
206 void addPreRegAlloc() override;
207 void addPostRegAlloc() override;
208 void addMachineSSAOptimization() override;
209
210 FunctionPass *createTargetRegisterAllocator(bool) override;
211 void addFastRegAlloc() override;
212 void addOptimizedRegAlloc() override;
213
214 bool addRegAssignAndRewriteFast() override {
215 llvm_unreachable("should not be used");
216 }
217
218 bool addRegAssignAndRewriteOptimized() override {
219 llvm_unreachable("should not be used");
220 }
221
222private:
223 // If the opt level is aggressive, add GVN; otherwise, add EarlyCSE. This
224 // function is only called in opt mode.
225 void addEarlyCSEOrGVNPass();
226
227 // Add passes that propagate special memory spaces.
228 void addAddressSpaceInferencePasses();
229
230 // Add passes that perform straight-line scalar optimizations.
231 void addStraightLineScalarOptimizationPasses();
232};
233
234} // end anonymous namespace
235
237 return new NVPTXPassConfig(*this, PM);
238}
239
241 BumpPtrAllocator &Allocator, const Function &F,
242 const TargetSubtargetInfo *STI) const {
243 return NVPTXMachineFunctionInfo::create<NVPTXMachineFunctionInfo>(Allocator,
244 F, STI);
245}
246
249}
250
252#define GET_PASS_REGISTRY "NVPTXPassRegistry.def"
254
256 [this](ModulePassManager &PM, OptimizationLevel Level) {
258 // We do not want to fold out calls to nvvm.reflect early if the user
259 // has not provided a target architecture just yet.
260 if (Subtarget.hasTargetName())
261 FPM.addPass(NVVMReflectPass(Subtarget.getSmVersion()));
262 // Note: NVVMIntrRangePass was causing numerical discrepancies at one
263 // point, if issues crop up, consider disabling.
267 PM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
268 });
269}
270
273 return TargetTransformInfo(NVPTXTTIImpl(this, F));
274}
275
276std::pair<const Value *, unsigned>
278 if (auto *II = dyn_cast<IntrinsicInst>(V)) {
279 switch (II->getIntrinsicID()) {
280 case Intrinsic::nvvm_isspacep_const:
281 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_CONST);
282 case Intrinsic::nvvm_isspacep_global:
283 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_GLOBAL);
284 case Intrinsic::nvvm_isspacep_local:
285 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_LOCAL);
286 case Intrinsic::nvvm_isspacep_shared:
287 case Intrinsic::nvvm_isspacep_shared_cluster:
288 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_SHARED);
289 default:
290 break;
291 }
292 }
293 return std::make_pair(nullptr, -1);
294}
295
296void NVPTXPassConfig::addEarlyCSEOrGVNPass() {
297 if (getOptLevel() == CodeGenOptLevel::Aggressive)
298 addPass(createGVNPass());
299 else
300 addPass(createEarlyCSEPass());
301}
302
303void NVPTXPassConfig::addAddressSpaceInferencePasses() {
304 // NVPTXLowerArgs emits alloca for byval parameters which can often
305 // be eliminated by SROA.
306 addPass(createSROAPass());
308 // TODO: Consider running InferAddressSpaces during opt, earlier in the
309 // compilation flow.
312}
313
314void NVPTXPassConfig::addStraightLineScalarOptimizationPasses() {
317 // ReassociateGEPs exposes more opportunites for SLSR. See
318 // the example in reassociate-geps-and-slsr.ll.
320 // SeparateConstOffsetFromGEP and SLSR creates common expressions which GVN or
321 // EarlyCSE can reuse. GVN generates significantly better code than EarlyCSE
322 // for some of our benchmarks.
323 addEarlyCSEOrGVNPass();
324 // Run NaryReassociate after EarlyCSE/GVN to be more effective.
325 addPass(createNaryReassociatePass());
326 // NaryReassociate on GEPs creates redundant common expressions, so run
327 // EarlyCSE after it.
328 addPass(createEarlyCSEPass());
329}
330
331void NVPTXPassConfig::addIRPasses() {
332 // The following passes are known to not play well with virtual regs hanging
333 // around after register allocation (which in our case, is *all* registers).
334 // We explicitly disable them here. We do, however, need some functionality
335 // of the PrologEpilogCodeInserter pass, so we emulate that behavior in the
336 // NVPTXPrologEpilog pass (see NVPTXPrologEpilogPass.cpp).
337 disablePass(&PrologEpilogCodeInserterID);
338 disablePass(&MachineLateInstrsCleanupID);
339 disablePass(&MachineCopyPropagationID);
340 disablePass(&TailDuplicateLegacyID);
341 disablePass(&StackMapLivenessID);
342 disablePass(&PostRAMachineSinkingID);
343 disablePass(&PostRASchedulerID);
344 disablePass(&FuncletLayoutID);
345 disablePass(&PatchableFunctionID);
346 disablePass(&ShrinkWrapID);
347 disablePass(&RemoveLoadsIntoFakeUsesID);
348
349 addPass(createNVPTXAAWrapperPass());
350 addPass(createExternalAAWrapperPass([](Pass &P, Function &, AAResults &AAR) {
351 if (auto *WrapperPass = P.getAnalysisIfAvailable<NVPTXAAWrapperPass>())
352 AAR.addAAResult(WrapperPass->getResult());
353 }));
354
355 // NVVMReflectPass is added in addEarlyAsPossiblePasses, so hopefully running
356 // it here does nothing. But since we need it for correctness when lowering
357 // to NVPTX, run it here too, in case whoever built our pass pipeline didn't
358 // call addEarlyAsPossiblePasses.
359 const NVPTXSubtarget &ST = *getTM<NVPTXTargetMachine>().getSubtargetImpl();
360 addPass(createNVVMReflectPass(ST.getSmVersion()));
361
362 if (getOptLevel() != CodeGenOptLevel::None)
366
367 // NVPTXLowerArgs is required for correctness and should be run right
368 // before the address space inference passes.
369 addPass(createNVPTXLowerArgsPass());
370 if (getOptLevel() != CodeGenOptLevel::None) {
371 addAddressSpaceInferencePasses();
372 addStraightLineScalarOptimizationPasses();
373 }
374
378
379 // === LSR and other generic IR passes ===
381 // EarlyCSE is not always strong enough to clean up what LSR produces. For
382 // example, GVN can combine
383 //
384 // %0 = add %a, %b
385 // %1 = add %b, %a
386 //
387 // and
388 //
389 // %0 = shl nsw %a, 2
390 // %1 = shl %a, 2
391 //
392 // but EarlyCSE can do neither of them.
393 if (getOptLevel() != CodeGenOptLevel::None) {
394 addEarlyCSEOrGVNPass();
397 addPass(createSROAPass());
398 }
399
400 if (ST.hasPTXASUnreachableBug()) {
401 // Run LowerUnreachable to WAR a ptxas bug. See the commit description of
402 // 1ee4d880e8760256c606fe55b7af85a4f70d006d for more details.
403 const auto &Options = getNVPTXTargetMachine().Options;
404 addPass(createNVPTXLowerUnreachablePass(Options.TrapUnreachable,
405 Options.NoTrapAfterNoreturn));
406 }
407}
408
409bool NVPTXPassConfig::addInstSelector() {
410 addPass(createLowerAggrCopies());
411 addPass(createAllocaHoisting());
412 addPass(createNVPTXISelDag(getNVPTXTargetMachine(), getOptLevel()));
414
415 return false;
416}
417
418void NVPTXPassConfig::addPreRegAlloc() {
419 // Remove Proxy Register pseudo instructions used to keep `callseq_end` alive.
421}
422
423void NVPTXPassConfig::addPostRegAlloc() {
425 if (getOptLevel() != CodeGenOptLevel::None) {
426 // NVPTXPrologEpilogPass calculates frame object offset and replace frame
427 // index with VRFrame register. NVPTXPeephole need to be run after that and
428 // will replace VRFrame with VRFrameLocal when possible.
429 addPass(createNVPTXPeephole());
430 }
431}
432
433FunctionPass *NVPTXPassConfig::createTargetRegisterAllocator(bool) {
434 return nullptr; // No reg alloc
435}
436
437void NVPTXPassConfig::addFastRegAlloc() {
438 addPass(&PHIEliminationID);
440}
441
442void NVPTXPassConfig::addOptimizedRegAlloc() {
443 addPass(&ProcessImplicitDefsID);
444 addPass(&LiveVariablesID);
445 addPass(&MachineLoopInfoID);
446 addPass(&PHIEliminationID);
447
449 addPass(&RegisterCoalescerID);
450
451 // PreRA instruction scheduling.
452 if (addPass(&MachineSchedulerID))
453 printAndVerify("After Machine Scheduling");
454
455 addPass(&StackSlotColoringID);
456
457 // FIXME: Needs physical registers
458 // addPass(&MachineLICMID);
459
460 printAndVerify("After StackSlotColoring");
461}
462
463void NVPTXPassConfig::addMachineSSAOptimization() {
464 // Pre-ra tail duplication.
465 if (addPass(&EarlyTailDuplicateLegacyID))
466 printAndVerify("After Pre-RegAlloc TailDuplicate");
467
468 // Optimize PHIs before DCE: removing dead PHI cycles may make more
469 // instructions dead.
470 addPass(&OptimizePHIsLegacyID);
471
472 // This pass merges large allocas. StackSlotColoring is a different pass
473 // which merges spill slots.
474 addPass(&StackColoringLegacyID);
475
476 // If the target requests it, assign local variables to stack slots relative
477 // to one another and simplify frame index references where possible.
479
480 // With optimization, dead code should already be eliminated. However
481 // there is one known exception: lowered code for arguments that are only
482 // used by tail calls, where the tail calls reuse the incoming stack
483 // arguments directly (see t11 in test/CodeGen/X86/sibcall.ll).
485 printAndVerify("After codegen DCE pass");
486
487 // Allow targets to insert passes that improve instruction level parallelism,
488 // like if-conversion. Such passes will typically need dominator trees and
489 // loop info, just like LICM and CSE below.
490 if (addILPOpts())
491 printAndVerify("After ILP optimizations");
492
493 addPass(&EarlyMachineLICMID);
494 addPass(&MachineCSELegacyID);
495
496 addPass(&MachineSinkingID);
497 printAndVerify("After Machine LICM, CSE and Sinking passes");
498
500 printAndVerify("After codegen peephole optimization pass");
501}
basic Basic Alias true
#define LLVM_EXTERNAL_VISIBILITY
Definition: Compiler.h:128
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_EXTERNAL_VISIBILITY void LLVMInitializeNVPTXTarget()
This file a TargetTransformInfo::Concept conforming object specific to the NVPTX target machine.
uint64_t IntrinsicInst * II
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
#define P(N)
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.
void addAAResult(AAResultT &AAResult)
Register a specific AA result.
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:66
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:310
Legacy wrapper pass to provide the NVPTXAAResult object.
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.
void registerDefaultAliasAnalyses(AAManager &AAM) override
Allow the target to register alias analyses with the AAManager for use with the new pass manager.
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.
~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:105
void registerPipelineStartEPCallback(const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
Definition: PassBuilder.h:473
LLVM_ATTRIBUTE_MINSIZE std::enable_if_t<!std::is_same_v< PassT, PassManager > > addPass(PassT &&Pass)
Definition: PassManager.h:195
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
Definition: PassRegistry.h:37
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Pass interface - Implemented by all 'passes'.
Definition: Pass.h:94
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
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:44
LLVM Value Representation.
Definition: Value.h:74
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.
@ NVCL
Definition: NVPTX.h:79
@ CUDA
Definition: NVPTX.h:80
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:443
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
void initializeNVPTXLowerAllocaPass(PassRegistry &)
char & EarlyMachineLICMID
This pass performs loop invariant code motion on machine instructions.
ModulePass * createNVPTXAssignValidGlobalNamesPass()
MachineFunctionPass * createNVPTXReplaceImageHandlesPass()
FunctionPass * createNVPTXLowerUnreachablePass(bool TrapUnreachable, bool NoTrapAfterNoreturn)
void initializeNVPTXAssignValidGlobalNamesPass(PassRegistry &)
Pass * createLoadStoreVectorizerPass()
Create a legacy pass manager instance of the LoadStoreVectorizer pass.
ModulePass * createExpandVariadicsPass(ExpandVariadicsMode)
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:852
ModulePass * createGenericToNVVMLegacyPass()
FunctionPass * createNVVMReflectPass(unsigned int SmVersion)
Definition: NVVMReflect.cpp:66
void initializeNVPTXLowerAggrCopiesPass(PassRegistry &)
void initializeNVPTXExternalAAWrapperPass(PassRegistry &)
char & MachineSinkingID
MachineSinking - This pass performs sinking on machine instructions.
MachineFunctionPass * createNVPTXPrologEpilogPass()
MachineFunctionPass * createNVPTXProxyRegErasurePass()
char & TailDuplicateLegacyID
TailDuplicate - Duplicate blocks with unconditional branches into tails of their predecessors.
FunctionPass * createNaryReassociatePass()
char & PatchableFunctionID
This pass implements the "patchable-function" attribute.
char & PostRASchedulerID
PostRAScheduler - This pass performs post register allocation scheduling.
char & RemoveLoadsIntoFakeUsesID
RemoveLoadsIntoFakeUses pass.
MachineFunctionPass * createNVPTXPeephole()
void initializeNVVMReflectPass(PassRegistry &)
char & MachineSchedulerID
MachineScheduler - This pass schedules machine instructions.
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,...
char & PrologEpilogCodeInserterID
PrologEpilogCodeInserter - This pass inserts prolog and epilog code, and eliminates abstract frame re...
void initializeGenericToNVVMLegacyPassPass(PassRegistry &)
void initializeNVPTXCtorDtorLoweringLegacyPass(PassRegistry &)
void initializeNVPTXLowerUnreachablePass(PassRegistry &)
void initializeNVPTXLowerArgsPass(PassRegistry &)
char & MachineLoopInfoID
MachineLoopInfo - This pass is a loop analysis pass.
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.
char & ShrinkWrapID
ShrinkWrap pass. Look for the best place to insert save and restore.
Definition: ShrinkWrap.cpp:287
char & MachineLateInstrsCleanupID
MachineLateInstrsCleanup - This pass removes redundant identical instructions after register allocati...
void initializeNVPTXAAWrapperPassPass(PassRegistry &)
FunctionPass * createNVPTXImageOptimizerPass()
FunctionPass * createNVPTXLowerAllocaPass()
char & OptimizePHIsLegacyID
OptimizePHIs - This pass optimizes machine instruction PHIs to take advantage of opportunities create...
FunctionPass * createSpeculativeExecutionPass()
char & StackMapLivenessID
StackMapLiveness - This pass analyses the register live-out set of stackmap/patchpoint intrinsics and...
char & FuncletLayoutID
This pass lays out funclets contiguously.
FunctionPass * createAllocaHoisting()
void initializeNVVMIntrRangePass(PassRegistry &)
char & PostRAMachineSinkingID
This pass perform post-ra machine sink for COPY instructions.
CodeGenOptLevel
Code generation optimization level.
Definition: CodeGen.h:54
char & StackSlotColoringID
StackSlotColoring - This pass performs stack slot coloring.
FunctionPass * createSeparateConstOffsetFromGEPPass(bool LowerGEP=false)
FunctionPass * createLowerAggrCopies()
char & ProcessImplicitDefsID
ProcessImpicitDefs pass - This pass removes IMPLICIT_DEFs.
FunctionPass * createGVNPass()
Create a legacy GVN pass.
Definition: GVN.cpp:3374
FunctionPass * createNVPTXAtomicLowerPass()
ModulePass * createNVPTXCtorDtorLoweringLegacyPass()
char & MachineCSELegacyID
MachineCSE - This pass performs global CSE on machine instructions.
Definition: MachineCSE.cpp:164
char & LiveVariablesID
LiveVariables pass - This pass computes the set of blocks in which each variable is life and sets mac...
char & EarlyTailDuplicateLegacyID
Duplicate blocks with unconditional branches into tails of their predecessors.
void initializeNVPTXAllocaHoistingPass(PassRegistry &)
Target & getTheNVPTXTarget64()
char & StackColoringLegacyID
StackSlotColoring - This pass performs stack coloring and merging.
FunctionPass * createInferAddressSpacesPass(unsigned AddressSpace=~0u)
void initializeNVPTXProxyRegErasurePass(PassRegistry &)
ImmutablePass * createNVPTXAAWrapperPass()
ImmutablePass * createExternalAAWrapperPass(std::function< void(Pass &, Function &, AAResults &)> Callback)
A wrapper pass around a callback which can be used to populate the AAResults in the AAResultsWrapperP...
char & TwoAddressInstructionPassID
TwoAddressInstruction - This pass reduces two-address instructions to use two operands.
FunctionPass * createAtomicExpandLegacyPass()
AtomicExpandPass - At IR level this pass replace atomic instructions with __atomic_* library calls,...
char & LocalStackSlotAllocationID
LocalStackSlotAllocation - This pass assigns local frame indices to stack slots relative to one anoth...
FunctionPass * createStraightLineStrengthReducePass()
FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
Definition: EarlyCSE.cpp:1944
char & PHIEliminationID
PHIElimination - This pass eliminates machine instruction PHI nodes by inserting copy instructions.
FunctionPass * createSROAPass(bool PreserveCFG=true)
Definition: SROA.cpp:5838
void initializeNVPTXAtomicLowerPass(PassRegistry &)
char & MachineCopyPropagationID
MachineCopyPropagation - This pass performs copy propagation on machine instructions.
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:858
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,...