LLVM API Documentation
00001 //===-- Passes.h - Target independent code generation passes ----*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file defines interfaces to access the target independent code generation 00011 // passes provided by the LLVM backend. 00012 // 00013 //===----------------------------------------------------------------------===// 00014 00015 #ifndef LLVM_CODEGEN_PASSES_H 00016 #define LLVM_CODEGEN_PASSES_H 00017 00018 #include "llvm/Pass.h" 00019 #include "llvm/Target/TargetMachine.h" 00020 #include <string> 00021 00022 namespace llvm { 00023 00024 class FunctionPass; 00025 class MachineFunctionPass; 00026 class PassConfigImpl; 00027 class PassInfo; 00028 class ScheduleDAGInstrs; 00029 class TargetLowering; 00030 class TargetLoweringBase; 00031 class TargetRegisterClass; 00032 class raw_ostream; 00033 struct MachineSchedContext; 00034 00035 // The old pass manager infrastructure is hidden in a legacy namespace now. 00036 namespace legacy { 00037 class PassManagerBase; 00038 } 00039 using legacy::PassManagerBase; 00040 00041 /// Discriminated union of Pass ID types. 00042 /// 00043 /// The PassConfig API prefers dealing with IDs because they are safer and more 00044 /// efficient. IDs decouple configuration from instantiation. This way, when a 00045 /// pass is overriden, it isn't unnecessarily instantiated. It is also unsafe to 00046 /// refer to a Pass pointer after adding it to a pass manager, which deletes 00047 /// redundant pass instances. 00048 /// 00049 /// However, it is convient to directly instantiate target passes with 00050 /// non-default ctors. These often don't have a registered PassInfo. Rather than 00051 /// force all target passes to implement the pass registry boilerplate, allow 00052 /// the PassConfig API to handle either type. 00053 /// 00054 /// AnalysisID is sadly char*, so PointerIntPair won't work. 00055 class IdentifyingPassPtr { 00056 union { 00057 AnalysisID ID; 00058 Pass *P; 00059 }; 00060 bool IsInstance; 00061 public: 00062 IdentifyingPassPtr() : P(nullptr), IsInstance(false) {} 00063 IdentifyingPassPtr(AnalysisID IDPtr) : ID(IDPtr), IsInstance(false) {} 00064 IdentifyingPassPtr(Pass *InstancePtr) : P(InstancePtr), IsInstance(true) {} 00065 00066 bool isValid() const { return P; } 00067 bool isInstance() const { return IsInstance; } 00068 00069 AnalysisID getID() const { 00070 assert(!IsInstance && "Not a Pass ID"); 00071 return ID; 00072 } 00073 Pass *getInstance() const { 00074 assert(IsInstance && "Not a Pass Instance"); 00075 return P; 00076 } 00077 }; 00078 00079 template <> struct isPodLike<IdentifyingPassPtr> { 00080 static const bool value = true; 00081 }; 00082 00083 /// Target-Independent Code Generator Pass Configuration Options. 00084 /// 00085 /// This is an ImmutablePass solely for the purpose of exposing CodeGen options 00086 /// to the internals of other CodeGen passes. 00087 class TargetPassConfig : public ImmutablePass { 00088 public: 00089 /// Pseudo Pass IDs. These are defined within TargetPassConfig because they 00090 /// are unregistered pass IDs. They are only useful for use with 00091 /// TargetPassConfig APIs to identify multiple occurrences of the same pass. 00092 /// 00093 00094 /// EarlyTailDuplicate - A clone of the TailDuplicate pass that runs early 00095 /// during codegen, on SSA form. 00096 static char EarlyTailDuplicateID; 00097 00098 /// PostRAMachineLICM - A clone of the LICM pass that runs during late machine 00099 /// optimization after regalloc. 00100 static char PostRAMachineLICMID; 00101 00102 private: 00103 PassManagerBase *PM; 00104 AnalysisID StartAfter; 00105 AnalysisID StopAfter; 00106 bool Started; 00107 bool Stopped; 00108 00109 protected: 00110 TargetMachine *TM; 00111 PassConfigImpl *Impl; // Internal data structures 00112 bool Initialized; // Flagged after all passes are configured. 00113 00114 // Target Pass Options 00115 // Targets provide a default setting, user flags override. 00116 // 00117 bool DisableVerify; 00118 00119 /// Default setting for -enable-tail-merge on this target. 00120 bool EnableTailMerge; 00121 00122 public: 00123 TargetPassConfig(TargetMachine *tm, PassManagerBase &pm); 00124 // Dummy constructor. 00125 TargetPassConfig(); 00126 00127 virtual ~TargetPassConfig(); 00128 00129 static char ID; 00130 00131 /// Get the right type of TargetMachine for this target. 00132 template<typename TMC> TMC &getTM() const { 00133 return *static_cast<TMC*>(TM); 00134 } 00135 00136 // 00137 void setInitialized() { Initialized = true; } 00138 00139 CodeGenOpt::Level getOptLevel() const { return TM->getOptLevel(); } 00140 00141 /// setStartStopPasses - Set the StartAfter and StopAfter passes to allow 00142 /// running only a portion of the normal code-gen pass sequence. If the 00143 /// Start pass ID is zero, then compilation will begin at the normal point; 00144 /// otherwise, clear the Started flag to indicate that passes should not be 00145 /// added until the starting pass is seen. If the Stop pass ID is zero, 00146 /// then compilation will continue to the end. 00147 void setStartStopPasses(AnalysisID Start, AnalysisID Stop) { 00148 StartAfter = Start; 00149 StopAfter = Stop; 00150 Started = (StartAfter == nullptr); 00151 } 00152 00153 void setDisableVerify(bool Disable) { setOpt(DisableVerify, Disable); } 00154 00155 bool getEnableTailMerge() const { return EnableTailMerge; } 00156 void setEnableTailMerge(bool Enable) { setOpt(EnableTailMerge, Enable); } 00157 00158 /// Allow the target to override a specific pass without overriding the pass 00159 /// pipeline. When passes are added to the standard pipeline at the 00160 /// point where StandardID is expected, add TargetID in its place. 00161 void substitutePass(AnalysisID StandardID, IdentifyingPassPtr TargetID); 00162 00163 /// Insert InsertedPassID pass after TargetPassID pass. 00164 void insertPass(AnalysisID TargetPassID, IdentifyingPassPtr InsertedPassID); 00165 00166 /// Allow the target to enable a specific standard pass by default. 00167 void enablePass(AnalysisID PassID) { substitutePass(PassID, PassID); } 00168 00169 /// Allow the target to disable a specific standard pass by default. 00170 void disablePass(AnalysisID PassID) { 00171 substitutePass(PassID, IdentifyingPassPtr()); 00172 } 00173 00174 /// Return the pass substituted for StandardID by the target. 00175 /// If no substitution exists, return StandardID. 00176 IdentifyingPassPtr getPassSubstitution(AnalysisID StandardID) const; 00177 00178 /// Return true if the optimized regalloc pipeline is enabled. 00179 bool getOptimizeRegAlloc() const; 00180 00181 /// Add common target configurable passes that perform LLVM IR to IR 00182 /// transforms following machine independent optimization. 00183 virtual void addIRPasses(); 00184 00185 /// Add passes to lower exception handling for the code generator. 00186 void addPassesToHandleExceptions(); 00187 00188 /// Add pass to prepare the LLVM IR for code generation. This should be done 00189 /// before exception handling preparation passes. 00190 virtual void addCodeGenPrepare(); 00191 00192 /// Add common passes that perform LLVM IR to IR transforms in preparation for 00193 /// instruction selection. 00194 virtual void addISelPrepare(); 00195 00196 /// addInstSelector - This method should install an instruction selector pass, 00197 /// which converts from LLVM code to machine instructions. 00198 virtual bool addInstSelector() { 00199 return true; 00200 } 00201 00202 /// Add the complete, standard set of LLVM CodeGen passes. 00203 /// Fully developed targets will not generally override this. 00204 virtual void addMachinePasses(); 00205 00206 /// Create an instance of ScheduleDAGInstrs to be run within the standard 00207 /// MachineScheduler pass for this function and target at the current 00208 /// optimization level. 00209 /// 00210 /// This can also be used to plug a new MachineSchedStrategy into an instance 00211 /// of the standard ScheduleDAGMI: 00212 /// return new ScheduleDAGMI(C, new MyStrategy(C)) 00213 /// 00214 /// Return NULL to select the default (generic) machine scheduler. 00215 virtual ScheduleDAGInstrs * 00216 createMachineScheduler(MachineSchedContext *C) const { 00217 return nullptr; 00218 } 00219 00220 /// Similar to createMachineScheduler but used when postRA machine scheduling 00221 /// is enabled. 00222 virtual ScheduleDAGInstrs * 00223 createPostMachineScheduler(MachineSchedContext *C) const { 00224 return nullptr; 00225 } 00226 00227 protected: 00228 // Helper to verify the analysis is really immutable. 00229 void setOpt(bool &Opt, bool Val); 00230 00231 /// Methods with trivial inline returns are convenient points in the common 00232 /// codegen pass pipeline where targets may insert passes. Methods with 00233 /// out-of-line standard implementations are major CodeGen stages called by 00234 /// addMachinePasses. Some targets may override major stages when inserting 00235 /// passes is insufficient, but maintaining overriden stages is more work. 00236 /// 00237 00238 /// addPreISelPasses - This method should add any "last minute" LLVM->LLVM 00239 /// passes (which are run just before instruction selector). 00240 virtual bool addPreISel() { 00241 return true; 00242 } 00243 00244 /// addMachineSSAOptimization - Add standard passes that optimize machine 00245 /// instructions in SSA form. 00246 virtual void addMachineSSAOptimization(); 00247 00248 /// Add passes that optimize instruction level parallelism for out-of-order 00249 /// targets. These passes are run while the machine code is still in SSA 00250 /// form, so they can use MachineTraceMetrics to control their heuristics. 00251 /// 00252 /// All passes added here should preserve the MachineDominatorTree, 00253 /// MachineLoopInfo, and MachineTraceMetrics analyses. 00254 virtual bool addILPOpts() { 00255 return false; 00256 } 00257 00258 /// addPreRegAlloc - This method may be implemented by targets that want to 00259 /// run passes immediately before register allocation. This should return 00260 /// true if -print-machineinstrs should print after these passes. 00261 virtual bool addPreRegAlloc() { 00262 return false; 00263 } 00264 00265 /// createTargetRegisterAllocator - Create the register allocator pass for 00266 /// this target at the current optimization level. 00267 virtual FunctionPass *createTargetRegisterAllocator(bool Optimized); 00268 00269 /// addFastRegAlloc - Add the minimum set of target-independent passes that 00270 /// are required for fast register allocation. 00271 virtual void addFastRegAlloc(FunctionPass *RegAllocPass); 00272 00273 /// addOptimizedRegAlloc - Add passes related to register allocation. 00274 /// LLVMTargetMachine provides standard regalloc passes for most targets. 00275 virtual void addOptimizedRegAlloc(FunctionPass *RegAllocPass); 00276 00277 /// addPreRewrite - Add passes to the optimized register allocation pipeline 00278 /// after register allocation is complete, but before virtual registers are 00279 /// rewritten to physical registers. 00280 /// 00281 /// These passes must preserve VirtRegMap and LiveIntervals, and when running 00282 /// after RABasic or RAGreedy, they should take advantage of LiveRegMatrix. 00283 /// When these passes run, VirtRegMap contains legal physreg assignments for 00284 /// all virtual registers. 00285 virtual bool addPreRewrite() { 00286 return false; 00287 } 00288 00289 /// addPostRegAlloc - This method may be implemented by targets that want to 00290 /// run passes after register allocation pass pipeline but before 00291 /// prolog-epilog insertion. This should return true if -print-machineinstrs 00292 /// should print after these passes. 00293 virtual bool addPostRegAlloc() { 00294 return false; 00295 } 00296 00297 /// Add passes that optimize machine instructions after register allocation. 00298 virtual void addMachineLateOptimization(); 00299 00300 /// addPreSched2 - This method may be implemented by targets that want to 00301 /// run passes after prolog-epilog insertion and before the second instruction 00302 /// scheduling pass. This should return true if -print-machineinstrs should 00303 /// print after these passes. 00304 virtual bool addPreSched2() { 00305 return false; 00306 } 00307 00308 /// addGCPasses - Add late codegen passes that analyze code for garbage 00309 /// collection. This should return true if GC info should be printed after 00310 /// these passes. 00311 virtual bool addGCPasses(); 00312 00313 /// Add standard basic block placement passes. 00314 virtual void addBlockPlacement(); 00315 00316 /// addPreEmitPass - This pass may be implemented by targets that want to run 00317 /// passes immediately before machine code is emitted. This should return 00318 /// true if -print-machineinstrs should print out the code after the passes. 00319 virtual bool addPreEmitPass() { 00320 return false; 00321 } 00322 00323 /// Utilities for targets to add passes to the pass manager. 00324 /// 00325 00326 /// Add a CodeGen pass at this point in the pipeline after checking overrides. 00327 /// Return the pass that was added, or zero if no pass was added. 00328 AnalysisID addPass(AnalysisID PassID); 00329 00330 /// Add a pass to the PassManager if that pass is supposed to be run, as 00331 /// determined by the StartAfter and StopAfter options. Takes ownership of the 00332 /// pass. 00333 void addPass(Pass *P); 00334 00335 /// addMachinePasses helper to create the target-selected or overriden 00336 /// regalloc pass. 00337 FunctionPass *createRegAllocPass(bool Optimized); 00338 00339 /// printAndVerify - Add a pass to dump then verify the machine function, if 00340 /// those steps are enabled. 00341 /// 00342 void printAndVerify(const char *Banner); 00343 }; 00344 } // namespace llvm 00345 00346 /// List of target independent CodeGen pass IDs. 00347 namespace llvm { 00348 FunctionPass *createAtomicExpandPass(const TargetMachine *TM); 00349 00350 /// \brief Create a basic TargetTransformInfo analysis pass. 00351 /// 00352 /// This pass implements the target transform info analysis using the target 00353 /// independent information available to the LLVM code generator. 00354 ImmutablePass * 00355 createBasicTargetTransformInfoPass(const TargetMachine *TM); 00356 00357 /// createUnreachableBlockEliminationPass - The LLVM code generator does not 00358 /// work well with unreachable basic blocks (what live ranges make sense for a 00359 /// block that cannot be reached?). As such, a code generator should either 00360 /// not instruction select unreachable blocks, or run this pass as its 00361 /// last LLVM modifying pass to clean up blocks that are not reachable from 00362 /// the entry block. 00363 FunctionPass *createUnreachableBlockEliminationPass(); 00364 00365 /// MachineFunctionPrinter pass - This pass prints out the machine function to 00366 /// the given stream as a debugging tool. 00367 MachineFunctionPass * 00368 createMachineFunctionPrinterPass(raw_ostream &OS, 00369 const std::string &Banner =""); 00370 00371 /// createCodeGenPreparePass - Transform the code to expose more pattern 00372 /// matching during instruction selection. 00373 FunctionPass *createCodeGenPreparePass(const TargetMachine *TM = nullptr); 00374 00375 /// AtomicExpandID -- Lowers atomic operations in terms of either cmpxchg 00376 /// load-linked/store-conditional loops. 00377 extern char &AtomicExpandID; 00378 00379 /// MachineLoopInfo - This pass is a loop analysis pass. 00380 extern char &MachineLoopInfoID; 00381 00382 /// MachineDominators - This pass is a machine dominators analysis pass. 00383 extern char &MachineDominatorsID; 00384 00385 /// MachineDominanaceFrontier - This pass is a machine dominators analysis pass. 00386 extern char &MachineDominanceFrontierID; 00387 00388 /// EdgeBundles analysis - Bundle machine CFG edges. 00389 extern char &EdgeBundlesID; 00390 00391 /// LiveVariables pass - This pass computes the set of blocks in which each 00392 /// variable is life and sets machine operand kill flags. 00393 extern char &LiveVariablesID; 00394 00395 /// PHIElimination - This pass eliminates machine instruction PHI nodes 00396 /// by inserting copy instructions. This destroys SSA information, but is the 00397 /// desired input for some register allocators. This pass is "required" by 00398 /// these register allocator like this: AU.addRequiredID(PHIEliminationID); 00399 extern char &PHIEliminationID; 00400 00401 /// LiveIntervals - This analysis keeps track of the live ranges of virtual 00402 /// and physical registers. 00403 extern char &LiveIntervalsID; 00404 00405 /// LiveStacks pass. An analysis keeping track of the liveness of stack slots. 00406 extern char &LiveStacksID; 00407 00408 /// TwoAddressInstruction - This pass reduces two-address instructions to 00409 /// use two operands. This destroys SSA information but it is desired by 00410 /// register allocators. 00411 extern char &TwoAddressInstructionPassID; 00412 00413 /// ProcessImpicitDefs pass - This pass removes IMPLICIT_DEFs. 00414 extern char &ProcessImplicitDefsID; 00415 00416 /// RegisterCoalescer - This pass merges live ranges to eliminate copies. 00417 extern char &RegisterCoalescerID; 00418 00419 /// MachineScheduler - This pass schedules machine instructions. 00420 extern char &MachineSchedulerID; 00421 00422 /// PostMachineScheduler - This pass schedules machine instructions postRA. 00423 extern char &PostMachineSchedulerID; 00424 00425 /// SpillPlacement analysis. Suggest optimal placement of spill code between 00426 /// basic blocks. 00427 extern char &SpillPlacementID; 00428 00429 /// VirtRegRewriter pass. Rewrite virtual registers to physical registers as 00430 /// assigned in VirtRegMap. 00431 extern char &VirtRegRewriterID; 00432 00433 /// UnreachableMachineBlockElimination - This pass removes unreachable 00434 /// machine basic blocks. 00435 extern char &UnreachableMachineBlockElimID; 00436 00437 /// DeadMachineInstructionElim - This pass removes dead machine instructions. 00438 extern char &DeadMachineInstructionElimID; 00439 00440 /// FastRegisterAllocation Pass - This pass register allocates as fast as 00441 /// possible. It is best suited for debug code where live ranges are short. 00442 /// 00443 FunctionPass *createFastRegisterAllocator(); 00444 00445 /// BasicRegisterAllocation Pass - This pass implements a degenerate global 00446 /// register allocator using the basic regalloc framework. 00447 /// 00448 FunctionPass *createBasicRegisterAllocator(); 00449 00450 /// Greedy register allocation pass - This pass implements a global register 00451 /// allocator for optimized builds. 00452 /// 00453 FunctionPass *createGreedyRegisterAllocator(); 00454 00455 /// PBQPRegisterAllocation Pass - This pass implements the Partitioned Boolean 00456 /// Quadratic Prograaming (PBQP) based register allocator. 00457 /// 00458 FunctionPass *createDefaultPBQPRegisterAllocator(); 00459 00460 /// PrologEpilogCodeInserter - This pass inserts prolog and epilog code, 00461 /// and eliminates abstract frame references. 00462 extern char &PrologEpilogCodeInserterID; 00463 00464 /// ExpandPostRAPseudos - This pass expands pseudo instructions after 00465 /// register allocation. 00466 extern char &ExpandPostRAPseudosID; 00467 00468 /// createPostRAScheduler - This pass performs post register allocation 00469 /// scheduling. 00470 extern char &PostRASchedulerID; 00471 00472 /// BranchFolding - This pass performs machine code CFG based 00473 /// optimizations to delete branches to branches, eliminate branches to 00474 /// successor blocks (creating fall throughs), and eliminating branches over 00475 /// branches. 00476 extern char &BranchFolderPassID; 00477 00478 /// MachineFunctionPrinterPass - This pass prints out MachineInstr's. 00479 extern char &MachineFunctionPrinterPassID; 00480 00481 /// TailDuplicate - Duplicate blocks with unconditional branches 00482 /// into tails of their predecessors. 00483 extern char &TailDuplicateID; 00484 00485 /// MachineTraceMetrics - This pass computes critical path and CPU resource 00486 /// usage in an ensemble of traces. 00487 extern char &MachineTraceMetricsID; 00488 00489 /// EarlyIfConverter - This pass performs if-conversion on SSA form by 00490 /// inserting cmov instructions. 00491 extern char &EarlyIfConverterID; 00492 00493 /// This pass performs instruction combining using trace metrics to estimate 00494 /// critical-path and resource depth. 00495 extern char &MachineCombinerID; 00496 00497 /// StackSlotColoring - This pass performs stack coloring and merging. 00498 /// It merges disjoint allocas to reduce the stack size. 00499 extern char &StackColoringID; 00500 00501 /// IfConverter - This pass performs machine code if conversion. 00502 extern char &IfConverterID; 00503 00504 /// MachineBlockPlacement - This pass places basic blocks based on branch 00505 /// probabilities. 00506 extern char &MachineBlockPlacementID; 00507 00508 /// MachineBlockPlacementStats - This pass collects statistics about the 00509 /// basic block placement using branch probabilities and block frequency 00510 /// information. 00511 extern char &MachineBlockPlacementStatsID; 00512 00513 /// GCLowering Pass - Performs target-independent LLVM IR transformations for 00514 /// highly portable strategies. 00515 /// 00516 FunctionPass *createGCLoweringPass(); 00517 00518 /// GCMachineCodeAnalysis - Target-independent pass to mark safe points 00519 /// in machine code. Must be added very late during code generation, just 00520 /// prior to output, and importantly after all CFG transformations (such as 00521 /// branch folding). 00522 extern char &GCMachineCodeAnalysisID; 00523 00524 /// Creates a pass to print GC metadata. 00525 /// 00526 FunctionPass *createGCInfoPrinter(raw_ostream &OS); 00527 00528 /// MachineCSE - This pass performs global CSE on machine instructions. 00529 extern char &MachineCSEID; 00530 00531 /// MachineLICM - This pass performs LICM on machine instructions. 00532 extern char &MachineLICMID; 00533 00534 /// MachineSinking - This pass performs sinking on machine instructions. 00535 extern char &MachineSinkingID; 00536 00537 /// MachineCopyPropagation - This pass performs copy propagation on 00538 /// machine instructions. 00539 extern char &MachineCopyPropagationID; 00540 00541 /// PeepholeOptimizer - This pass performs peephole optimizations - 00542 /// like extension and comparison eliminations. 00543 extern char &PeepholeOptimizerID; 00544 00545 /// OptimizePHIs - This pass optimizes machine instruction PHIs 00546 /// to take advantage of opportunities created during DAG legalization. 00547 extern char &OptimizePHIsID; 00548 00549 /// StackSlotColoring - This pass performs stack slot coloring. 00550 extern char &StackSlotColoringID; 00551 00552 /// createStackProtectorPass - This pass adds stack protectors to functions. 00553 /// 00554 FunctionPass *createStackProtectorPass(const TargetMachine *TM); 00555 00556 /// createMachineVerifierPass - This pass verifies cenerated machine code 00557 /// instructions for correctness. 00558 /// 00559 FunctionPass *createMachineVerifierPass(const char *Banner = nullptr); 00560 00561 /// createDwarfEHPass - This pass mulches exception handling code into a form 00562 /// adapted to code generation. Required if using dwarf exception handling. 00563 FunctionPass *createDwarfEHPass(const TargetMachine *TM); 00564 00565 /// createSjLjEHPreparePass - This pass adapts exception handling code to use 00566 /// the GCC-style builtin setjmp/longjmp (sjlj) to handling EH control flow. 00567 /// 00568 FunctionPass *createSjLjEHPreparePass(const TargetMachine *TM); 00569 00570 /// LocalStackSlotAllocation - This pass assigns local frame indices to stack 00571 /// slots relative to one another and allocates base registers to access them 00572 /// when it is estimated by the target to be out of range of normal frame 00573 /// pointer or stack pointer index addressing. 00574 extern char &LocalStackSlotAllocationID; 00575 00576 /// ExpandISelPseudos - This pass expands pseudo-instructions. 00577 extern char &ExpandISelPseudosID; 00578 00579 /// createExecutionDependencyFixPass - This pass fixes execution time 00580 /// problems with dependent instructions, such as switching execution 00581 /// domains to match. 00582 /// 00583 /// The pass will examine instructions using and defining registers in RC. 00584 /// 00585 FunctionPass *createExecutionDependencyFixPass(const TargetRegisterClass *RC); 00586 00587 /// UnpackMachineBundles - This pass unpack machine instruction bundles. 00588 extern char &UnpackMachineBundlesID; 00589 00590 /// FinalizeMachineBundles - This pass finalize machine instruction 00591 /// bundles (created earlier, e.g. during pre-RA scheduling). 00592 extern char &FinalizeMachineBundlesID; 00593 00594 /// StackMapLiveness - This pass analyses the register live-out set of 00595 /// stackmap/patchpoint intrinsics and attaches the calculated information to 00596 /// the intrinsic for later emission to the StackMap. 00597 extern char &StackMapLivenessID; 00598 00599 /// createJumpInstrTables - This pass creates jump-instruction tables. 00600 ModulePass *createJumpInstrTablesPass(); 00601 } // End llvm namespace 00602 00603 /// This initializer registers TargetMachine constructor, so the pass being 00604 /// initialized can use target dependent interfaces. Please do not move this 00605 /// macro to be together with INITIALIZE_PASS, which is a complete target 00606 /// independent initializer, and we don't want to make libScalarOpts depend 00607 /// on libCodeGen. 00608 #define INITIALIZE_TM_PASS(passName, arg, name, cfg, analysis) \ 00609 static void* initialize##passName##PassOnce(PassRegistry &Registry) { \ 00610 PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \ 00611 PassInfo::NormalCtor_t(callDefaultCtor< passName >), cfg, analysis, \ 00612 PassInfo::TargetMachineCtor_t(callTargetMachineCtor< passName >)); \ 00613 Registry.registerPass(*PI, true); \ 00614 return PI; \ 00615 } \ 00616 void llvm::initialize##passName##Pass(PassRegistry &Registry) { \ 00617 CALL_ONCE_INITIALIZATION(initialize##passName##PassOnce) \ 00618 } 00619 00620 #endif