LLVM 23.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// NVPTX IR Peephole is a new pass; this option will lets us turn it off in case
55// we encounter some issues.
56static cl::opt<bool>
57 DisableNVPTXIRPeephole("disable-nvptx-ir-peephole",
58 cl::desc("Disable NVPTX IR Peephole"),
59 cl::init(false), cl::Hidden);
60
61// TODO: Remove this flag when we are confident with no regressions.
63 "disable-nvptx-require-structured-cfg",
64 cl::desc("Transitional flag to turn off NVPTX's requirement on preserving "
65 "structured CFG. The requirement should be disabled only when "
66 "unexpected regressions happen."),
67 cl::init(false), cl::Hidden);
68
70 "nvptx-short-ptr",
72 "Use 32-bit pointers for accessing const/local/shared address spaces."),
73 cl::init(false), cl::Hidden);
74
75// byval arguments in NVPTX are special. We're only allowed to read from them
76// using a special instruction, and if we ever need to write to them or take an
77// address, we must make a local copy and use it, instead.
78//
79// The problem is that local copies are very expensive, and we create them very
80// late in the compilation pipeline, so LLVM does not have much of a chance to
81// eliminate them, if they turn out to be unnecessary.
82//
83// One way around that is to create such copies early on, and let them percolate
84// through the optimizations. The copying itself will never trigger creation of
85// another copy later on, as the reads are allowed. If LLVM can eliminate it,
86// it's a win. It the full optimization pipeline can't remove the copy, that's
87// as good as it gets in terms of the effort we could've done, and it's
88// certainly a much better effort than what we do now.
89//
90// This early injection of the copies has potential to create undesireable
91// side-effects, so it's disabled by default, for now, until it sees more
92// testing.
94 "nvptx-early-byval-copy",
95 cl::desc("Create a copy of byval function arguments early."),
96 cl::init(false), cl::Hidden);
97
99 // Register the target.
102
104 // FIXME: This pass is really intended to be invoked during IR optimization,
105 // but it's very NVPTX-specific.
130}
131
133 StringRef CPU, StringRef FS,
134 const TargetOptions &Options,
135 std::optional<Reloc::Model> RM,
136 std::optional<CodeModel::Model> CM,
137 CodeGenOptLevel OL, bool is64bit)
138 // The pic relocation model is used regardless of what the client has
139 // specified, as it is the only relocation model currently supported.
141 T, TT.computeDataLayout(UseShortPointersOpt ? "shortptr" : ""), TT,
142 CPU, FS, Options, Reloc::PIC_,
143 getEffectiveCodeModel(CM, CodeModel::Small), OL),
144 is64bit(is64bit), TLOF(std::make_unique<NVPTXTargetObjectFile>()),
145 Subtarget(TT, std::string(CPU), std::string(FS), *this),
146 StrPool(StrAlloc) {
147 if (TT.getOS() == Triple::NVCL)
148 drvInterface = NVPTX::NVCL;
149 else
150 drvInterface = NVPTX::CUDA;
153 initAsmInfo();
154}
155
157
158void NVPTXTargetMachine32::anchor() {}
159
161 StringRef CPU, StringRef FS,
162 const TargetOptions &Options,
163 std::optional<Reloc::Model> RM,
164 std::optional<CodeModel::Model> CM,
165 CodeGenOptLevel OL, bool JIT)
166 : NVPTXTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false) {}
167
168void NVPTXTargetMachine64::anchor() {}
169
171 StringRef CPU, StringRef FS,
172 const TargetOptions &Options,
173 std::optional<Reloc::Model> RM,
174 std::optional<CodeModel::Model> CM,
175 CodeGenOptLevel OL, bool JIT)
176 : NVPTXTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, true) {}
177
178namespace {
179
180class NVPTXPassConfig : public TargetPassConfig {
181public:
182 NVPTXPassConfig(NVPTXTargetMachine &TM, PassManagerBase &PM)
183 : TargetPassConfig(TM, PM) {}
184
185 NVPTXTargetMachine &getNVPTXTargetMachine() const {
187 }
188
189 void addIRPasses() override;
190 bool addInstSelector() override;
191 void addPreRegAlloc() override;
192 void addPostRegAlloc() override;
193 void addMachineSSAOptimization() override;
194
195 FunctionPass *createTargetRegisterAllocator(bool) override;
196 void addFastRegAlloc() override;
197 void addOptimizedRegAlloc() override;
198
199 bool addRegAssignAndRewriteFast() override {
200 llvm_unreachable("should not be used");
201 }
202
203 bool addRegAssignAndRewriteOptimized() override {
204 llvm_unreachable("should not be used");
205 }
206
207private:
208 // If the opt level is aggressive, add GVN; otherwise, add EarlyCSE. This
209 // function is only called in opt mode.
210 void addEarlyCSEOrGVNPass();
211
212 // Add passes that propagate special memory spaces.
213 void addAddressSpaceInferencePasses();
214
215 // Add passes that perform straight-line scalar optimizations.
216 void addStraightLineScalarOptimizationPasses();
217};
218
219} // end anonymous namespace
220
222 return new NVPTXPassConfig(*this, PM);
223}
224
231
235
237#define GET_PASS_REGISTRY "NVPTXPassRegistry.def"
239
240 PB.registerPipelineStartEPCallback(
241 [this](ModulePassManager &PM, OptimizationLevel Level) {
242 // We do not want to fold out calls to nvvm.reflect early if the user
243 // has not provided a target architecture just yet.
244 if (Subtarget.hasTargetName())
245 PM.addPass(NVVMReflectPass(Subtarget.getSmVersion()));
246
248 // Note: NVVMIntrRangePass was causing numerical discrepancies at one
249 // point, if issues crop up, consider disabling.
253 PM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
254 });
255
256 if (!NoKernelInfoEndLTO) {
257 PB.registerFullLinkTimeOptimizationLastEPCallback(
258 [this](ModulePassManager &PM, OptimizationLevel Level) {
260 FPM.addPass(KernelInfoPrinter(this));
261 PM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
262 });
263 }
264}
265
268 return TargetTransformInfo(std::make_unique<NVPTXTTIImpl>(this, F));
269}
270
271std::pair<const Value *, unsigned>
273 if (auto *II = dyn_cast<IntrinsicInst>(V)) {
274 switch (II->getIntrinsicID()) {
275 case Intrinsic::nvvm_isspacep_const:
276 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_CONST);
277 case Intrinsic::nvvm_isspacep_global:
278 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_GLOBAL);
279 case Intrinsic::nvvm_isspacep_local:
280 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_LOCAL);
281 case Intrinsic::nvvm_isspacep_shared:
282 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_SHARED);
283 case Intrinsic::nvvm_isspacep_shared_cluster:
284 return std::make_pair(II->getArgOperand(0),
286 default:
287 break;
288 }
289 }
290 return std::make_pair(nullptr, -1);
291}
292
293void NVPTXPassConfig::addEarlyCSEOrGVNPass() {
294 if (getOptLevel() == CodeGenOptLevel::Aggressive)
295 // Disable scalar PRE due to Register Pressure increase
296 addPass(createGVNPass(/*ScalarPRE=*/false));
297 else
298 addPass(createEarlyCSEPass());
299}
300
301void NVPTXPassConfig::addAddressSpaceInferencePasses() {
302 // NVPTXLowerArgs emits alloca for byval parameters which can often
303 // be eliminated by SROA.
304 addPass(createSROAPass(/*PreserveCFG=*/true,
305 /*AggregateToVector=*/true));
307 // TODO: Consider running InferAddressSpaces during opt, earlier in the
308 // compilation flow.
311}
312
313void NVPTXPassConfig::addStraightLineScalarOptimizationPasses() {
316 // ReassociateGEPs exposes more opportunites for SLSR. See
317 // the example in reassociate-geps-and-slsr.ll.
319 // SeparateConstOffsetFromGEP and SLSR creates common expressions which GVN or
320 // EarlyCSE can reuse. GVN generates significantly better code than EarlyCSE
321 // for some of our benchmarks.
322 addEarlyCSEOrGVNPass();
323 // Run NaryReassociate after EarlyCSE/GVN to be more effective.
324 addPass(createNaryReassociatePass());
325 // NaryReassociate on GEPs creates redundant common expressions, so run
326 // EarlyCSE after it.
327 addPass(createEarlyCSEPass());
328}
329
330void NVPTXPassConfig::addIRPasses() {
331 // The following passes are known to not play well with virtual regs hanging
332 // around after register allocation (which in our case, is *all* registers).
333 // We explicitly disable them here. We do, however, need some functionality
334 // of the PrologEpilogCodeInserter pass, so we emulate that behavior in the
335 // NVPTXPrologEpilog pass (see NVPTXPrologEpilogPass.cpp).
336 disablePass(&PrologEpilogCodeInserterID);
337 disablePass(&MachineLateInstrsCleanupID);
338 disablePass(&MachineCopyPropagationID);
339 disablePass(&TailDuplicateLegacyID);
340 disablePass(&StackMapLivenessID);
341 disablePass(&PostRAMachineSinkingID);
342 disablePass(&PostRASchedulerID);
343 disablePass(&FuncletLayoutID);
344 disablePass(&PatchableFunctionID);
345 disablePass(&ShrinkWrapID);
346 disablePass(&RemoveLoadsIntoFakeUsesID);
347
348 addPass(createNVPTXAAWrapperPass());
350
351 // NVVMReflectPass is added in addEarlyAsPossiblePasses, so hopefully running
352 // it here does nothing. But since we need it for correctness when lowering
353 // to NVPTX, run it here too, in case whoever built our pass pipeline didn't
354 // call addEarlyAsPossiblePasses.
356 addPass(createNVVMReflectPass(ST.getSmVersion()));
357
358 if (getOptLevel() != CodeGenOptLevel::None)
362
363 // Lower variadic calls before address space inference.
365
366 // NVPTXLowerArgs is required for correctness and should be run right
367 // before the address space inference passes.
368 if (getNVPTXTargetMachine().getDrvInterface() == NVPTX::CUDA)
371 addPass(createNVPTXLowerArgsPass());
372 if (getOptLevel() != CodeGenOptLevel::None) {
373 addAddressSpaceInferencePasses();
374 addStraightLineScalarOptimizationPasses();
375 }
376
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(/*PreserveCFG=*/true,
399 /*AggregateToVector=*/true));
402 addPass(createNVPTXIRPeepholePass());
403 }
404
405 if (ST.hasPTXASUnreachableBug()) {
406 // Run LowerUnreachable to WAR a ptxas bug. See the commit description of
407 // 1ee4d880e8760256c606fe55b7af85a4f70d006d for more details.
408 const auto &Options = getNVPTXTargetMachine().Options;
409 addPass(createNVPTXLowerUnreachablePass(Options.TrapUnreachable,
410 Options.NoTrapAfterNoreturn));
411 }
412}
413
414bool NVPTXPassConfig::addInstSelector() {
415 addPass(createLowerAggrCopies());
416 addPass(createAllocaHoisting());
417 addPass(createNVPTXISelDag(getNVPTXTargetMachine(), getOptLevel()));
419
420 return false;
421}
422
423void NVPTXPassConfig::addPreRegAlloc() {
425 if (getOptLevel() != CodeGenOptLevel::None)
427 // Remove Proxy Register pseudo instructions used to keep `callseq_end` alive.
429}
430
431void NVPTXPassConfig::addPostRegAlloc() {
433 if (getOptLevel() != CodeGenOptLevel::None) {
434 // NVPTXPrologEpilogPass calculates frame object offset and replace frame
435 // index with VRFrame register. NVPTXPeephole need to be run after that and
436 // will replace VRFrame with VRFrameLocal when possible.
437 addPass(createNVPTXPeephole());
438 }
439}
440
441FunctionPass *NVPTXPassConfig::createTargetRegisterAllocator(bool) {
442 return nullptr; // No reg alloc
443}
444
445void NVPTXPassConfig::addFastRegAlloc() {
446 addPass(&PHIEliminationID);
448}
449
450void NVPTXPassConfig::addOptimizedRegAlloc() {
451 addPass(&ProcessImplicitDefsID);
452 addPass(&LiveVariablesID);
453 addPass(&MachineLoopInfoID);
454 addPass(&PHIEliminationID);
455
457 addPass(&RegisterCoalescerID);
458
459 // PreRA instruction scheduling.
460 if (addPass(&MachineSchedulerID))
461 printAndVerify("After Machine Scheduling");
462
463 addPass(&StackSlotColoringID);
464
465 // FIXME: Needs physical registers
466 // addPass(&MachineLICMID);
467
468 printAndVerify("After StackSlotColoring");
469}
470
471void NVPTXPassConfig::addMachineSSAOptimization() {
472 // Pre-ra tail duplication.
473 if (addPass(&EarlyTailDuplicateLegacyID))
474 printAndVerify("After Pre-RegAlloc TailDuplicate");
475
476 // Optimize PHIs before DCE: removing dead PHI cycles may make more
477 // instructions dead.
478 addPass(&OptimizePHIsLegacyID);
479
480 // This pass merges large allocas. StackSlotColoring is a different pass
481 // which merges spill slots.
482 addPass(&StackColoringLegacyID);
483
484 // If the target requests it, assign local variables to stack slots relative
485 // to one another and simplify frame index references where possible.
487
488 // With optimization, dead code should already be eliminated. However
489 // there is one known exception: lowered code for arguments that are only
490 // used by tail calls, where the tail calls reuse the incoming stack
491 // arguments directly (see t11 in test/CodeGen/X86/sibcall.ll).
493 printAndVerify("After codegen DCE pass");
494
495 // Allow targets to insert passes that improve instruction level parallelism,
496 // like if-conversion. Such passes will typically need dominator trees and
497 // loop info, just like LICM and CSE below.
498 if (addILPOpts())
499 printAndVerify("After ILP optimizations");
500
501 addPass(&EarlyMachineLICMID);
502 addPass(&MachineCSELegacyID);
503
504 addPass(&MachineSinkingLegacyID);
505 printAndVerify("After Machine LICM, CSE and Sinking passes");
506
508 printAndVerify("After codegen peephole optimization pass");
509}
#define X(NUM, ENUM, NAME)
Definition ELF.h:856
#define LLVM_ABI
Definition Compiler.h:215
#define LLVM_EXTERNAL_VISIBILITY
Definition Compiler.h:132
This file provides the interface for LLVM's Global Value Numbering pass which eliminates fully redund...
static LVOptions Options
Definition LVOptions.cpp:25
#define F(x, y, z)
Definition MD5.cpp:54
#define T
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)
static cl::opt< bool > DisableNVPTXIRPeephole("disable-nvptx-ir-peephole", cl::desc("Disable NVPTX IR Peephole"), 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
if(PassOpts->AAPipeline)
PassBuilder PB(Machine, PassOpts->PTO, std::nullopt, &PIC)
const GCNTargetMachine & getTM(const GCNSubtarget *STI)
static TableGen::Emitter::Opt Y("gen-skeleton-entry", EmitSkeleton, "Generate example skeleton entry")
Target-Independent Code Generator Pass Configuration Options pass.
This pass exposes codegen information to IR-level passes.
A manager for alias analyses.
void registerFunctionAnalysis()
Register a specific AA result.
CodeGenTargetMachineImpl(const Target &T, StringRef DataLayoutString, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOptLevel OL)
FunctionPass class - This class is used to implement most global optimizations.
Definition Pass.h:314
const TargetSubtargetInfo * getSubtargetImpl(const Function &) const override
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
Analysis pass providing a never-invalidated alias analysis result.
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.
LLVM_ATTRIBUTE_MINSIZE std::enable_if_t<!std::is_same_v< PassT, PassManager > > addPass(PassT &&Pass)
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
static LLVM_ABI PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
void setRequiresStructuredCFG(bool Value)
std::unique_ptr< const MCSubtargetInfo > STI
TargetOptions Options
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.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
void initializeNVPTXLowerAllocaPass(PassRegistry &)
LLVM_ABI char & EarlyMachineLICMID
This pass performs loop invariant code motion on machine instructions.
FunctionPass * createNVPTXIRPeepholePass()
ModulePass * createNVPTXAssignValidGlobalNamesPass()
void initializeNVPTXPrologEpilogPassPass(PassRegistry &)
MachineFunctionPass * createNVPTXReplaceImageHandlesPass()
FunctionPass * createNVPTXLowerUnreachablePass(bool TrapUnreachable, bool NoTrapAfterNoreturn)
void initializeNVPTXAssignValidGlobalNamesPass(PassRegistry &)
LLVM_ABI char & RegisterCoalescerID
RegisterCoalescer - This pass merges live ranges to eliminate copies.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643
ModuleToFunctionPassAdaptor createModuleToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false)
A function to deduce a function pass type and wrap it in the templated adaptor.
ModulePass * createGenericToNVVMLegacyPass()
void initializeNVPTXLowerAggrCopiesPass(PassRegistry &)
void initializeNVPTXExternalAAWrapperPass(PassRegistry &)
MachineFunctionPass * createNVPTXPrologEpilogPass()
MachineFunctionPass * createNVPTXProxyRegErasurePass()
FunctionPass * createLowerAggrCopies()
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 &)
FunctionPass * createNVPTXSetByValParamAlignPass()
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()
MachineFunctionPass * createNVPTXAddressFolderPass()
LLVM_ABI char & MachineLoopInfoID
MachineLoopInfo - This pass is a loop analysis pass.
void initializeNVVMReflectLegacyPassPass(PassRegistry &)
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 ModulePass * createExpandVariadicsPass(ExpandVariadicsMode)
LLVM_ABI char & ShrinkWrapID
ShrinkWrap pass. Look for the best place to insert save and restore.
LLVM_ABI char & MachineLateInstrsCleanupID
MachineLateInstrsCleanup - This pass removes redundant identical instructions after register allocati...
void initializeNVPTXAAWrapperPassPass(PassRegistry &)
FunctionPass * createNVPTXImageOptimizerPass()
FunctionPass * createNVPTXLowerAllocaPass()
void initializeNVPTXIRPeepholePass(PassRegistry &)
ModulePass * createNVPTXLowerArgsPass()
MachineFunctionPass * createNVPTXForwardParamsPass()
PassManager< Module > ModulePassManager
Convenience typedef for a pass manager over modules.
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...
FunctionPass * createNVPTXMarkKernelPtrsGlobalPass()
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)
LLVM_ABI char & ProcessImplicitDefsID
ProcessImpicitDefs pass - This pass removes IMPLICIT_DEFs.
void initializeNVPTXTagInvariantLoadLegacyPassPass(PassRegistry &)
LLVM_ABI FunctionPass * createGVNPass()
Definition GVN.cpp:4045
FunctionPass * createNVPTXAtomicLowerPass()
ModulePass * createNVPTXCtorDtorLoweringLegacyPass()
LLVM_ABI char & MachineCSELegacyID
MachineCSE - This pass performs global CSE on machine instructions.
void initializeNVPTXMarkKernelPtrsGlobalLegacyPassPass(PassRegistry &)
PassManager< Function > FunctionPassManager
Convenience typedef for a pass manager over functions.
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.
LLVM_ABI FunctionPass * createSROAPass(bool PreserveCFG=true, bool AggregateToVector=false)
Definition SROA.cpp:6413
void initializeNVPTXAllocaHoistingPass(PassRegistry &)
Target & getTheNVPTXTarget64()
void initializeNVPTXSetByValParamAlignLegacyPassPass(PassRegistry &)
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.
void initializeNVPTXAddressFolderPassPass(PassRegistry &)
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()
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Definition Allocator.h:390
LLVM_ABI FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
LLVM_ABI char & PHIEliminationID
PHIElimination - This pass eliminates machine instruction PHI nodes by inserting copy instructions.
LLVM_ABI llvm::cl::opt< bool > NoKernelInfoEndLTO
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:860
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
static FuncInfoTy * create(BumpPtrAllocator &Allocator, const Function &F, const SubtargetTy *STI)
Factory function: default behavior is to call new using the supplied allocator.
RegisterTargetMachine - Helper template for registering a target machine implementation,...