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 FPM.addPass(NVVMReflectPass(Subtarget.getSmVersion()));
259 // Note: NVVMIntrRangePass was causing numerical discrepancies at one
260 // point, if issues crop up, consider disabling.
264 PM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
265 });
266}
267
270 return TargetTransformInfo(NVPTXTTIImpl(this, F));
271}
272
273std::pair<const Value *, unsigned>
275 if (auto *II = dyn_cast<IntrinsicInst>(V)) {
276 switch (II->getIntrinsicID()) {
277 case Intrinsic::nvvm_isspacep_const:
278 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_CONST);
279 case Intrinsic::nvvm_isspacep_global:
280 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_GLOBAL);
281 case Intrinsic::nvvm_isspacep_local:
282 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_LOCAL);
283 case Intrinsic::nvvm_isspacep_shared:
284 case Intrinsic::nvvm_isspacep_shared_cluster:
285 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_SHARED);
286 default:
287 break;
288 }
289 }
290 return std::make_pair(nullptr, -1);
291}
292
293void NVPTXPassConfig::addEarlyCSEOrGVNPass() {
294 if (getOptLevel() == CodeGenOptLevel::Aggressive)
295 addPass(createGVNPass());
296 else
297 addPass(createEarlyCSEPass());
298}
299
300void NVPTXPassConfig::addAddressSpaceInferencePasses() {
301 // NVPTXLowerArgs emits alloca for byval parameters which can often
302 // be eliminated by SROA.
303 addPass(createSROAPass());
305 // TODO: Consider running InferAddressSpaces during opt, earlier in the
306 // compilation flow.
309}
310
311void NVPTXPassConfig::addStraightLineScalarOptimizationPasses() {
314 // ReassociateGEPs exposes more opportunites for SLSR. See
315 // the example in reassociate-geps-and-slsr.ll.
317 // SeparateConstOffsetFromGEP and SLSR creates common expressions which GVN or
318 // EarlyCSE can reuse. GVN generates significantly better code than EarlyCSE
319 // for some of our benchmarks.
320 addEarlyCSEOrGVNPass();
321 // Run NaryReassociate after EarlyCSE/GVN to be more effective.
322 addPass(createNaryReassociatePass());
323 // NaryReassociate on GEPs creates redundant common expressions, so run
324 // EarlyCSE after it.
325 addPass(createEarlyCSEPass());
326}
327
328void NVPTXPassConfig::addIRPasses() {
329 // The following passes are known to not play well with virtual regs hanging
330 // around after register allocation (which in our case, is *all* registers).
331 // We explicitly disable them here. We do, however, need some functionality
332 // of the PrologEpilogCodeInserter pass, so we emulate that behavior in the
333 // NVPTXPrologEpilog pass (see NVPTXPrologEpilogPass.cpp).
334 disablePass(&PrologEpilogCodeInserterID);
335 disablePass(&MachineLateInstrsCleanupID);
336 disablePass(&MachineCopyPropagationID);
337 disablePass(&TailDuplicateLegacyID);
338 disablePass(&StackMapLivenessID);
339 disablePass(&PostRAMachineSinkingID);
340 disablePass(&PostRASchedulerID);
341 disablePass(&FuncletLayoutID);
342 disablePass(&PatchableFunctionID);
343 disablePass(&ShrinkWrapID);
344 disablePass(&RemoveLoadsIntoFakeUsesID);
345
346 addPass(createNVPTXAAWrapperPass());
347 addPass(createExternalAAWrapperPass([](Pass &P, Function &, AAResults &AAR) {
348 if (auto *WrapperPass = P.getAnalysisIfAvailable<NVPTXAAWrapperPass>())
349 AAR.addAAResult(WrapperPass->getResult());
350 }));
351
352 // NVVMReflectPass is added in addEarlyAsPossiblePasses, so hopefully running
353 // it here does nothing. But since we need it for correctness when lowering
354 // to NVPTX, run it here too, in case whoever built our pass pipeline didn't
355 // call addEarlyAsPossiblePasses.
356 const NVPTXSubtarget &ST = *getTM<NVPTXTargetMachine>().getSubtargetImpl();
357 addPass(createNVVMReflectPass(ST.getSmVersion()));
358
359 if (getOptLevel() != CodeGenOptLevel::None)
363
364 // NVPTXLowerArgs is required for correctness and should be run right
365 // before the address space inference passes.
366 addPass(createNVPTXLowerArgsPass());
367 if (getOptLevel() != CodeGenOptLevel::None) {
368 addAddressSpaceInferencePasses();
369 addStraightLineScalarOptimizationPasses();
370 }
371
375
376 // === LSR and other generic IR passes ===
378 // EarlyCSE is not always strong enough to clean up what LSR produces. For
379 // example, GVN can combine
380 //
381 // %0 = add %a, %b
382 // %1 = add %b, %a
383 //
384 // and
385 //
386 // %0 = shl nsw %a, 2
387 // %1 = shl %a, 2
388 //
389 // but EarlyCSE can do neither of them.
390 if (getOptLevel() != CodeGenOptLevel::None) {
391 addEarlyCSEOrGVNPass();
394 addPass(createSROAPass());
395 }
396
397 if (ST.hasPTXASUnreachableBug()) {
398 // Run LowerUnreachable to WAR a ptxas bug. See the commit description of
399 // 1ee4d880e8760256c606fe55b7af85a4f70d006d for more details.
400 const auto &Options = getNVPTXTargetMachine().Options;
401 addPass(createNVPTXLowerUnreachablePass(Options.TrapUnreachable,
402 Options.NoTrapAfterNoreturn));
403 }
404}
405
406bool NVPTXPassConfig::addInstSelector() {
407 addPass(createLowerAggrCopies());
408 addPass(createAllocaHoisting());
409 addPass(createNVPTXISelDag(getNVPTXTargetMachine(), getOptLevel()));
411
412 return false;
413}
414
415void NVPTXPassConfig::addPreRegAlloc() {
416 // Remove Proxy Register pseudo instructions used to keep `callseq_end` alive.
418}
419
420void NVPTXPassConfig::addPostRegAlloc() {
422 if (getOptLevel() != CodeGenOptLevel::None) {
423 // NVPTXPrologEpilogPass calculates frame object offset and replace frame
424 // index with VRFrame register. NVPTXPeephole need to be run after that and
425 // will replace VRFrame with VRFrameLocal when possible.
426 addPass(createNVPTXPeephole());
427 }
428}
429
430FunctionPass *NVPTXPassConfig::createTargetRegisterAllocator(bool) {
431 return nullptr; // No reg alloc
432}
433
434void NVPTXPassConfig::addFastRegAlloc() {
435 addPass(&PHIEliminationID);
437}
438
439void NVPTXPassConfig::addOptimizedRegAlloc() {
440 addPass(&ProcessImplicitDefsID);
441 addPass(&LiveVariablesID);
442 addPass(&MachineLoopInfoID);
443 addPass(&PHIEliminationID);
444
446 addPass(&RegisterCoalescerID);
447
448 // PreRA instruction scheduling.
449 if (addPass(&MachineSchedulerID))
450 printAndVerify("After Machine Scheduling");
451
452 addPass(&StackSlotColoringID);
453
454 // FIXME: Needs physical registers
455 // addPass(&MachineLICMID);
456
457 printAndVerify("After StackSlotColoring");
458}
459
460void NVPTXPassConfig::addMachineSSAOptimization() {
461 // Pre-ra tail duplication.
462 if (addPass(&EarlyTailDuplicateLegacyID))
463 printAndVerify("After Pre-RegAlloc TailDuplicate");
464
465 // Optimize PHIs before DCE: removing dead PHI cycles may make more
466 // instructions dead.
467 addPass(&OptimizePHIsLegacyID);
468
469 // This pass merges large allocas. StackSlotColoring is a different pass
470 // which merges spill slots.
471 addPass(&StackColoringLegacyID);
472
473 // If the target requests it, assign local variables to stack slots relative
474 // to one another and simplify frame index references where possible.
476
477 // With optimization, dead code should already be eliminated. However
478 // there is one known exception: lowered code for arguments that are only
479 // used by tail calls, where the tail calls reuse the incoming stack
480 // arguments directly (see t11 in test/CodeGen/X86/sibcall.ll).
482 printAndVerify("After codegen DCE pass");
483
484 // Allow targets to insert passes that improve instruction level parallelism,
485 // like if-conversion. Such passes will typically need dominator trees and
486 // loop info, just like LICM and CSE below.
487 if (addILPOpts())
488 printAndVerify("After ILP optimizations");
489
490 addPass(&EarlyMachineLICMID);
491 addPass(&MachineCSELegacyID);
492
493 addPass(&MachineSinkingID);
494 printAndVerify("After Machine LICM, CSE and Sinking passes");
495
497 printAndVerify("After codegen peephole optimization pass");
498}
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
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:65
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 * 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.
FunctionPass * createGVNPass(bool NoMemDepAnalysis=false)
Create a legacy GVN pass.
Definition: GVN.cpp:3352
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,...