44 cl::desc(
"Disable load/store vectorizer"),
49 "disable-nvptx-require-structured-cfg",
50 cl::desc(
"Transitional flag to turn off NVPTX's requirement on preserving " 51 "structured CFG. The requirement should be disabled only when " 52 "unexpected regressions happen."),
58 "Use 32-bit pointers for accessing const/local/shared address spaces."),
93 std::string
Ret =
"e";
97 else if (UseShortPointers)
98 Ret +=
"-p3:32:32-p4:32:32-p5:32:32";
100 Ret +=
"-i64:64-i128:128-v16:16-v32:32-n16:32:64";
120 CPU, FS, Options, Reloc::
PIC_,
124 Subtarget(TT, CPU, FS, *this) {
136 void NVPTXTargetMachine32::anchor() {}
146 void NVPTXTargetMachine64::anchor() {}
164 return getTM<NVPTXTargetMachine>();
167 void addIRPasses()
override;
168 bool addInstSelector()
override;
169 void addPostRegAlloc()
override;
170 void addMachineSSAOptimization()
override;
172 FunctionPass *createTargetRegisterAllocator(
bool)
override;
173 void addFastRegAlloc(
FunctionPass *RegAllocPass)
override;
174 void addOptimizedRegAlloc(
FunctionPass *RegAllocPass)
override;
179 void addEarlyCSEOrGVNPass();
182 void addAddressSpaceInferencePasses();
185 void addStraightLineScalarOptimizationPasses();
191 return new NVPTXPassConfig(*
this, PM);
208 void NVPTXPassConfig::addEarlyCSEOrGVNPass() {
215 void NVPTXPassConfig::addAddressSpaceInferencePasses() {
223 void NVPTXPassConfig::addStraightLineScalarOptimizationPasses() {
232 addEarlyCSEOrGVNPass();
240 void NVPTXPassConfig::addIRPasses() {
272 addAddressSpaceInferencePasses();
275 addStraightLineScalarOptimizationPasses();
293 addEarlyCSEOrGVNPass();
296 bool NVPTXPassConfig::addInstSelector() {
309 void NVPTXPassConfig::addPostRegAlloc() {
319 FunctionPass *NVPTXPassConfig::createTargetRegisterAllocator(
bool) {
323 void NVPTXPassConfig::addFastRegAlloc(
FunctionPass *RegAllocPass) {
324 assert(!RegAllocPass &&
"NVPTX uses no regalloc!");
329 void NVPTXPassConfig::addOptimizedRegAlloc(
FunctionPass *RegAllocPass) {
330 assert(!RegAllocPass &&
"NVPTX uses no regalloc!");
342 printAndVerify(
"After Machine Scheduling");
350 printAndVerify(
"After StackSlotColoring");
353 void NVPTXPassConfig::addMachineSSAOptimization() {
356 printAndVerify(
"After Pre-RegAlloc TailDuplicate");
375 printAndVerify(
"After codegen DCE pass");
381 printAndVerify(
"After ILP optimizations");
387 printAndVerify(
"After Machine LICM, CSE and Sinking passes");
390 printAndVerify(
"After codegen peephole optimization pass");
FunctionPass * createSpeculativeExecutionPass()
FunctionPass * createStraightLineStrengthReducePass()
FunctionPass * createGVNPass(bool NoLoads=false)
Create a legacy GVN pass.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
void initializeNVPTXLowerArgsPass(PassRegistry &)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
PassManagerBuilder - This class is used to set up a standard optimization sequence for languages like...
Compute iterated dominance frontiers using a linear time algorithm.
void LLVMInitializeNVPTXTarget()
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
FunctionPass * createNVVMReflectPass()
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
ModulePass * createNVPTXAssignValidGlobalNamesPass()
char & FuncletLayoutID
This pass lays out funclets contiguously.
FunctionPass * createAllocaHoisting()
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)
char & RegisterCoalescerID
RegisterCoalescer - This pass merges live ranges to eliminate copies.
virtual void add(Pass *P)=0
Add a pass to the queue of passes to run.
MachineFunctionPass * createNVPTXPrologEpilogPass()
char & MachineSchedulerID
MachineScheduler - This pass schedules machine instructions.
block Block Frequency true
std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type make_unique(Args &&... args)
Constructs a new T() with the given args and returns a unique_ptr<T> which owns the object...
ModulePass * createGenericToNVVMPass()
char & ProcessImplicitDefsID
ProcessImpicitDefs pass - This pass removes IMPLICIT_DEFs.
void initializeNVPTXAssignValidGlobalNamesPass(PassRegistry &)
NVPTXTargetMachine64(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM, CodeGenOpt::Level OL, bool JIT)
bool hasImageHandles() const
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
char & MachineLoopInfoID
MachineLoopInfo - This pass is a loop analysis pass.
char & StackColoringID
StackSlotColoring - This pass performs stack coloring and merging.
Target-Independent Code Generator Pass Configuration Options.
Target & getTheNVPTXTarget64()
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)
char & EarlyTailDuplicateID
Duplicate blocks with unconditional branches into tails of their predecessors.
RegisterTargetMachine - Helper template for registering a target machine implementation, for use in the target machine initialization function.
char & MachineCSEID
MachineCSE - This pass performs global CSE on machine instructions.
char & StackSlotColoringID
StackSlotColoring - This pass performs stack slot coloring.
char & DeadMachineInstructionElimID
DeadMachineInstructionElim - This pass removes dead machine instructions.
Pass * createLoadStoreVectorizerPass()
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
FunctionPass * createNVPTXImageOptimizerPass()
void initializeNVVMIntrRangePass(PassRegistry &)
static CodeModel::Model getEffectiveCodeModel(Optional< CodeModel::Model > CM)
TargetTransformInfo getTargetTransformInfo(const Function &F) override
Get a TargetTransformInfo implementation for the target.
char & PHIEliminationID
PHIElimination - This pass eliminates machine instruction PHI nodes by inserting copy instructions...
Target & getTheNVPTXTarget32()
char & LiveVariablesID
LiveVariables pass - This pass computes the set of blocks in which each variable is life and sets mac...
initializer< Ty > init(const Ty &Val)
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
static std::string computeDataLayout(bool is64Bit, bool UseShortPointers)
void initializeNVPTXLowerAggrCopiesPass(PassRegistry &)
void initializeNVVMReflectPass(PassRegistry &)
NVPTXTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM, CodeGenOpt::Level OP, bool is64bit)
This file provides the interface for LLVM's Global Value Numbering pass which eliminates fully redund...
static bool is64Bit(const char *name)
MachineFunctionPass * createNVPTXReplaceImageHandlesPass()
char & PostRAMachineSinkingID
This pass perform post-ra machine sink for COPY instructions.
char & LiveDebugValuesID
LiveDebugValues pass.
This class describes a target machine that is implemented with the LLVM target-independent code gener...
FunctionPass class - This class is used to implement most global optimizations.
void initializeNVPTXAllocaHoistingPass(PassRegistry &)
char & MachineCopyPropagationID
MachineCopyPropagation - This pass performs copy propagation on machine instructions.
char & TwoAddressInstructionPassID
TwoAddressInstruction - This pass reduces two-address instructions to use two operands.
void initializeGenericToNVVMPass(PassRegistry &)
EP_EarlyAsPossible - This extension point allows adding passes before any other transformations, allowing them to see the code as it is coming out of the frontend.
Triple - Helper class for working with autoconf configuration names.
char & PostRASchedulerID
createPostRAScheduler - This pass performs post register allocation scheduling.
void initializeNVPTXLowerAllocaPass(PassRegistry &)
NVPTXTargetMachine32(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM, CodeGenOpt::Level OL, bool JIT)
BasicBlockPass * createNVPTXLowerAllocaPass()
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
char & StackMapLivenessID
StackMapLiveness - This pass analyses the register live-out set of stackmap/patchpoint intrinsics and...
char & TailDuplicateID
TailDuplicate - Duplicate blocks with unconditional branches into tails of their predecessors.
char & MachineSinkingID
MachineSinking - This pass performs sinking on machine instructions.
void setRequiresStructuredCFG(bool Value)
char & EarlyMachineLICMID
This pass performs loop invariant code motion on machine instructions.
char & OptimizePHIsID
OptimizePHIs - This pass optimizes machine instruction PHIs to take advantage of opportunities create...
FunctionPass * createSeparateConstOffsetFromGEPPass(bool LowerGEP=false)
Target - Wrapper for Target specific information.
char & PeepholeOptimizerID
PeepholeOptimizer - This pass performs peephole optimizations - like extension and comparison elimina...
char & PrologEpilogCodeInserterID
PrologEpilogCodeInserter - This pass inserts prolog and epilog code, and eliminates abstract frame re...
char & PatchableFunctionID
This pass implements the "patchable-function" attribute.
FunctionPass * createInferAddressSpacesPass()
MachineFunctionPass * createNVPTXPeephole()
FunctionPass * createNVPTXISelDag(NVPTXTargetMachine &TM, llvm::CodeGenOpt::Level OptLevel)
createNVPTXISelDag - This pass converts a legalized DAG into a NVPTX-specific DAG, ready for instruction scheduling.
~NVPTXTargetMachine() override
FunctionPass * createNVVMIntrRangePass(unsigned int SmVersion)
FunctionPass * createNVPTXLowerArgsPass(const NVPTXTargetMachine *TM)
FunctionPass * createLowerAggrCopies()
void adjustPassManager(PassManagerBuilder &) override
Allow the target to modify the pass manager, e.g.
FunctionPass * createSROAPass()
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const NVPTXSubtarget * getSubtargetImpl() const
FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
static cl::opt< bool > DisableLoadStoreVectorizer("disable-nvptx-load-store-vectorizer", cl::desc("Disable load/store vectorizer"), cl::init(false), cl::Hidden)
char & ShrinkWrapID
ShrinkWrap pass. Look for the best place to insert save and restore.
StringRef - Represent a constant reference to a string, i.e.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
void addExtension(ExtensionPointTy Ty, ExtensionFn Fn)
char & LocalStackSlotAllocationID
LocalStackSlotAllocation - This pass assigns local frame indices to stack slots relative to one anoth...
FunctionPass * createNaryReassociatePass()