LLVM 24.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 "NVPTXAsmPrinter.h"
24#include "llvm/CodeGen/Passes.h"
26#include "llvm/IR/IntrinsicsNVPTX.h"
28#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// NVPTX IR Peephole is a new pass; this option will lets us turn it off in case
53// we encounter some issues.
54static cl::opt<bool>
55 DisableNVPTXIRPeephole("disable-nvptx-ir-peephole",
56 cl::desc("Disable NVPTX IR Peephole"),
57 cl::init(false), cl::Hidden);
58
59// TODO: Remove this flag when we are confident with no regressions.
61 "disable-nvptx-require-structured-cfg",
62 cl::desc("Transitional flag to turn off NVPTX's requirement on preserving "
63 "structured CFG. The requirement should be disabled only when "
64 "unexpected regressions happen."),
65 cl::init(false), cl::Hidden);
66
67// byval arguments in NVPTX are special. We're only allowed to read from them
68// using a special instruction, and if we ever need to write to them or take an
69// address, we must make a local copy and use it, instead.
70//
71// The problem is that local copies are very expensive, and we create them very
72// late in the compilation pipeline, so LLVM does not have much of a chance to
73// eliminate them, if they turn out to be unnecessary.
74//
75// One way around that is to create such copies early on, and let them percolate
76// through the optimizations. The copying itself will never trigger creation of
77// another copy later on, as the reads are allowed. If LLVM can eliminate it,
78// it's a win. It the full optimization pipeline can't remove the copy, that's
79// as good as it gets in terms of the effort we could've done, and it's
80// certainly a much better effort than what we do now.
81//
82// This early injection of the copies has potential to create undesireable
83// side-effects, so it's disabled by default, for now, until it sees more
84// testing.
86 "nvptx-early-byval-copy",
87 cl::desc("Create a copy of byval function arguments early."),
88 cl::init(false), cl::Hidden);
89
91 // Register the target.
94
96 // FIXME: This pass is really intended to be invoked during IR optimization,
97 // but it's very NVPTX-specific.
122}
123
125 StringRef CPU, StringRef FS,
126 const TargetOptions &Options,
127 std::optional<Reloc::Model> RM,
128 std::optional<CodeModel::Model> CM,
129 CodeGenOptLevel OL, bool JIT)
130 // The pic relocation model is used regardless of what the client has
131 // specified, as it is the only relocation model currently supported.
133 TT.computeDataLayout(Options.MCOptions.ABIName),
134 TT, CPU, FS, Options, Reloc::PIC_,
135 getEffectiveCodeModel(CM, CodeModel::Small), OL),
136 TLOF(std::make_unique<NVPTXTargetObjectFile>()),
137 Subtarget(TT, CPU, FS, *this), StrPool(StrAlloc) {
140 initAsmInfo();
141}
142
144
145namespace {
146
147class NVPTXPassConfig : public TargetPassConfig {
148public:
149 NVPTXPassConfig(NVPTXTargetMachine &TM, PassManagerBase &PM)
150 : TargetPassConfig(TM, PM) {}
151
152 NVPTXTargetMachine &getNVPTXTargetMachine() const {
154 }
155
156 void addIRPasses() override;
157 bool addInstSelector() override;
158 void addPreRegAlloc() override;
159 void addPostRegAlloc() override;
160
161 FunctionPass *createTargetRegisterAllocator(bool) override;
162 void addFastRegAlloc() override;
163 void addOptimizedRegAlloc() override;
164
165 bool addRegAssignAndRewriteFast() override {
166 llvm_unreachable("should not be used");
167 }
168
169 bool addRegAssignAndRewriteOptimized() override {
170 llvm_unreachable("should not be used");
171 }
172
173private:
174 // If the opt level is aggressive, add GVN; otherwise, add EarlyCSE. This
175 // function is only called in opt mode.
176 void addEarlyCSEOrGVNPass();
177
178 // Add passes that propagate special memory spaces.
179 void addAddressSpaceInferencePasses();
180
181 // Add passes that perform straight-line scalar optimizations.
182 void addStraightLineScalarOptimizationPasses();
183};
184
185} // end anonymous namespace
186
188 return new NVPTXPassConfig(*this, PM);
189}
190
197
201
203#define GET_PASS_REGISTRY "NVPTXPassRegistry.def"
205
206 PB.registerPipelineStartEPCallback(
207 [this](ModulePassManager &PM, OptimizationLevel Level) {
208 // We do not want to fold out calls to nvvm.reflect early if the user
209 // has not provided a target architecture just yet.
210 if (Subtarget.hasTargetName())
211 PM.addPass(NVVMReflectPass(Subtarget.getSmVersion()));
212
214 // Note: NVVMIntrRangePass was causing numerical discrepancies at one
215 // point, if issues crop up, consider disabling.
219 PM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
220 });
221
222 if (!NoKernelInfoEndLTO) {
223 PB.registerFullLinkTimeOptimizationLastEPCallback(
224 [this](ModulePassManager &PM, OptimizationLevel Level) {
226 FPM.addPass(KernelInfoPrinter(this));
227 PM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
228 });
229 }
230}
231
234 return TargetTransformInfo(std::make_unique<NVPTXTTIImpl>(this, F));
235}
236
237std::pair<const Value *, unsigned>
239 if (auto *II = dyn_cast<IntrinsicInst>(V)) {
240 switch (II->getIntrinsicID()) {
241 case Intrinsic::nvvm_isspacep_const:
242 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_CONST);
243 case Intrinsic::nvvm_isspacep_global:
244 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_GLOBAL);
245 case Intrinsic::nvvm_isspacep_local:
246 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_LOCAL);
247 case Intrinsic::nvvm_isspacep_shared:
248 return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_SHARED);
249 case Intrinsic::nvvm_isspacep_shared_cluster:
250 return std::make_pair(II->getArgOperand(0),
252 default:
253 break;
254 }
255 }
256 return std::make_pair(nullptr, -1);
257}
258
259void NVPTXPassConfig::addEarlyCSEOrGVNPass() {
260 if (getOptLevel() == CodeGenOptLevel::Aggressive)
261 // Disable scalar PRE due to Register Pressure increase
262 addPass(createGVNPass(/*ScalarPRE=*/false));
263 else
264 addPass(createEarlyCSEPass());
265}
266
267void NVPTXPassConfig::addAddressSpaceInferencePasses() {
268 // NVPTXLowerArgs emits alloca for byval parameters which can often
269 // be eliminated by SROA.
270 addPass(createSROAPass(/*PreserveCFG=*/true,
271 /*AggregateToVector=*/true));
273 // TODO: Consider running InferAddressSpaces during opt, earlier in the
274 // compilation flow.
277}
278
279void NVPTXPassConfig::addStraightLineScalarOptimizationPasses() {
282 // ReassociateGEPs exposes more opportunites for SLSR. See
283 // the example in reassociate-geps-and-slsr.ll.
285 // SeparateConstOffsetFromGEP and SLSR creates common expressions which GVN or
286 // EarlyCSE can reuse. GVN generates significantly better code than EarlyCSE
287 // for some of our benchmarks.
288 addEarlyCSEOrGVNPass();
289 // Run NaryReassociate after EarlyCSE/GVN to be more effective.
290 addPass(createNaryReassociatePass());
291 // NaryReassociate on GEPs creates redundant common expressions, so run
292 // EarlyCSE after it.
293 addPass(createEarlyCSEPass());
294}
295
296void NVPTXPassConfig::addIRPasses() {
297 // The following passes are known to not play well with virtual regs hanging
298 // around after register allocation (which in our case, is *all* registers).
299 // We explicitly disable them here. We do, however, need some functionality
300 // of the PrologEpilogCodeInserter pass, so we emulate that behavior in the
301 // NVPTXPrologEpilog pass (see NVPTXPrologEpilogPass.cpp).
302 disablePass(&PrologEpilogCodeInserterID);
303 disablePass(&MachineLateInstrsCleanupID);
304 disablePass(&MachineCopyPropagationID);
305 disablePass(&TailDuplicateLegacyID);
306 disablePass(&StackMapLivenessID);
307 disablePass(&PostRAMachineSinkingID);
308 disablePass(&PostRASchedulerID);
309 disablePass(&FuncletLayoutID);
310 disablePass(&PatchableFunctionID);
311 disablePass(&ShrinkWrapID);
312 disablePass(&RemoveLoadsIntoFakeUsesID);
313
314 addPass(createNVPTXAAWrapperPass());
316
317 // NVVMReflectPass is added in addEarlyAsPossiblePasses, so hopefully running
318 // it here does nothing. But since we need it for correctness when lowering
319 // to NVPTX, run it here too, in case whoever built our pass pipeline didn't
320 // call addEarlyAsPossiblePasses.
322 addPass(createNVVMReflectPass(ST.getSmVersion()));
323
324 if (getOptLevel() != CodeGenOptLevel::None)
328
329 // Lower variadic calls before address space inference.
331
332 // NVPTXLowerArgs is required for correctness and should be run right
333 // before the address space inference passes.
334 if (getNVPTXTargetMachine().getDrvInterface() == NVPTX::CUDA)
337 addPass(createNVPTXLowerArgsPass());
338 if (getOptLevel() != CodeGenOptLevel::None) {
339 addAddressSpaceInferencePasses();
340 addStraightLineScalarOptimizationPasses();
341 } else {
342 // Required for correct stack lowering
344 }
345
348
349 // === LSR and other generic IR passes ===
351 // EarlyCSE is not always strong enough to clean up what LSR produces. For
352 // example, GVN can combine
353 //
354 // %0 = add %a, %b
355 // %1 = add %b, %a
356 //
357 // and
358 //
359 // %0 = shl nsw %a, 2
360 // %1 = shl %a, 2
361 //
362 // but EarlyCSE can do neither of them.
363 if (getOptLevel() != CodeGenOptLevel::None) {
364 addEarlyCSEOrGVNPass();
367 addPass(createSROAPass(/*PreserveCFG=*/true,
368 /*AggregateToVector=*/true));
371 addPass(createNVPTXIRPeepholePass());
372 }
373
374 if (ST.hasPTXASUnreachableBug()) {
375 // Run LowerUnreachable to WAR a ptxas bug. See the commit description of
376 // 1ee4d880e8760256c606fe55b7af85a4f70d006d for more details.
377 const auto &Options = getNVPTXTargetMachine().Options;
378 addPass(createNVPTXLowerUnreachableLegacyPass(Options.TrapUnreachable,
379 Options.NoTrapAfterNoreturn));
380 }
381}
382
383bool NVPTXPassConfig::addInstSelector() {
386 addPass(createNVPTXISelDag(getNVPTXTargetMachine(), getOptLevel()));
388
389 return false;
390}
391
392void NVPTXPassConfig::addPreRegAlloc() {
394 if (getOptLevel() != CodeGenOptLevel::None)
396 // Remove Proxy Register pseudo instructions used to keep `callseq_end` alive.
398}
399
400void NVPTXPassConfig::addPostRegAlloc() {
402 if (getOptLevel() != CodeGenOptLevel::None) {
403 // NVPTXPrologEpilogPass calculates frame object offset and replace frame
404 // index with VRFrame register. NVPTXPeephole need to be run after that and
405 // will replace VRFrame with VRFrameLocal when possible.
407 }
408}
409
410FunctionPass *NVPTXPassConfig::createTargetRegisterAllocator(bool) {
411 return nullptr; // No reg alloc
412}
413
414void NVPTXPassConfig::addFastRegAlloc() {
415 addPass(&PHIEliminationID);
417}
418
419void NVPTXPassConfig::addOptimizedRegAlloc() {
420 addPass(&ProcessImplicitDefsID);
421 addPass(&LiveVariablesID);
422 addPass(&MachineLoopInfoID);
423 addPass(&PHIEliminationID);
424
426 addPass(&RegisterCoalescerID);
427
428 // PreRA instruction scheduling.
429 if (addPass(&MachineSchedulerID))
430 printAndVerify("After Machine Scheduling");
431
432 addPass(&StackSlotColoringID);
433
434 // FIXME: Needs physical registers
435 // addPass(&MachineLICMID);
436
437 printAndVerify("After StackSlotColoring");
438}
#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 > 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
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.
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 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
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:48
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.
FunctionPass * createNVPTXLowerUnreachableLegacyPass(bool TrapUnreachable, bool NoTrapAfterNoreturn)
FunctionPass * createNVPTXIRPeepholePass()
FunctionPass * createNVPTXAtomicLowerLegacyPass()
FunctionPass * createNVPTXImageOptimizerLegacyPass()
void initializeNVPTXLowerUnreachableLegacyPassPass(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 initializeNVPTXExternalAAWrapperPass(PassRegistry &)
void initializeNVPTXPeepholeLegacyPassPass(PassRegistry &)
void initializeNVPTXPrologEpilogLegacyPassPass(PassRegistry &)
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 * createNVPTXReplaceImageHandlesLegacyPass()
void initializeNVPTXForwardParamsLegacyPassPass(PassRegistry &)
FunctionPass * createNVPTXLowerAggrCopiesLegacyPass()
ModulePass * createNVPTXAssignValidGlobalNamesLegacyPass()
LLVM_ABI char & MachineSchedulerID
MachineScheduler - This pass schedules machine instructions.
void initializeNVPTXAssignValidGlobalNamesLegacyPassPass(PassRegistry &)
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...
MachineFunctionPass * createNVPTXAddressFolderLegacyPass()
void initializeNVPTXLowerAllocaLegacyPassPass(PassRegistry &)
void initializeGenericToNVVMLegacyPassPass(PassRegistry &)
void initializeNVPTXCtorDtorLoweringLegacyPass(PassRegistry &)
MachineFunctionPass * createNVPTXForwardParamsLegacyPass()
FunctionPass * createNVPTXTagInvariantLoadsPass()
LLVM_ABI char & MachineLoopInfoID
MachineLoopInfo - This pass is a loop analysis pass.
void initializeNVVMReflectLegacyPassPass(PassRegistry &)
void initializeNVPTXAddressFolderLegacyPassPass(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 &)
void initializeNVPTXIRPeepholePass(PassRegistry &)
ModulePass * createNVPTXLowerArgsPass()
PassManager< Module > ModulePassManager
Convenience typedef for a pass manager over modules.
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.
void initializeNVVMIntrRangePass(PassRegistry &)
MachineFunctionPass * createNVPTXPrologEpilogLegacyPass()
LLVM_ABI char & PostRAMachineSinkingID
This pass perform post-ra machine sink for COPY instructions.
CodeGenOptLevel
Code generation optimization level.
Definition CodeGen.h:149
void initializeNVPTXLowerAggrCopiesLegacyPassPass(PassRegistry &)
LLVM_ABI char & StackSlotColoringID
StackSlotColoring - This pass performs stack slot coloring.
ModulePass * createNVPTXPromoteParamAlignPass()
void initializeNVPTXAsmPrinterPass(PassRegistry &)
LLVM_ABI FunctionPass * createSeparateConstOffsetFromGEPPass(bool LowerGEP=false)
void initializeNVPTXProxyRegErasureLegacyPassPass(PassRegistry &)
LLVM_ABI char & ProcessImplicitDefsID
ProcessImpicitDefs pass - This pass removes IMPLICIT_DEFs.
void initializeNVPTXTagInvariantLoadLegacyPassPass(PassRegistry &)
void initializeNVPTXAtomicLowerLegacyPassPass(PassRegistry &)
MachineFunctionPass * createNVPTXPeepholeLegacyPass()
LLVM_ABI FunctionPass * createGVNPass()
Definition GVN.cpp:4065
FunctionPass * createNVPTXLowerAllocaLegacyPass()
ModulePass * createNVPTXCtorDtorLoweringLegacyPass()
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 FunctionPass * createSROAPass(bool PreserveCFG=true, bool AggregateToVector=false)
Definition SROA.cpp:6408
Target & getTheNVPTXTarget64()
LLVM_ABI FunctionPass * createInferAddressSpacesPass(unsigned AddressSpace=~0u)
void initializeNVPTXAllocaHoistingLegacyPassPass(PassRegistry &)
ImmutablePass * createNVPTXAAWrapperPass()
FunctionPass * createNVPTXAllocaHoistingLegacyPass()
ModulePass * createNVVMReflectPass(unsigned int SmVersion)
LLVM_ABI char & TwoAddressInstructionPassID
TwoAddressInstruction - This pass reduces two-address instructions to use two operands.
void initializeNVPTXPromoteParamAlignLegacyPassPass(PassRegistry &)
LLVM_ABI FunctionPass * createAtomicExpandLegacyPass()
AtomicExpandPass - At IR level this pass replace atomic instructions with __atomic_* library calls,...
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
MachineFunctionPass * createNVPTXProxyRegErasureLegacyPass()
LLVM_ABI char & MachineCopyPropagationID
MachineCopyPropagation - This pass performs copy propagation on machine instructions.
Target & getTheNVPTXTarget32()
void initializeNVPTXDAGToDAGISelLegacyPass(PassRegistry &)
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:878
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,...