[ShrinkWrap] Add (a simplified version) of shrink-wrapping.
[oota-llvm.git] / include / llvm / CodeGen / Passes.h
1 //===-- Passes.h - Target independent code generation passes ----*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines interfaces to access the target independent code generation
11 // passes provided by the LLVM backend.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CODEGEN_PASSES_H
16 #define LLVM_CODEGEN_PASSES_H
17
18 #include "llvm/Pass.h"
19 #include "llvm/Target/TargetMachine.h"
20 #include <string>
21
22 namespace llvm {
23
24 class FunctionPass;
25 class MachineFunctionPass;
26 class PassConfigImpl;
27 class PassInfo;
28 class ScheduleDAGInstrs;
29 class TargetLowering;
30 class TargetLoweringBase;
31 class TargetRegisterClass;
32 class raw_ostream;
33 struct MachineSchedContext;
34
35 // The old pass manager infrastructure is hidden in a legacy namespace now.
36 namespace legacy {
37 class PassManagerBase;
38 }
39 using legacy::PassManagerBase;
40
41 /// Discriminated union of Pass ID types.
42 ///
43 /// The PassConfig API prefers dealing with IDs because they are safer and more
44 /// efficient. IDs decouple configuration from instantiation. This way, when a
45 /// pass is overriden, it isn't unnecessarily instantiated. It is also unsafe to
46 /// refer to a Pass pointer after adding it to a pass manager, which deletes
47 /// redundant pass instances.
48 ///
49 /// However, it is convient to directly instantiate target passes with
50 /// non-default ctors. These often don't have a registered PassInfo. Rather than
51 /// force all target passes to implement the pass registry boilerplate, allow
52 /// the PassConfig API to handle either type.
53 ///
54 /// AnalysisID is sadly char*, so PointerIntPair won't work.
55 class IdentifyingPassPtr {
56   union {
57     AnalysisID ID;
58     Pass *P;
59   };
60   bool IsInstance;
61 public:
62   IdentifyingPassPtr() : P(nullptr), IsInstance(false) {}
63   IdentifyingPassPtr(AnalysisID IDPtr) : ID(IDPtr), IsInstance(false) {}
64   IdentifyingPassPtr(Pass *InstancePtr) : P(InstancePtr), IsInstance(true) {}
65
66   bool isValid() const { return P; }
67   bool isInstance() const { return IsInstance; }
68
69   AnalysisID getID() const {
70     assert(!IsInstance && "Not a Pass ID");
71     return ID;
72   }
73   Pass *getInstance() const {
74     assert(IsInstance && "Not a Pass Instance");
75     return P;
76   }
77 };
78
79 template <> struct isPodLike<IdentifyingPassPtr> {
80   static const bool value = true;
81 };
82
83 /// Target-Independent Code Generator Pass Configuration Options.
84 ///
85 /// This is an ImmutablePass solely for the purpose of exposing CodeGen options
86 /// to the internals of other CodeGen passes.
87 class TargetPassConfig : public ImmutablePass {
88 public:
89   /// Pseudo Pass IDs. These are defined within TargetPassConfig because they
90   /// are unregistered pass IDs. They are only useful for use with
91   /// TargetPassConfig APIs to identify multiple occurrences of the same pass.
92   ///
93
94   /// EarlyTailDuplicate - A clone of the TailDuplicate pass that runs early
95   /// during codegen, on SSA form.
96   static char EarlyTailDuplicateID;
97
98   /// PostRAMachineLICM - A clone of the LICM pass that runs during late machine
99   /// optimization after regalloc.
100   static char PostRAMachineLICMID;
101
102 private:
103   PassManagerBase *PM;
104   AnalysisID StartAfter;
105   AnalysisID StopAfter;
106   bool Started;
107   bool Stopped;
108   bool AddingMachinePasses;
109
110 protected:
111   TargetMachine *TM;
112   PassConfigImpl *Impl; // Internal data structures
113   bool Initialized;     // Flagged after all passes are configured.
114
115   // Target Pass Options
116   // Targets provide a default setting, user flags override.
117   //
118   bool DisableVerify;
119
120   /// Default setting for -enable-tail-merge on this target.
121   bool EnableTailMerge;
122
123   /// Default setting for -enable-shrink-wrap on this target.
124   bool EnableShrinkWrap;
125
126 public:
127   TargetPassConfig(TargetMachine *tm, PassManagerBase &pm);
128   // Dummy constructor.
129   TargetPassConfig();
130
131   ~TargetPassConfig() override;
132
133   static char ID;
134
135   /// Get the right type of TargetMachine for this target.
136   template<typename TMC> TMC &getTM() const {
137     return *static_cast<TMC*>(TM);
138   }
139
140   //
141   void setInitialized() { Initialized = true; }
142
143   CodeGenOpt::Level getOptLevel() const { return TM->getOptLevel(); }
144
145   /// setStartStopPasses - Set the StartAfter and StopAfter passes to allow
146   /// running only a portion of the normal code-gen pass sequence.  If the
147   /// Start pass ID is zero, then compilation will begin at the normal point;
148   /// otherwise, clear the Started flag to indicate that passes should not be
149   /// added until the starting pass is seen.  If the Stop pass ID is zero,
150   /// then compilation will continue to the end.
151   void setStartStopPasses(AnalysisID Start, AnalysisID Stop) {
152     StartAfter = Start;
153     StopAfter = Stop;
154     Started = (StartAfter == nullptr);
155   }
156
157   void setDisableVerify(bool Disable) { setOpt(DisableVerify, Disable); }
158
159   bool getEnableTailMerge() const { return EnableTailMerge; }
160   void setEnableTailMerge(bool Enable) { setOpt(EnableTailMerge, Enable); }
161
162   /// Allow the target to override a specific pass without overriding the pass
163   /// pipeline. When passes are added to the standard pipeline at the
164   /// point where StandardID is expected, add TargetID in its place.
165   void substitutePass(AnalysisID StandardID, IdentifyingPassPtr TargetID);
166
167   /// Insert InsertedPassID pass after TargetPassID pass.
168   void insertPass(AnalysisID TargetPassID, IdentifyingPassPtr InsertedPassID);
169
170   /// Allow the target to enable a specific standard pass by default.
171   void enablePass(AnalysisID PassID) { substitutePass(PassID, PassID); }
172
173   /// Allow the target to disable a specific standard pass by default.
174   void disablePass(AnalysisID PassID) {
175     substitutePass(PassID, IdentifyingPassPtr());
176   }
177
178   /// Return the pass substituted for StandardID by the target.
179   /// If no substitution exists, return StandardID.
180   IdentifyingPassPtr getPassSubstitution(AnalysisID StandardID) const;
181
182   /// Return true if the optimized regalloc pipeline is enabled.
183   bool getOptimizeRegAlloc() const;
184
185   /// Return true if shrink wrapping is enabled.
186   bool getEnableShrinkWrap() const;
187
188   /// Return true if the default global register allocator is in use and
189   /// has not be overriden on the command line with '-regalloc=...'
190   bool usingDefaultRegAlloc() const;
191
192   /// Add common target configurable passes that perform LLVM IR to IR
193   /// transforms following machine independent optimization.
194   virtual void addIRPasses();
195
196   /// Add passes to lower exception handling for the code generator.
197   void addPassesToHandleExceptions();
198
199   /// Add pass to prepare the LLVM IR for code generation. This should be done
200   /// before exception handling preparation passes.
201   virtual void addCodeGenPrepare();
202
203   /// Add common passes that perform LLVM IR to IR transforms in preparation for
204   /// instruction selection.
205   virtual void addISelPrepare();
206
207   /// addInstSelector - This method should install an instruction selector pass,
208   /// which converts from LLVM code to machine instructions.
209   virtual bool addInstSelector() {
210     return true;
211   }
212
213   /// Add the complete, standard set of LLVM CodeGen passes.
214   /// Fully developed targets will not generally override this.
215   virtual void addMachinePasses();
216
217   /// Create an instance of ScheduleDAGInstrs to be run within the standard
218   /// MachineScheduler pass for this function and target at the current
219   /// optimization level.
220   ///
221   /// This can also be used to plug a new MachineSchedStrategy into an instance
222   /// of the standard ScheduleDAGMI:
223   ///   return new ScheduleDAGMI(C, make_unique<MyStrategy>(C), /* IsPostRA= */false)
224   ///
225   /// Return NULL to select the default (generic) machine scheduler.
226   virtual ScheduleDAGInstrs *
227   createMachineScheduler(MachineSchedContext *C) const {
228     return nullptr;
229   }
230
231   /// Similar to createMachineScheduler but used when postRA machine scheduling
232   /// is enabled.
233   virtual ScheduleDAGInstrs *
234   createPostMachineScheduler(MachineSchedContext *C) const {
235     return nullptr;
236   }
237
238 protected:
239   // Helper to verify the analysis is really immutable.
240   void setOpt(bool &Opt, bool Val);
241
242   /// Methods with trivial inline returns are convenient points in the common
243   /// codegen pass pipeline where targets may insert passes. Methods with
244   /// out-of-line standard implementations are major CodeGen stages called by
245   /// addMachinePasses. Some targets may override major stages when inserting
246   /// passes is insufficient, but maintaining overriden stages is more work.
247   ///
248
249   /// addPreISelPasses - This method should add any "last minute" LLVM->LLVM
250   /// passes (which are run just before instruction selector).
251   virtual bool addPreISel() {
252     return true;
253   }
254
255   /// addMachineSSAOptimization - Add standard passes that optimize machine
256   /// instructions in SSA form.
257   virtual void addMachineSSAOptimization();
258
259   /// Add passes that optimize instruction level parallelism for out-of-order
260   /// targets. These passes are run while the machine code is still in SSA
261   /// form, so they can use MachineTraceMetrics to control their heuristics.
262   ///
263   /// All passes added here should preserve the MachineDominatorTree,
264   /// MachineLoopInfo, and MachineTraceMetrics analyses.
265   virtual bool addILPOpts() {
266     return false;
267   }
268
269   /// This method may be implemented by targets that want to run passes
270   /// immediately before register allocation.
271   virtual void addPreRegAlloc() { }
272
273   /// createTargetRegisterAllocator - Create the register allocator pass for
274   /// this target at the current optimization level.
275   virtual FunctionPass *createTargetRegisterAllocator(bool Optimized);
276
277   /// addFastRegAlloc - Add the minimum set of target-independent passes that
278   /// are required for fast register allocation.
279   virtual void addFastRegAlloc(FunctionPass *RegAllocPass);
280
281   /// addOptimizedRegAlloc - Add passes related to register allocation.
282   /// LLVMTargetMachine provides standard regalloc passes for most targets.
283   virtual void addOptimizedRegAlloc(FunctionPass *RegAllocPass);
284
285   /// addPreRewrite - Add passes to the optimized register allocation pipeline
286   /// after register allocation is complete, but before virtual registers are
287   /// rewritten to physical registers.
288   ///
289   /// These passes must preserve VirtRegMap and LiveIntervals, and when running
290   /// after RABasic or RAGreedy, they should take advantage of LiveRegMatrix.
291   /// When these passes run, VirtRegMap contains legal physreg assignments for
292   /// all virtual registers.
293   virtual bool addPreRewrite() {
294     return false;
295   }
296
297   /// This method may be implemented by targets that want to run passes after
298   /// register allocation pass pipeline but before prolog-epilog insertion.
299   virtual void addPostRegAlloc() { }
300
301   /// Add passes that optimize machine instructions after register allocation.
302   virtual void addMachineLateOptimization();
303
304   /// This method may be implemented by targets that want to run passes after
305   /// prolog-epilog insertion and before the second instruction scheduling pass.
306   virtual void addPreSched2() { }
307
308   /// addGCPasses - Add late codegen passes that analyze code for garbage
309   /// collection. This should return true if GC info should be printed after
310   /// these passes.
311   virtual bool addGCPasses();
312
313   /// Add standard basic block placement passes.
314   virtual void addBlockPlacement();
315
316   /// This pass may be implemented by targets that want to run passes
317   /// immediately before machine code is emitted.
318   virtual void addPreEmitPass() { }
319
320   /// Utilities for targets to add passes to the pass manager.
321   ///
322
323   /// Add a CodeGen pass at this point in the pipeline after checking overrides.
324   /// Return the pass that was added, or zero if no pass was added.
325   /// @p printAfter    if true and adding a machine function pass add an extra
326   ///                  machine printer pass afterwards
327   /// @p verifyAfter   if true and adding a machine function pass add an extra
328   ///                  machine verification pass afterwards.
329   AnalysisID addPass(AnalysisID PassID, bool verifyAfter = true,
330                      bool printAfter = true);
331
332   /// Add a pass to the PassManager if that pass is supposed to be run, as
333   /// determined by the StartAfter and StopAfter options. Takes ownership of the
334   /// pass.
335   /// @p printAfter    if true and adding a machine function pass add an extra
336   ///                  machine printer pass afterwards
337   /// @p verifyAfter   if true and adding a machine function pass add an extra
338   ///                  machine verification pass afterwards.
339   void addPass(Pass *P, bool verifyAfter = true, bool printAfter = true);
340
341   /// addMachinePasses helper to create the target-selected or overriden
342   /// regalloc pass.
343   FunctionPass *createRegAllocPass(bool Optimized);
344
345   /// printAndVerify - Add a pass to dump then verify the machine function, if
346   /// those steps are enabled.
347   ///
348   void printAndVerify(const std::string &Banner);
349
350   /// Add a pass to print the machine function if printing is enabled.
351   void addPrintPass(const std::string &Banner);
352
353   /// Add a pass to perform basic verification of the machine function if
354   /// verification is enabled.
355   void addVerifyPass(const std::string &Banner);
356 };
357 } // namespace llvm
358
359 /// List of target independent CodeGen pass IDs.
360 namespace llvm {
361   FunctionPass *createAtomicExpandPass(const TargetMachine *TM);
362
363   /// createUnreachableBlockEliminationPass - The LLVM code generator does not
364   /// work well with unreachable basic blocks (what live ranges make sense for a
365   /// block that cannot be reached?).  As such, a code generator should either
366   /// not instruction select unreachable blocks, or run this pass as its
367   /// last LLVM modifying pass to clean up blocks that are not reachable from
368   /// the entry block.
369   FunctionPass *createUnreachableBlockEliminationPass();
370
371   /// MachineFunctionPrinter pass - This pass prints out the machine function to
372   /// the given stream as a debugging tool.
373   MachineFunctionPass *
374   createMachineFunctionPrinterPass(raw_ostream &OS,
375                                    const std::string &Banner ="");
376
377   /// createCodeGenPreparePass - Transform the code to expose more pattern
378   /// matching during instruction selection.
379   FunctionPass *createCodeGenPreparePass(const TargetMachine *TM = nullptr);
380
381   /// AtomicExpandID -- Lowers atomic operations in terms of either cmpxchg
382   /// load-linked/store-conditional loops.
383   extern char &AtomicExpandID;
384
385   /// MachineLoopInfo - This pass is a loop analysis pass.
386   extern char &MachineLoopInfoID;
387
388   /// MachineDominators - This pass is a machine dominators analysis pass.
389   extern char &MachineDominatorsID;
390
391 /// MachineDominanaceFrontier - This pass is a machine dominators analysis pass.
392   extern char &MachineDominanceFrontierID;
393
394   /// EdgeBundles analysis - Bundle machine CFG edges.
395   extern char &EdgeBundlesID;
396
397   /// LiveVariables pass - This pass computes the set of blocks in which each
398   /// variable is life and sets machine operand kill flags.
399   extern char &LiveVariablesID;
400
401   /// PHIElimination - This pass eliminates machine instruction PHI nodes
402   /// by inserting copy instructions.  This destroys SSA information, but is the
403   /// desired input for some register allocators.  This pass is "required" by
404   /// these register allocator like this: AU.addRequiredID(PHIEliminationID);
405   extern char &PHIEliminationID;
406
407   /// LiveIntervals - This analysis keeps track of the live ranges of virtual
408   /// and physical registers.
409   extern char &LiveIntervalsID;
410
411   /// LiveStacks pass. An analysis keeping track of the liveness of stack slots.
412   extern char &LiveStacksID;
413
414   /// TwoAddressInstruction - This pass reduces two-address instructions to
415   /// use two operands. This destroys SSA information but it is desired by
416   /// register allocators.
417   extern char &TwoAddressInstructionPassID;
418
419   /// ProcessImpicitDefs pass - This pass removes IMPLICIT_DEFs.
420   extern char &ProcessImplicitDefsID;
421
422   /// RegisterCoalescer - This pass merges live ranges to eliminate copies.
423   extern char &RegisterCoalescerID;
424
425   /// MachineScheduler - This pass schedules machine instructions.
426   extern char &MachineSchedulerID;
427
428   /// PostMachineScheduler - This pass schedules machine instructions postRA.
429   extern char &PostMachineSchedulerID;
430
431   /// SpillPlacement analysis. Suggest optimal placement of spill code between
432   /// basic blocks.
433   extern char &SpillPlacementID;
434
435   /// ShrinkWrap pass. Look for the best place to insert save and restore
436   // instruction and update the MachineFunctionInfo with that information.
437   extern char &ShrinkWrapID;
438
439   /// VirtRegRewriter pass. Rewrite virtual registers to physical registers as
440   /// assigned in VirtRegMap.
441   extern char &VirtRegRewriterID;
442
443   /// UnreachableMachineBlockElimination - This pass removes unreachable
444   /// machine basic blocks.
445   extern char &UnreachableMachineBlockElimID;
446
447   /// DeadMachineInstructionElim - This pass removes dead machine instructions.
448   extern char &DeadMachineInstructionElimID;
449
450   /// FastRegisterAllocation Pass - This pass register allocates as fast as
451   /// possible. It is best suited for debug code where live ranges are short.
452   ///
453   FunctionPass *createFastRegisterAllocator();
454
455   /// BasicRegisterAllocation Pass - This pass implements a degenerate global
456   /// register allocator using the basic regalloc framework.
457   ///
458   FunctionPass *createBasicRegisterAllocator();
459
460   /// Greedy register allocation pass - This pass implements a global register
461   /// allocator for optimized builds.
462   ///
463   FunctionPass *createGreedyRegisterAllocator();
464
465   /// PBQPRegisterAllocation Pass - This pass implements the Partitioned Boolean
466   /// Quadratic Prograaming (PBQP) based register allocator.
467   ///
468   FunctionPass *createDefaultPBQPRegisterAllocator();
469
470   /// PrologEpilogCodeInserter - This pass inserts prolog and epilog code,
471   /// and eliminates abstract frame references.
472   extern char &PrologEpilogCodeInserterID;
473
474   /// ExpandPostRAPseudos - This pass expands pseudo instructions after
475   /// register allocation.
476   extern char &ExpandPostRAPseudosID;
477
478   /// createPostRAScheduler - This pass performs post register allocation
479   /// scheduling.
480   extern char &PostRASchedulerID;
481
482   /// BranchFolding - This pass performs machine code CFG based
483   /// optimizations to delete branches to branches, eliminate branches to
484   /// successor blocks (creating fall throughs), and eliminating branches over
485   /// branches.
486   extern char &BranchFolderPassID;
487
488   /// MachineFunctionPrinterPass - This pass prints out MachineInstr's.
489   extern char &MachineFunctionPrinterPassID;
490
491   /// TailDuplicate - Duplicate blocks with unconditional branches
492   /// into tails of their predecessors.
493   extern char &TailDuplicateID;
494
495   /// MachineTraceMetrics - This pass computes critical path and CPU resource
496   /// usage in an ensemble of traces.
497   extern char &MachineTraceMetricsID;
498
499   /// EarlyIfConverter - This pass performs if-conversion on SSA form by
500   /// inserting cmov instructions.
501   extern char &EarlyIfConverterID;
502
503   /// This pass performs instruction combining using trace metrics to estimate
504   /// critical-path and resource depth.
505   extern char &MachineCombinerID;
506
507   /// StackSlotColoring - This pass performs stack coloring and merging.
508   /// It merges disjoint allocas to reduce the stack size.
509   extern char &StackColoringID;
510
511   /// IfConverter - This pass performs machine code if conversion.
512   extern char &IfConverterID;
513
514   /// MachineBlockPlacement - This pass places basic blocks based on branch
515   /// probabilities.
516   extern char &MachineBlockPlacementID;
517
518   /// MachineBlockPlacementStats - This pass collects statistics about the
519   /// basic block placement using branch probabilities and block frequency
520   /// information.
521   extern char &MachineBlockPlacementStatsID;
522
523   /// GCLowering Pass - Used by gc.root to perform its default lowering
524   /// operations.
525   FunctionPass *createGCLoweringPass();
526
527   /// ShadowStackGCLowering - Implements the custom lowering mechanism
528   /// used by the shadow stack GC.  Only runs on functions which opt in to
529   /// the shadow stack collector.
530   FunctionPass *createShadowStackGCLoweringPass();
531
532   /// GCMachineCodeAnalysis - Target-independent pass to mark safe points
533   /// in machine code. Must be added very late during code generation, just
534   /// prior to output, and importantly after all CFG transformations (such as
535   /// branch folding).
536   extern char &GCMachineCodeAnalysisID;
537
538   /// Creates a pass to print GC metadata.
539   ///
540   FunctionPass *createGCInfoPrinter(raw_ostream &OS);
541
542   /// MachineCSE - This pass performs global CSE on machine instructions.
543   extern char &MachineCSEID;
544
545   /// MachineLICM - This pass performs LICM on machine instructions.
546   extern char &MachineLICMID;
547
548   /// MachineSinking - This pass performs sinking on machine instructions.
549   extern char &MachineSinkingID;
550
551   /// MachineCopyPropagation - This pass performs copy propagation on
552   /// machine instructions.
553   extern char &MachineCopyPropagationID;
554
555   /// PeepholeOptimizer - This pass performs peephole optimizations -
556   /// like extension and comparison eliminations.
557   extern char &PeepholeOptimizerID;
558
559   /// OptimizePHIs - This pass optimizes machine instruction PHIs
560   /// to take advantage of opportunities created during DAG legalization.
561   extern char &OptimizePHIsID;
562
563   /// StackSlotColoring - This pass performs stack slot coloring.
564   extern char &StackSlotColoringID;
565
566   /// createStackProtectorPass - This pass adds stack protectors to functions.
567   ///
568   FunctionPass *createStackProtectorPass(const TargetMachine *TM);
569
570   /// createMachineVerifierPass - This pass verifies cenerated machine code
571   /// instructions for correctness.
572   ///
573   FunctionPass *createMachineVerifierPass(const std::string& Banner);
574
575   /// createDwarfEHPass - This pass mulches exception handling code into a form
576   /// adapted to code generation.  Required if using dwarf exception handling.
577   FunctionPass *createDwarfEHPass(const TargetMachine *TM);
578
579   /// createWinEHPass - Prepares personality functions used by MSVC on Windows,
580   /// in addition to the Itanium LSDA based personalities.
581   FunctionPass *createWinEHPass(const TargetMachine *TM);
582
583   /// createSjLjEHPreparePass - This pass adapts exception handling code to use
584   /// the GCC-style builtin setjmp/longjmp (sjlj) to handling EH control flow.
585   ///
586   FunctionPass *createSjLjEHPreparePass(const TargetMachine *TM);
587
588   /// LocalStackSlotAllocation - This pass assigns local frame indices to stack
589   /// slots relative to one another and allocates base registers to access them
590   /// when it is estimated by the target to be out of range of normal frame
591   /// pointer or stack pointer index addressing.
592   extern char &LocalStackSlotAllocationID;
593
594   /// ExpandISelPseudos - This pass expands pseudo-instructions.
595   extern char &ExpandISelPseudosID;
596
597   /// createExecutionDependencyFixPass - This pass fixes execution time
598   /// problems with dependent instructions, such as switching execution
599   /// domains to match.
600   ///
601   /// The pass will examine instructions using and defining registers in RC.
602   ///
603   FunctionPass *createExecutionDependencyFixPass(const TargetRegisterClass *RC);
604
605   /// UnpackMachineBundles - This pass unpack machine instruction bundles.
606   extern char &UnpackMachineBundlesID;
607
608   /// FinalizeMachineBundles - This pass finalize machine instruction
609   /// bundles (created earlier, e.g. during pre-RA scheduling).
610   extern char &FinalizeMachineBundlesID;
611
612   /// StackMapLiveness - This pass analyses the register live-out set of
613   /// stackmap/patchpoint intrinsics and attaches the calculated information to
614   /// the intrinsic for later emission to the StackMap.
615   extern char &StackMapLivenessID;
616
617   /// createJumpInstrTables - This pass creates jump-instruction tables.
618   ModulePass *createJumpInstrTablesPass();
619
620   /// createForwardControlFlowIntegrityPass - This pass adds control-flow
621   /// integrity.
622   ModulePass *createForwardControlFlowIntegrityPass();
623 } // End llvm namespace
624
625 /// Target machine pass initializer for passes with dependencies. Use with
626 /// INITIALIZE_TM_PASS_END.
627 #define INITIALIZE_TM_PASS_BEGIN INITIALIZE_PASS_BEGIN
628
629 /// Target machine pass initializer for passes with dependencies. Use with
630 /// INITIALIZE_TM_PASS_BEGIN.
631 #define INITIALIZE_TM_PASS_END(passName, arg, name, cfg, analysis) \
632     PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \
633       PassInfo::NormalCtor_t(callDefaultCtor< passName >), cfg, analysis, \
634       PassInfo::TargetMachineCtor_t(callTargetMachineCtor< passName >)); \
635     Registry.registerPass(*PI, true); \
636     return PI; \
637   } \
638   void llvm::initialize##passName##Pass(PassRegistry &Registry) { \
639     CALL_ONCE_INITIALIZATION(initialize##passName##PassOnce) \
640   }
641
642 /// This initializer registers TargetMachine constructor, so the pass being
643 /// initialized can use target dependent interfaces. Please do not move this
644 /// macro to be together with INITIALIZE_PASS, which is a complete target
645 /// independent initializer, and we don't want to make libScalarOpts depend
646 /// on libCodeGen.
647 #define INITIALIZE_TM_PASS(passName, arg, name, cfg, analysis) \
648     INITIALIZE_TM_PASS_BEGIN(passName, arg, name, cfg, analysis) \
649     INITIALIZE_TM_PASS_END(passName, arg, name, cfg, analysis)
650
651 #endif