Passes.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- Passes.h - Target independent code generation passes ----*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file defines interfaces to access the target independent code generation
  15. // passes provided by the LLVM backend.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_CODEGEN_PASSES_H
  19. #define LLVM_CODEGEN_PASSES_H
  20. #include "llvm/Support/CodeGen.h"
  21. #include "llvm/Support/Discriminator.h"
  22. #include "llvm/CodeGen/RegAllocCommon.h"
  23. #include <functional>
  24. #include <string>
  25. namespace llvm {
  26. class FunctionPass;
  27. class MachineFunction;
  28. class MachineFunctionPass;
  29. class ModulePass;
  30. class Pass;
  31. class TargetMachine;
  32. class raw_ostream;
  33. } // End llvm namespace
  34. // List of target independent CodeGen pass IDs.
  35. namespace llvm {
  36. /// AtomicExpandPass - At IR level this pass replace atomic instructions with
  37. /// __atomic_* library calls, or target specific instruction which implement the
  38. /// same semantics in a way which better fits the target backend.
  39. FunctionPass *createAtomicExpandPass();
  40. /// createUnreachableBlockEliminationPass - The LLVM code generator does not
  41. /// work well with unreachable basic blocks (what live ranges make sense for a
  42. /// block that cannot be reached?). As such, a code generator should either
  43. /// not instruction select unreachable blocks, or run this pass as its
  44. /// last LLVM modifying pass to clean up blocks that are not reachable from
  45. /// the entry block.
  46. FunctionPass *createUnreachableBlockEliminationPass();
  47. /// createBasicBlockSections Pass - This pass assigns sections to machine
  48. /// basic blocks and is enabled with -fbasic-block-sections.
  49. MachineFunctionPass *createBasicBlockSectionsPass();
  50. /// createMachineFunctionSplitterPass - This pass splits machine functions
  51. /// using profile information.
  52. MachineFunctionPass *createMachineFunctionSplitterPass();
  53. /// MachineFunctionPrinter pass - This pass prints out the machine function to
  54. /// the given stream as a debugging tool.
  55. MachineFunctionPass *
  56. createMachineFunctionPrinterPass(raw_ostream &OS,
  57. const std::string &Banner ="");
  58. /// StackFramePrinter pass - This pass prints out the machine function's
  59. /// stack frame to the given stream as a debugging tool.
  60. MachineFunctionPass *createStackFrameLayoutAnalysisPass();
  61. /// MIRPrinting pass - this pass prints out the LLVM IR into the given stream
  62. /// using the MIR serialization format.
  63. MachineFunctionPass *createPrintMIRPass(raw_ostream &OS);
  64. /// This pass resets a MachineFunction when it has the FailedISel property
  65. /// as if it was just created.
  66. /// If EmitFallbackDiag is true, the pass will emit a
  67. /// DiagnosticInfoISelFallback for every MachineFunction it resets.
  68. /// If AbortOnFailedISel is true, abort compilation instead of resetting.
  69. MachineFunctionPass *createResetMachineFunctionPass(bool EmitFallbackDiag,
  70. bool AbortOnFailedISel);
  71. /// createCodeGenPreparePass - Transform the code to expose more pattern
  72. /// matching during instruction selection.
  73. FunctionPass *createCodeGenPreparePass();
  74. /// This pass implements generation of target-specific intrinsics to support
  75. /// handling of complex number arithmetic
  76. FunctionPass *createComplexDeinterleavingPass(const TargetMachine *TM);
  77. /// AtomicExpandID -- Lowers atomic operations in terms of either cmpxchg
  78. /// load-linked/store-conditional loops.
  79. extern char &AtomicExpandID;
  80. /// MachineLoopInfo - This pass is a loop analysis pass.
  81. extern char &MachineLoopInfoID;
  82. /// MachineDominators - This pass is a machine dominators analysis pass.
  83. extern char &MachineDominatorsID;
  84. /// MachineDominanaceFrontier - This pass is a machine dominators analysis.
  85. extern char &MachineDominanceFrontierID;
  86. /// MachineRegionInfo - This pass computes SESE regions for machine functions.
  87. extern char &MachineRegionInfoPassID;
  88. /// EdgeBundles analysis - Bundle machine CFG edges.
  89. extern char &EdgeBundlesID;
  90. /// LiveVariables pass - This pass computes the set of blocks in which each
  91. /// variable is life and sets machine operand kill flags.
  92. extern char &LiveVariablesID;
  93. /// PHIElimination - This pass eliminates machine instruction PHI nodes
  94. /// by inserting copy instructions. This destroys SSA information, but is the
  95. /// desired input for some register allocators. This pass is "required" by
  96. /// these register allocator like this: AU.addRequiredID(PHIEliminationID);
  97. extern char &PHIEliminationID;
  98. /// LiveIntervals - This analysis keeps track of the live ranges of virtual
  99. /// and physical registers.
  100. extern char &LiveIntervalsID;
  101. /// LiveStacks pass. An analysis keeping track of the liveness of stack slots.
  102. extern char &LiveStacksID;
  103. /// TwoAddressInstruction - This pass reduces two-address instructions to
  104. /// use two operands. This destroys SSA information but it is desired by
  105. /// register allocators.
  106. extern char &TwoAddressInstructionPassID;
  107. /// ProcessImpicitDefs pass - This pass removes IMPLICIT_DEFs.
  108. extern char &ProcessImplicitDefsID;
  109. /// RegisterCoalescer - This pass merges live ranges to eliminate copies.
  110. extern char &RegisterCoalescerID;
  111. /// MachineScheduler - This pass schedules machine instructions.
  112. extern char &MachineSchedulerID;
  113. /// PostMachineScheduler - This pass schedules machine instructions postRA.
  114. extern char &PostMachineSchedulerID;
  115. /// SpillPlacement analysis. Suggest optimal placement of spill code between
  116. /// basic blocks.
  117. extern char &SpillPlacementID;
  118. /// ShrinkWrap pass. Look for the best place to insert save and restore
  119. // instruction and update the MachineFunctionInfo with that information.
  120. extern char &ShrinkWrapID;
  121. /// LiveRangeShrink pass. Move instruction close to its definition to shrink
  122. /// the definition's live range.
  123. extern char &LiveRangeShrinkID;
  124. /// Greedy register allocator.
  125. extern char &RAGreedyID;
  126. /// Basic register allocator.
  127. extern char &RABasicID;
  128. /// VirtRegRewriter pass. Rewrite virtual registers to physical registers as
  129. /// assigned in VirtRegMap.
  130. extern char &VirtRegRewriterID;
  131. FunctionPass *createVirtRegRewriter(bool ClearVirtRegs = true);
  132. /// UnreachableMachineBlockElimination - This pass removes unreachable
  133. /// machine basic blocks.
  134. extern char &UnreachableMachineBlockElimID;
  135. /// DeadMachineInstructionElim - This pass removes dead machine instructions.
  136. extern char &DeadMachineInstructionElimID;
  137. /// This pass adds dead/undef flags after analyzing subregister lanes.
  138. extern char &DetectDeadLanesID;
  139. /// This pass perform post-ra machine sink for COPY instructions.
  140. extern char &PostRAMachineSinkingID;
  141. /// This pass adds flow sensitive discriminators.
  142. extern char &MIRAddFSDiscriminatorsID;
  143. /// This pass reads flow sensitive profile.
  144. extern char &MIRProfileLoaderPassID;
  145. /// FastRegisterAllocation Pass - This pass register allocates as fast as
  146. /// possible. It is best suited for debug code where live ranges are short.
  147. ///
  148. FunctionPass *createFastRegisterAllocator();
  149. FunctionPass *createFastRegisterAllocator(RegClassFilterFunc F,
  150. bool ClearVirtRegs);
  151. /// BasicRegisterAllocation Pass - This pass implements a degenerate global
  152. /// register allocator using the basic regalloc framework.
  153. ///
  154. FunctionPass *createBasicRegisterAllocator();
  155. FunctionPass *createBasicRegisterAllocator(RegClassFilterFunc F);
  156. /// Greedy register allocation pass - This pass implements a global register
  157. /// allocator for optimized builds.
  158. ///
  159. FunctionPass *createGreedyRegisterAllocator();
  160. FunctionPass *createGreedyRegisterAllocator(RegClassFilterFunc F);
  161. /// PBQPRegisterAllocation Pass - This pass implements the Partitioned Boolean
  162. /// Quadratic Prograaming (PBQP) based register allocator.
  163. ///
  164. FunctionPass *createDefaultPBQPRegisterAllocator();
  165. /// PrologEpilogCodeInserter - This pass inserts prolog and epilog code,
  166. /// and eliminates abstract frame references.
  167. extern char &PrologEpilogCodeInserterID;
  168. MachineFunctionPass *createPrologEpilogInserterPass();
  169. /// ExpandPostRAPseudos - This pass expands pseudo instructions after
  170. /// register allocation.
  171. extern char &ExpandPostRAPseudosID;
  172. /// PostRAHazardRecognizer - This pass runs the post-ra hazard
  173. /// recognizer.
  174. extern char &PostRAHazardRecognizerID;
  175. /// PostRAScheduler - This pass performs post register allocation
  176. /// scheduling.
  177. extern char &PostRASchedulerID;
  178. /// BranchFolding - This pass performs machine code CFG based
  179. /// optimizations to delete branches to branches, eliminate branches to
  180. /// successor blocks (creating fall throughs), and eliminating branches over
  181. /// branches.
  182. extern char &BranchFolderPassID;
  183. /// BranchRelaxation - This pass replaces branches that need to jump further
  184. /// than is supported by a branch instruction.
  185. extern char &BranchRelaxationPassID;
  186. /// MachineFunctionPrinterPass - This pass prints out MachineInstr's.
  187. extern char &MachineFunctionPrinterPassID;
  188. /// MIRPrintingPass - this pass prints out the LLVM IR using the MIR
  189. /// serialization format.
  190. extern char &MIRPrintingPassID;
  191. /// TailDuplicate - Duplicate blocks with unconditional branches
  192. /// into tails of their predecessors.
  193. extern char &TailDuplicateID;
  194. /// Duplicate blocks with unconditional branches into tails of their
  195. /// predecessors. Variant that works before register allocation.
  196. extern char &EarlyTailDuplicateID;
  197. /// MachineTraceMetrics - This pass computes critical path and CPU resource
  198. /// usage in an ensemble of traces.
  199. extern char &MachineTraceMetricsID;
  200. /// EarlyIfConverter - This pass performs if-conversion on SSA form by
  201. /// inserting cmov instructions.
  202. extern char &EarlyIfConverterID;
  203. /// EarlyIfPredicator - This pass performs if-conversion on SSA form by
  204. /// predicating if/else block and insert select at the join point.
  205. extern char &EarlyIfPredicatorID;
  206. /// This pass performs instruction combining using trace metrics to estimate
  207. /// critical-path and resource depth.
  208. extern char &MachineCombinerID;
  209. /// StackSlotColoring - This pass performs stack coloring and merging.
  210. /// It merges disjoint allocas to reduce the stack size.
  211. extern char &StackColoringID;
  212. /// StackFramePrinter - This pass prints the stack frame layout and variable
  213. /// mappings.
  214. extern char &StackFrameLayoutAnalysisPassID;
  215. /// IfConverter - This pass performs machine code if conversion.
  216. extern char &IfConverterID;
  217. FunctionPass *createIfConverter(
  218. std::function<bool(const MachineFunction &)> Ftor);
  219. /// MachineBlockPlacement - This pass places basic blocks based on branch
  220. /// probabilities.
  221. extern char &MachineBlockPlacementID;
  222. /// MachineBlockPlacementStats - This pass collects statistics about the
  223. /// basic block placement using branch probabilities and block frequency
  224. /// information.
  225. extern char &MachineBlockPlacementStatsID;
  226. /// GCLowering Pass - Used by gc.root to perform its default lowering
  227. /// operations.
  228. FunctionPass *createGCLoweringPass();
  229. /// GCLowering Pass - Used by gc.root to perform its default lowering
  230. /// operations.
  231. extern char &GCLoweringID;
  232. /// ShadowStackGCLowering - Implements the custom lowering mechanism
  233. /// used by the shadow stack GC. Only runs on functions which opt in to
  234. /// the shadow stack collector.
  235. FunctionPass *createShadowStackGCLoweringPass();
  236. /// ShadowStackGCLowering - Implements the custom lowering mechanism
  237. /// used by the shadow stack GC.
  238. extern char &ShadowStackGCLoweringID;
  239. /// GCMachineCodeAnalysis - Target-independent pass to mark safe points
  240. /// in machine code. Must be added very late during code generation, just
  241. /// prior to output, and importantly after all CFG transformations (such as
  242. /// branch folding).
  243. extern char &GCMachineCodeAnalysisID;
  244. /// Creates a pass to print GC metadata.
  245. ///
  246. FunctionPass *createGCInfoPrinter(raw_ostream &OS);
  247. /// MachineCSE - This pass performs global CSE on machine instructions.
  248. extern char &MachineCSEID;
  249. /// MIRCanonicalizer - This pass canonicalizes MIR by renaming vregs
  250. /// according to the semantics of the instruction as well as hoists
  251. /// code.
  252. extern char &MIRCanonicalizerID;
  253. /// ImplicitNullChecks - This pass folds null pointer checks into nearby
  254. /// memory operations.
  255. extern char &ImplicitNullChecksID;
  256. /// This pass performs loop invariant code motion on machine instructions.
  257. extern char &MachineLICMID;
  258. /// This pass performs loop invariant code motion on machine instructions.
  259. /// This variant works before register allocation. \see MachineLICMID.
  260. extern char &EarlyMachineLICMID;
  261. /// MachineSinking - This pass performs sinking on machine instructions.
  262. extern char &MachineSinkingID;
  263. /// MachineCopyPropagation - This pass performs copy propagation on
  264. /// machine instructions.
  265. extern char &MachineCopyPropagationID;
  266. MachineFunctionPass *createMachineCopyPropagationPass(bool UseCopyInstr);
  267. /// MachineLateInstrsCleanup - This pass removes redundant identical
  268. /// instructions after register allocation and rematerialization.
  269. extern char &MachineLateInstrsCleanupID;
  270. /// PeepholeOptimizer - This pass performs peephole optimizations -
  271. /// like extension and comparison eliminations.
  272. extern char &PeepholeOptimizerID;
  273. /// OptimizePHIs - This pass optimizes machine instruction PHIs
  274. /// to take advantage of opportunities created during DAG legalization.
  275. extern char &OptimizePHIsID;
  276. /// StackSlotColoring - This pass performs stack slot coloring.
  277. extern char &StackSlotColoringID;
  278. /// This pass lays out funclets contiguously.
  279. extern char &FuncletLayoutID;
  280. /// This pass inserts the XRay instrumentation sleds if they are supported by
  281. /// the target platform.
  282. extern char &XRayInstrumentationID;
  283. /// This pass inserts FEntry calls
  284. extern char &FEntryInserterID;
  285. /// This pass implements the "patchable-function" attribute.
  286. extern char &PatchableFunctionID;
  287. /// createStackProtectorPass - This pass adds stack protectors to functions.
  288. ///
  289. FunctionPass *createStackProtectorPass();
  290. /// createMachineVerifierPass - This pass verifies cenerated machine code
  291. /// instructions for correctness.
  292. ///
  293. FunctionPass *createMachineVerifierPass(const std::string& Banner);
  294. /// createDwarfEHPass - This pass mulches exception handling code into a form
  295. /// adapted to code generation. Required if using dwarf exception handling.
  296. FunctionPass *createDwarfEHPass(CodeGenOpt::Level OptLevel);
  297. /// createWinEHPass - Prepares personality functions used by MSVC on Windows,
  298. /// in addition to the Itanium LSDA based personalities.
  299. FunctionPass *createWinEHPass(bool DemoteCatchSwitchPHIOnly = false);
  300. /// createSjLjEHPreparePass - This pass adapts exception handling code to use
  301. /// the GCC-style builtin setjmp/longjmp (sjlj) to handling EH control flow.
  302. ///
  303. FunctionPass *createSjLjEHPreparePass(const TargetMachine *TM);
  304. /// createWasmEHPass - This pass adapts exception handling code to use
  305. /// WebAssembly's exception handling scheme.
  306. FunctionPass *createWasmEHPass();
  307. /// LocalStackSlotAllocation - This pass assigns local frame indices to stack
  308. /// slots relative to one another and allocates base registers to access them
  309. /// when it is estimated by the target to be out of range of normal frame
  310. /// pointer or stack pointer index addressing.
  311. extern char &LocalStackSlotAllocationID;
  312. /// This pass expands pseudo-instructions, reserves registers and adjusts
  313. /// machine frame information.
  314. extern char &FinalizeISelID;
  315. /// UnpackMachineBundles - This pass unpack machine instruction bundles.
  316. extern char &UnpackMachineBundlesID;
  317. FunctionPass *
  318. createUnpackMachineBundles(std::function<bool(const MachineFunction &)> Ftor);
  319. /// FinalizeMachineBundles - This pass finalize machine instruction
  320. /// bundles (created earlier, e.g. during pre-RA scheduling).
  321. extern char &FinalizeMachineBundlesID;
  322. /// StackMapLiveness - This pass analyses the register live-out set of
  323. /// stackmap/patchpoint intrinsics and attaches the calculated information to
  324. /// the intrinsic for later emission to the StackMap.
  325. extern char &StackMapLivenessID;
  326. // MachineSanitizerBinaryMetadata - appends/finalizes sanitizer binary
  327. // metadata after llvm SanitizerBinaryMetadata pass.
  328. extern char &MachineSanitizerBinaryMetadataID;
  329. /// RemoveRedundantDebugValues pass.
  330. extern char &RemoveRedundantDebugValuesID;
  331. /// MachineCFGPrinter pass.
  332. extern char &MachineCFGPrinterID;
  333. /// LiveDebugValues pass
  334. extern char &LiveDebugValuesID;
  335. /// createJumpInstrTables - This pass creates jump-instruction tables.
  336. ModulePass *createJumpInstrTablesPass();
  337. /// InterleavedAccess Pass - This pass identifies and matches interleaved
  338. /// memory accesses to target specific intrinsics.
  339. ///
  340. FunctionPass *createInterleavedAccessPass();
  341. /// InterleavedLoadCombines Pass - This pass identifies interleaved loads and
  342. /// combines them into wide loads detectable by InterleavedAccessPass
  343. ///
  344. FunctionPass *createInterleavedLoadCombinePass();
  345. /// LowerEmuTLS - This pass generates __emutls_[vt].xyz variables for all
  346. /// TLS variables for the emulated TLS model.
  347. ///
  348. ModulePass *createLowerEmuTLSPass();
  349. /// This pass lowers the \@llvm.load.relative and \@llvm.objc.* intrinsics to
  350. /// instructions. This is unsafe to do earlier because a pass may combine the
  351. /// constant initializer into the load, which may result in an overflowing
  352. /// evaluation.
  353. ModulePass *createPreISelIntrinsicLoweringPass();
  354. /// GlobalMerge - This pass merges internal (by default) globals into structs
  355. /// to enable reuse of a base pointer by indexed addressing modes.
  356. /// It can also be configured to focus on size optimizations only.
  357. ///
  358. Pass *createGlobalMergePass(const TargetMachine *TM, unsigned MaximalOffset,
  359. bool OnlyOptimizeForSize = false,
  360. bool MergeExternalByDefault = false);
  361. /// This pass splits the stack into a safe stack and an unsafe stack to
  362. /// protect against stack-based overflow vulnerabilities.
  363. FunctionPass *createSafeStackPass();
  364. /// This pass detects subregister lanes in a virtual register that are used
  365. /// independently of other lanes and splits them into separate virtual
  366. /// registers.
  367. extern char &RenameIndependentSubregsID;
  368. /// This pass is executed POST-RA to collect which physical registers are
  369. /// preserved by given machine function.
  370. FunctionPass *createRegUsageInfoCollector();
  371. /// Return a MachineFunction pass that identifies call sites
  372. /// and propagates register usage information of callee to caller
  373. /// if available with PysicalRegisterUsageInfo pass.
  374. FunctionPass *createRegUsageInfoPropPass();
  375. /// This pass performs software pipelining on machine instructions.
  376. extern char &MachinePipelinerID;
  377. /// This pass frees the memory occupied by the MachineFunction.
  378. FunctionPass *createFreeMachineFunctionPass();
  379. /// This pass performs outlining on machine instructions directly before
  380. /// printing assembly.
  381. ModulePass *createMachineOutlinerPass(bool RunOnAllFunctions = true);
  382. /// This pass expands the experimental reduction intrinsics into sequences of
  383. /// shuffles.
  384. FunctionPass *createExpandReductionsPass();
  385. // This pass replaces intrinsics operating on vector operands with calls to
  386. // the corresponding function in a vector library (e.g., SVML, libmvec).
  387. FunctionPass *createReplaceWithVeclibLegacyPass();
  388. /// This pass expands the vector predication intrinsics into unpredicated
  389. /// instructions with selects or just the explicit vector length into the
  390. /// predicate mask.
  391. FunctionPass *createExpandVectorPredicationPass();
  392. // Expands large div/rem instructions.
  393. FunctionPass *createExpandLargeDivRemPass();
  394. // Expands large div/rem instructions.
  395. FunctionPass *createExpandLargeFpConvertPass();
  396. // This pass expands memcmp() to load/stores.
  397. FunctionPass *createExpandMemCmpPass();
  398. /// Creates Break False Dependencies pass. \see BreakFalseDeps.cpp
  399. FunctionPass *createBreakFalseDeps();
  400. // This pass expands indirectbr instructions.
  401. FunctionPass *createIndirectBrExpandPass();
  402. /// Creates CFI Fixup pass. \see CFIFixup.cpp
  403. FunctionPass *createCFIFixup();
  404. /// Creates CFI Instruction Inserter pass. \see CFIInstrInserter.cpp
  405. FunctionPass *createCFIInstrInserter();
  406. /// Creates CFGuard longjmp target identification pass.
  407. /// \see CFGuardLongjmp.cpp
  408. FunctionPass *createCFGuardLongjmpPass();
  409. /// Creates EHContGuard catchret target identification pass.
  410. /// \see EHContGuardCatchret.cpp
  411. FunctionPass *createEHContGuardCatchretPass();
  412. /// Create Hardware Loop pass. \see HardwareLoops.cpp
  413. FunctionPass *createHardwareLoopsPass();
  414. /// This pass inserts pseudo probe annotation for callsite profiling.
  415. FunctionPass *createPseudoProbeInserter();
  416. /// Create IR Type Promotion pass. \see TypePromotion.cpp
  417. FunctionPass *createTypePromotionLegacyPass();
  418. /// Add Flow Sensitive Discriminators. PassNum specifies the
  419. /// sequence number of this pass (starting from 1).
  420. FunctionPass *
  421. createMIRAddFSDiscriminatorsPass(sampleprof::FSDiscriminatorPass P);
  422. /// Read Flow Sensitive Profile.
  423. FunctionPass *createMIRProfileLoaderPass(std::string File,
  424. std::string RemappingFile,
  425. sampleprof::FSDiscriminatorPass P);
  426. /// Creates MIR Debugify pass. \see MachineDebugify.cpp
  427. ModulePass *createDebugifyMachineModulePass();
  428. /// Creates MIR Strip Debug pass. \see MachineStripDebug.cpp
  429. /// If OnlyDebugified is true then it will only strip debug info if it was
  430. /// added by a Debugify pass. The module will be left unchanged if the debug
  431. /// info was generated by another source such as clang.
  432. ModulePass *createStripDebugMachineModulePass(bool OnlyDebugified);
  433. /// Creates MIR Check Debug pass. \see MachineCheckDebugify.cpp
  434. ModulePass *createCheckDebugMachineModulePass();
  435. /// The pass fixups statepoint machine instruction to replace usage of
  436. /// caller saved registers with stack slots.
  437. extern char &FixupStatepointCallerSavedID;
  438. /// The pass transforms load/store <256 x i32> to AMX load/store intrinsics
  439. /// or split the data to two <128 x i32>.
  440. FunctionPass *createX86LowerAMXTypePass();
  441. /// The pass insert tile config intrinsics for AMX fast register allocation.
  442. FunctionPass *createX86PreAMXConfigPass();
  443. /// The pass transforms amx intrinsics to scalar operation if the function has
  444. /// optnone attribute or it is O0.
  445. FunctionPass *createX86LowerAMXIntrinsicsPass();
  446. /// When learning an eviction policy, extract score(reward) information,
  447. /// otherwise this does nothing
  448. FunctionPass *createRegAllocScoringPass();
  449. /// JMC instrument pass.
  450. ModulePass *createJMCInstrumenterPass();
  451. /// This pass converts conditional moves to conditional jumps when profitable.
  452. FunctionPass *createSelectOptimizePass();
  453. } // End llvm namespace
  454. #endif
  455. #ifdef __GNUC__
  456. #pragma GCC diagnostic pop
  457. #endif