88 lines · plain
1(*===-- llvm_passbuilder.mli - LLVM OCaml Interface ------------*- OCaml -*-===*2 *3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4 * See https://llvm.org/LICENSE.txt for license information.5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6 *7 *===----------------------------------------------------------------------===*)8 9type llpassbuilder_options10 11(** [run_passes m passes tm opts] runs a set of passes over a module. The12 format of the string [passes] is the same as opt's -passes argument for13 the new pass manager. Individual passes may be specified, separated by14 commas. Full pipelines may also be invoked. See [LLVMRunPasses]. *)15val run_passes16 : Llvm.llmodule17 -> string18 -> Llvm_target.TargetMachine.t19 -> llpassbuilder_options20 -> (unit, string) result21 22(** Creates a new set of options for a PassBuilder. See23 [llvm::LLVMPassBuilderOptions::LLVMPassBuilderOptions]. *)24val create_passbuilder_options : unit -> llpassbuilder_options25 26(** Toggles adding the VerifierPass for the PassBuilder. See27 [llvm::LLVMPassBuilderOptions::VerifyEach]. *)28val passbuilder_options_set_verify_each29 : llpassbuilder_options -> bool -> unit30 31(** Toggles debug logging. See [llvm::LLVMPassBuilderOptions::DebugLogging]. *)32val passbuilder_options_set_debug_logging33 : llpassbuilder_options -> bool -> unit34 35(** Tuning option to set loop interleaving on/off, set based on opt level.36 See [llvm::PipelineTuningOptions::LoopInterleaving]. *)37val passbuilder_options_set_loop_interleaving38 : llpassbuilder_options -> bool -> unit39 40(** Tuning option to enable/disable loop vectorization, set based on opt level.41 See [llvm::PipelineTuningOptions::LoopVectorization]. *)42val passbuilder_options_set_loop_vectorization43 : llpassbuilder_options -> bool -> unit44 45(** Tuning option to enable/disable slp loop vectorization, set based on opt46 level. See [llvm::PipelineTuningOptions::SLPVectorization]. *)47val passbuilder_options_set_slp_vectorization48 : llpassbuilder_options -> bool -> unit49 50(** Tuning option to enable/disable loop unrolling. Its default value is true.51 See [llvm::PipelineTuningOptions::LoopUnrolling]. *)52val passbuilder_options_set_loop_unrolling53 : llpassbuilder_options -> bool -> unit54 55(** Tuning option to forget all SCEV loops in LoopUnroll.56 See [llvm::PipelineTuningOptions::ForgetAllSCEVInLoopUnroll]. *)57val passbuilder_options_set_forget_all_scev_in_loop_unroll58 : llpassbuilder_options -> bool -> unit59 60(** Tuning option to cap the number of calls to retrive clobbering accesses in61 MemorySSA, in LICM. See [llvm::PipelineTuningOptions::LicmMssaOptCap]. *)62val passbuilder_options_set_licm_mssa_opt_cap63 : llpassbuilder_options -> int -> unit64 65(** Tuning option to disable promotion to scalars in LICM with MemorySSA, if66 the number of accesses is too large. See67 [llvm::PipelineTuningOptions::LicmMssaNoAccForPromotionCap]. *)68val passbuilder_options_set_licm_mssa_no_acc_for_promotion_cap69 : llpassbuilder_options -> int -> unit70 71(** Tuning option to enable/disable call graph profile. See72 [llvm::PipelineTuningOptions::CallGraphProfile]. *)73val passbuilder_options_set_call_graph_profile74 : llpassbuilder_options -> bool -> unit75 76(** Tuning option to enable/disable function merging. See77 [llvm::PipelineTuningOptions::MergeFunctions]. *)78val passbuilder_options_set_merge_functions79 : llpassbuilder_options -> bool -> unit80 81(** Tuning option to override the default inliner threshold. See82 [llvm::PipelineTuningOptions::InlinerThreshold]. *)83val passbuilder_options_set_inliner_threshold84 : llpassbuilder_options -> int -> unit85 86(** Disposes of the options. *)87val dispose_passbuilder_options : llpassbuilder_options -> unit88