Class: LLVM::PassBuilder
- Inherits:
-
Object
- Object
- LLVM::PassBuilder
- Extended by:
- FFI::Library
- Defined in:
- lib/llvm/transforms/pass_builder.rb
Overview
rubocop:disable Metrics/ClassLength
Constant Summary collapse
- OPT_PASSES =
rubocop:disable Layout/LineLength
{ '0' => 'always-inline,coro-cond(coro-early,cgscc(coro-split),coro-cleanup,globaldce),function(annotation-remarks),verify', '1' => 'annotation2metadata,forceattrs,inferattrs,coro-early,function<eager-inv>(lower-expect,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;no-switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,sroa<modify-cfg>,early-cse<>),openmp-opt,ipsccp,called-value-propagation,globalopt,function<eager-inv>(mem2reg,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),always-inline,require<globals-aa>,function(invalidate<aa>),require<profile-summary>,cgscc(devirt<4>(inline,function-attrs<skip-non-recursive-function-attrs>,function<eager-inv;no-rerun>(sroa<modify-cfg>,early-cse<memssa>,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,libcalls-shrinkwrap,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,reassociate,loop-mssa(loop-instsimplify,loop-simplifycfg,licm<no-allowspeculation>,loop-rotate<header-duplication;no-prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<no-nontrivial;trivial>),simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop(loop-idiom,indvars,loop-deletion,loop-unroll-full),sroa<modify-cfg>,memcpyopt,sccp,bdce,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,coro-elide,adce,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>),function-attrs,function(require<should-not-run-function-passes>),coro-split)),deadargelim,coro-cleanup,globalopt,globaldce,elim-avail-extern,rpo-function-attrs,recompute-globalsaa,function<eager-inv>(float2int,lower-constant-intrinsics,loop(loop-rotate<header-duplication;no-prepare-for-lto>,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize<no-interleave-forced-only;vectorize-forced-only;>,infer-alignment,loop-load-elim,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;forward-switch-cond;switch-range-to-icmp;switch-to-lookup;no-keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,vector-combine,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-unroll<O1>,transform-warning,sroa<preserve-cfg>,infer-alignment,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-mssa(licm<allowspeculation>),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),globaldce,constmerge,cg-profile,rel-lookup-table-converter,function(annotation-remarks),verify', '2' => 'annotation2metadata,forceattrs,inferattrs,coro-early,function<eager-inv>(lower-expect,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;no-switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,sroa<modify-cfg>,early-cse<>),openmp-opt,ipsccp,called-value-propagation,globalopt,function<eager-inv>(mem2reg,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),always-inline,require<globals-aa>,function(invalidate<aa>),require<profile-summary>,cgscc(devirt<4>(inline,function-attrs<skip-non-recursive-function-attrs>,openmp-opt-cgscc,function<eager-inv;no-rerun>(sroa<modify-cfg>,early-cse<memssa>,speculative-execution<only-if-divergent-target>,jump-threading,correlated-propagation,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,aggressive-instcombine,libcalls-shrinkwrap,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,reassociate,constraint-elimination,loop-mssa(loop-instsimplify,loop-simplifycfg,licm<no-allowspeculation>,loop-rotate<header-duplication;no-prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<no-nontrivial;trivial>),simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop(loop-idiom,indvars,loop-deletion,loop-unroll-full),sroa<modify-cfg>,vector-combine,mldst-motion<no-split-footer-bb>,gvn<>,sccp,bdce,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,jump-threading,correlated-propagation,adce,memcpyopt,dse,move-auto-init,loop-mssa(licm<allowspeculation>),coro-elide,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>),function-attrs,function(require<should-not-run-function-passes>),coro-split)),deadargelim,coro-cleanup,globalopt,globaldce,elim-avail-extern,rpo-function-attrs,recompute-globalsaa,function<eager-inv>(float2int,lower-constant-intrinsics,loop(loop-rotate<header-duplication;no-prepare-for-lto>,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>,infer-alignment,loop-load-elim,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;forward-switch-cond;switch-range-to-icmp;switch-to-lookup;no-keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,slp-vectorizer,vector-combine,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-unroll<O2>,transform-warning,sroa<preserve-cfg>,infer-alignment,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-mssa(licm<allowspeculation>),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),globaldce,constmerge,cg-profile,rel-lookup-table-converter,function(annotation-remarks),verify', '3' => 'annotation2metadata,forceattrs,inferattrs,coro-early,function<eager-inv>(lower-expect,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;no-switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,sroa<modify-cfg>,early-cse<>,callsite-splitting),openmp-opt,ipsccp,called-value-propagation,globalopt,function<eager-inv>(mem2reg,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),always-inline,require<globals-aa>,function(invalidate<aa>),require<profile-summary>,cgscc(devirt<4>(inline,function-attrs<skip-non-recursive-function-attrs>,argpromotion,openmp-opt-cgscc,function<eager-inv;no-rerun>(sroa<modify-cfg>,early-cse<memssa>,speculative-execution<only-if-divergent-target>,jump-threading,correlated-propagation,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,aggressive-instcombine,libcalls-shrinkwrap,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,reassociate,constraint-elimination,loop-mssa(loop-instsimplify,loop-simplifycfg,licm<no-allowspeculation>,loop-rotate<header-duplication;no-prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<nontrivial;trivial>),simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop(loop-idiom,indvars,loop-deletion,loop-unroll-full),sroa<modify-cfg>,vector-combine,mldst-motion<no-split-footer-bb>,gvn<>,sccp,bdce,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,jump-threading,correlated-propagation,adce,memcpyopt,dse,move-auto-init,loop-mssa(licm<allowspeculation>),coro-elide,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>),function-attrs,function(require<should-not-run-function-passes>),coro-split)),deadargelim,coro-cleanup,globalopt,globaldce,elim-avail-extern,rpo-function-attrs,recompute-globalsaa,function<eager-inv>(float2int,lower-constant-intrinsics,chr,loop(loop-rotate<header-duplication;no-prepare-for-lto>,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>,infer-alignment,loop-load-elim,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;forward-switch-cond;switch-range-to-icmp;switch-to-lookup;no-keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,slp-vectorizer,vector-combine,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-unroll<O3>,transform-warning,sroa<preserve-cfg>,infer-alignment,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-mssa(licm<allowspeculation>),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),globaldce,constmerge,cg-profile,rel-lookup-table-converter,function(annotation-remarks),verify', 's' => 'annotation2metadata,forceattrs,inferattrs,coro-early,function<eager-inv>(lower-expect,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;no-switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,sroa<modify-cfg>,early-cse<>),openmp-opt,ipsccp,called-value-propagation,globalopt,function<eager-inv>(mem2reg,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),always-inline,require<globals-aa>,function(invalidate<aa>),require<profile-summary>,cgscc(devirt<4>(inline,function-attrs<skip-non-recursive-function-attrs>,function<eager-inv;no-rerun>(sroa<modify-cfg>,early-cse<memssa>,speculative-execution<only-if-divergent-target>,jump-threading,correlated-propagation,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,aggressive-instcombine,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,reassociate,constraint-elimination,loop-mssa(loop-instsimplify,loop-simplifycfg,licm<no-allowspeculation>,loop-rotate<header-duplication;no-prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<no-nontrivial;trivial>),simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop(loop-idiom,indvars,loop-deletion,loop-unroll-full),sroa<modify-cfg>,vector-combine,mldst-motion<no-split-footer-bb>,gvn<>,sccp,bdce,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,jump-threading,correlated-propagation,adce,memcpyopt,dse,move-auto-init,loop-mssa(licm<allowspeculation>),coro-elide,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>),function-attrs,function(require<should-not-run-function-passes>),coro-split)),deadargelim,coro-cleanup,globalopt,globaldce,elim-avail-extern,rpo-function-attrs,recompute-globalsaa,function<eager-inv>(float2int,lower-constant-intrinsics,loop(loop-rotate<header-duplication;no-prepare-for-lto>,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>,infer-alignment,loop-load-elim,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;forward-switch-cond;switch-range-to-icmp;switch-to-lookup;no-keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,slp-vectorizer,vector-combine,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-unroll<O2>,transform-warning,sroa<preserve-cfg>,infer-alignment,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-mssa(licm<allowspeculation>),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),globaldce,constmerge,cg-profile,rel-lookup-table-converter,function(annotation-remarks),verify', 'z' => 'annotation2metadata,forceattrs,inferattrs,coro-early,function<eager-inv>(lower-expect,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;no-switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,sroa<modify-cfg>,early-cse<>),openmp-opt,ipsccp,called-value-propagation,globalopt,function<eager-inv>(mem2reg,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),always-inline,require<globals-aa>,function(invalidate<aa>),require<profile-summary>,cgscc(devirt<4>(inline,function-attrs<skip-non-recursive-function-attrs>,function<eager-inv;no-rerun>(sroa<modify-cfg>,early-cse<memssa>,speculative-execution<only-if-divergent-target>,jump-threading,correlated-propagation,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,aggressive-instcombine,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,reassociate,constraint-elimination,loop-mssa(loop-instsimplify,loop-simplifycfg,licm<no-allowspeculation>,loop-rotate<no-header-duplication;no-prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<no-nontrivial;trivial>),simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop(loop-idiom,indvars,loop-deletion,loop-unroll-full),sroa<modify-cfg>,vector-combine,mldst-motion<no-split-footer-bb>,gvn<>,sccp,bdce,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,jump-threading,correlated-propagation,adce,memcpyopt,dse,move-auto-init,loop-mssa(licm<allowspeculation>),coro-elide,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>),function-attrs,function(require<should-not-run-function-passes>),coro-split)),deadargelim,coro-cleanup,globalopt,globaldce,elim-avail-extern,rpo-function-attrs,recompute-globalsaa,function<eager-inv>(float2int,lower-constant-intrinsics,loop(loop-rotate<no-header-duplication;no-prepare-for-lto>,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize<no-interleave-forced-only;vectorize-forced-only;>,infer-alignment,loop-load-elim,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;forward-switch-cond;switch-range-to-icmp;switch-to-lookup;no-keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,vector-combine,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-unroll<O2>,transform-warning,sroa<preserve-cfg>,infer-alignment,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-mssa(licm<allowspeculation>),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),globaldce,constmerge,cg-profile,rel-lookup-table-converter,function(annotation-remarks),verify', }.freeze
Instance Attribute Summary collapse
-
#inliner_threshold ⇒ Object
Returns the value of attribute inliner_threshold.
-
#merge_functions ⇒ Object
Returns the value of attribute merge_functions.
-
#passes ⇒ Object
readonly
Returns the value of attribute passes.
Instance Method Summary collapse
-
#adce! ⇒ Object
Aggressive Dead Code Elimination.
-
#add_discriminators! ⇒ Object
Self.
- #add_function_pass ⇒ Object
-
#add_pass(pass) ⇒ Object
Self.
-
#alignment_from_assumptions! ⇒ Object
Self.
-
#always_inline! ⇒ Object
Inlines functions marked as “always_inline”.
-
#argpromotion! ⇒ Object
(also: #arg_promote!)
Self.
-
#asan!(options = {}) ⇒ Object
Address Sanitizer TODO: takes params clang.llvm.org/docs/AddressSanitizer.html llvm.org/doxygen/AddressSanitizer_8h_source.html llvm.org/doxygen/AddressSanitizer_8cpp_source.html.
-
#basic_aa! ⇒ Object
(also: #basicaa!)
Self.
- #bb_vectorize! ⇒ Object
-
#bdce! ⇒ Object
Bit-Tracking Dead Code Elimination pass.
-
#called_value_propagation! ⇒ Object
Propagate called values This file implements a transformation that attaches !callees metadata to indirect call sites.
-
#constmerge! ⇒ Object
(also: #const_merge!)
ConstantMerge is designed to build up a map of available constants and eliminate duplicates when it is initialized.
- #constprop! ⇒ Object
-
#correlated_propagation! ⇒ Object
Self.
-
#cvprop! ⇒ Object
Self.
-
#dce! ⇒ Object
Self.
-
#deadargelim! ⇒ Object
(also: #dae!)
Self.
-
#dfsan! ⇒ Object
DataFlow Sanitizer clang.llvm.org/docs/DataFlowSanitizer.html.
-
#dse! ⇒ Object
Dead Store Elimination his file implements a trivial dead store elimination that only considers basic-block local redundant stores.
-
#early_cse! ⇒ Object
A simple and fast domtree-based CSE pass.
-
#early_cse_memssa! ⇒ Object
A simple and fast domtree-based CSE pass.
-
#function_attrs! ⇒ Object
(also: #fun_attrs!)
Self.
-
#global_opt! ⇒ Object
Self.
-
#globaldce! ⇒ Object
(also: #gdce!)
Global Dead Code Elimination TODO: takes params.
-
#gobals_aa! ⇒ Object
Self.
-
#gvn! ⇒ Object
Global Value Numbering pass llvm.org/doxygen/GVN_8h_source.html TODO: takes params.
-
#gvn_hoist! ⇒ Object
hoists expressions from branches to a common dominator.
-
#gvn_sink! ⇒ Object
sink instructions into successors llvm.org/doxygen/GVNSink_8cpp_source.html.
-
#hwasan!(_options = {}) ⇒ Object
Hardware Assisted Address Sanitiver TODO: takes params clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html llvm.org/doxygen/HWAddressSanitizer_8cpp_source.html.
-
#indvars! ⇒ Object
Self.
-
#initialize ⇒ PassBuilder
constructor
rubocop:enable Layout/LineLength.
-
#inline! ⇒ Object
The inliner pass for the new pass manager.
-
#instcombine! ⇒ Object
Combine instructions to form fewer, simple instructions.
-
#instsimplify! ⇒ Object
Self.
-
#internalize!(_all_but_main = true) ⇒ Object
TODO: test this.
- #ipcp! ⇒ Object
-
#ipsccp! ⇒ Object
This pass implements interprocedural sparse conditional constant propagation and merging.
-
#jump_threading! ⇒ Object
Self.
-
#lcssa! ⇒ Object
Self.
-
#licm! ⇒ Object
Self.
-
#loop_deletion! ⇒ Object
Self.
-
#loop_idiom! ⇒ Object
Self.
-
#loop_reroll! ⇒ Object
Self.
-
#loop_rotate! ⇒ Object
Self.
-
#loop_unroll! ⇒ Object
Self.
-
#loop_unroll_and_jam! ⇒ Object
Self.
-
#loop_unswitch! ⇒ Object
Self.
-
#loop_vectorize! ⇒ Object
TODO: takes params.
-
#lower_constant_intrinsics! ⇒ Object
Self.
-
#lower_expect! ⇒ Object
Self.
-
#loweratomic! ⇒ Object
Self.
-
#lowerswitch! ⇒ Object
Self.
-
#mem2reg! ⇒ Object
Self.
-
#memcpyopt! ⇒ Object
Self.
-
#memoryssa! ⇒ Object
Self.
-
#mergefunc! ⇒ Object
This pass looks for equivalent functions that are mergable and folds them.
-
#mergeicmps! ⇒ Object
Self.
-
#mergereturn! ⇒ Object
Self.
-
#mldst_motion! ⇒ Object
Merged Load Store Motion.
-
#module_summary! ⇒ Object
Self.
-
#msan!(options = {}) ⇒ Object
Memory Sanitizer TODO: takes params llvm.org/doxygen/MemorySanitizer_8cpp.html llvm.org/doxygen/MemorySanitizer_8h_source.html clang.llvm.org/docs/MemorySanitizer.html KernelMemorySanitizer only supports X86_64 and SystemZ at the moment.
-
#newgvn! ⇒ Object
New Global Value Numbering pass llvm.org/doxygen/NewGVN_8cpp.html#details.
-
#no_op_cgscc! ⇒ Object
Self.
-
#no_op_function! ⇒ Object
Self.
-
#no_op_module! ⇒ Object
Self.
-
#o!(opt_level = '0', options = {}) ⇒ Object
–O0 - Optimization level 0.
-
#objc_arc_aa ⇒ Object
Self.
-
#partial_inliner! ⇒ Object
This pass performs partial inlining, typically by inlining an if statement that surrounds the body of the function.
-
#partially_inline_libcalls! ⇒ Object
Self.
- #pass_string ⇒ Object
- #prune_eh! ⇒ Object
-
#reassociate! ⇒ Object
Self.
-
#reg2mem! ⇒ Object
Self.
- #run(mod, target) ⇒ Object
- #sancov_module! ⇒ Object
- #sanmd_module! ⇒ Object
-
#scalarizer! ⇒ Object
Self.
- #scalarrepl! ⇒ Object
- #scalarrepl_ssa! ⇒ Object
- #scalarrepl_threshold!(_threshold = 0) ⇒ Object
-
#sccp! ⇒ Object
Self.
-
#scev_aa! ⇒ Object
Self.
-
#scoped_noalias_aa! ⇒ Object
Self.
-
#simple_loop_unswitch! ⇒ Object
Self.
- #simplify_libcalls! ⇒ Object
-
#simplifycfg! ⇒ Object
A pass to simplify and canonicalize the CFG of a function.
-
#slp_vectorize! ⇒ Object
Self.
-
#slp_vectorizer! ⇒ Object
Self.
-
#sroa! ⇒ Object
Scalar Replacement Of Aggregates llvm.org/doxygen/SROA_8h_source.html llvm.org/doxygen/SROA_8cpp.html.
-
#stack_safety! ⇒ Object
Self.
-
#strip! ⇒ Object
Self.
-
#strip_dead_prototypes! ⇒ Object
(also: #sdp!)
Self.
-
#tailcallelim! ⇒ Object
Self.
-
#tbaa! ⇒ Object
Self.
-
#tsan! ⇒ Object
Thread Sanitizer clang.llvm.org/docs/ThreadSanitizer.html.
-
#tsan_module! ⇒ Object
Thread Sanitiver - Module clang.llvm.org/docs/ThreadSanitizer.html.
-
#verify! ⇒ Object
Self.
Constructor Details
#initialize ⇒ PassBuilder
rubocop:enable Layout/LineLength
22 23 24 25 26 |
# File 'lib/llvm/transforms/pass_builder.rb', line 22 def initialize @passes = [] @inliner_threshold = nil @merge_functions = nil end |
Instance Attribute Details
#inliner_threshold ⇒ Object
Returns the value of attribute inliner_threshold.
9 10 11 |
# File 'lib/llvm/transforms/pass_builder.rb', line 9 def inliner_threshold @inliner_threshold end |
#merge_functions ⇒ Object
Returns the value of attribute merge_functions.
9 10 11 |
# File 'lib/llvm/transforms/pass_builder.rb', line 9 def merge_functions @merge_functions end |
#passes ⇒ Object
Returns the value of attribute passes.
8 9 10 |
# File 'lib/llvm/transforms/pass_builder.rb', line 8 def passes @passes end |
Instance Method Details
#adce! ⇒ Object
Aggressive Dead Code Elimination
459 460 461 |
# File 'lib/llvm/transforms/pass_builder.rb', line 459 def adce! add_pass('adce') end |
#add_discriminators! ⇒ Object
Returns self.
347 348 349 |
# File 'lib/llvm/transforms/pass_builder.rb', line 347 def add_discriminators! add_pass('add-discriminators') end |
#add_function_pass ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/llvm/transforms/pass_builder.rb', line 28 def add_function_pass pb = PassBuilder.new if block_given? yield pb end add_pass("function(#{pb.pass_string})") end |
#add_pass(pass) ⇒ Object
Returns self.
62 63 64 65 |
# File 'lib/llvm/transforms/pass_builder.rb', line 62 def add_pass(pass) passes << pass self end |
#alignment_from_assumptions! ⇒ Object
Returns self.
141 142 143 |
# File 'lib/llvm/transforms/pass_builder.rb', line 141 def alignment_from_assumptions! add_pass('alignment-from-assumptions') end |
#always_inline! ⇒ Object
Inlines functions marked as “always_inline”. llvm.org/doxygen/AlwaysInliner_8h_source.html llvm.org/doxygen/AlwaysInliner_8cpp_source.html
402 403 404 |
# File 'lib/llvm/transforms/pass_builder.rb', line 402 def always_inline! add_pass('always-inline') end |
#argpromotion! ⇒ Object Also known as: arg_promote!
Returns self.
526 527 528 |
# File 'lib/llvm/transforms/pass_builder.rb', line 526 def argpromotion! add_pass('argpromotion') end |
#asan!(options = {}) ⇒ Object
Address Sanitizer TODO: takes params clang.llvm.org/docs/AddressSanitizer.html llvm.org/doxygen/AddressSanitizer_8h_source.html llvm.org/doxygen/AddressSanitizer_8cpp_source.html
570 571 572 573 |
# File 'lib/llvm/transforms/pass_builder.rb', line 570 def asan!( = {}) opt_str = [:kernel] ? '<kernel>' : '' add_pass("asan#{opt_str}") end |
#basic_aa! ⇒ Object Also known as: basicaa!
Returns self.
362 363 364 |
# File 'lib/llvm/transforms/pass_builder.rb', line 362 def basic_aa! add_pass('require<basic-aa>') end |
#bb_vectorize! ⇒ Object
648 649 650 651 |
# File 'lib/llvm/transforms/pass_builder.rb', line 648 def bb_vectorize! warn('bb_vectorize! / LLVMAddBBVectorizePass was removed from LLVM - replace with slp_vectorize!') slp_vectorize! end |
#bdce! ⇒ Object
Bit-Tracking Dead Code Elimination pass
513 514 515 |
# File 'lib/llvm/transforms/pass_builder.rb', line 513 def bdce! add_pass('bdce') end |
#called_value_propagation! ⇒ Object
Propagate called values This file implements a transformation that attaches !callees metadata to indirect call sites. For a given call site, the metadata, if present, indicates the set of functions the call site could possibly target at run-time. This metadata is added to indirect call sites when the set of possible targets can be determined by analysis and is known to be small. The analysis driving the transformation is similar to constant propagation and makes uses of the generic sparse propagation solver. llvm.org/doxygen/CalledValuePropagation_8h_source.html
436 437 438 |
# File 'lib/llvm/transforms/pass_builder.rb', line 436 def called_value_propagation! add_pass('called-value-propagation') end |
#constmerge! ⇒ Object Also known as: const_merge!
ConstantMerge is designed to build up a map of available constants and eliminate duplicates when it is initialized. llvm.org/doxygen/ConstantMerge_8cpp_source.html llvm.org/doxygen/ConstantMerge_8h_source.html
451 452 453 |
# File 'lib/llvm/transforms/pass_builder.rb', line 451 def constmerge! add_pass('constmerge') end |
#constprop! ⇒ Object
653 654 655 |
# File 'lib/llvm/transforms/pass_builder.rb', line 653 def constprop! warn('constprop! / LLVMAddConstantPropagationPass was removed from LLVM') end |
#correlated_propagation! ⇒ Object
Returns self.
327 328 329 |
# File 'lib/llvm/transforms/pass_builder.rb', line 327 def add_pass('correlated-propagation') end |
#cvprop! ⇒ Object
Returns self.
322 323 324 |
# File 'lib/llvm/transforms/pass_builder.rb', line 322 def cvprop! end |
#dce! ⇒ Object
Returns self.
68 69 70 |
# File 'lib/llvm/transforms/pass_builder.rb', line 68 def dce! add_pass('dce') end |
#deadargelim! ⇒ Object Also known as: dae!
Returns self.
441 442 443 |
# File 'lib/llvm/transforms/pass_builder.rb', line 441 def deadargelim! add_pass('deadargelim') end |
#dfsan! ⇒ Object
DataFlow Sanitizer clang.llvm.org/docs/DataFlowSanitizer.html
590 591 592 |
# File 'lib/llvm/transforms/pass_builder.rb', line 590 def dfsan! add_pass('dfsan') end |
#dse! ⇒ Object
Dead Store Elimination his file implements a trivial dead store elimination that only considers basic-block local redundant stores. llvm.org/doxygen/DeadStoreElimination_8h_source.html
521 522 523 |
# File 'lib/llvm/transforms/pass_builder.rb', line 521 def dse! add_pass('dse') end |
#early_cse! ⇒ Object
A simple and fast domtree-based CSE pass.
This pass does a simple depth-first walk over the dominator tree, eliminating trivially redundant instructions and using instsimplify to canonicalize things as it goes. It is intended to be fast and catch obvious cases so that instcombine and other passes are more effective. It is expected that a later pass of GVN will catch the interesting/hard cases. llvm.org/doxygen/EarlyCSE_8h_source.html llvm.org/doxygen/EarlyCSE_8cpp.html
286 287 288 |
# File 'lib/llvm/transforms/pass_builder.rb', line 286 def early_cse! add_pass('early-cse') end |
#early_cse_memssa! ⇒ Object
A simple and fast domtree-based CSE pass. llvm.org/doxygen/EarlyCSE_8h_source.html llvm.org/doxygen/EarlyCSE_8cpp.html
294 295 296 |
# File 'lib/llvm/transforms/pass_builder.rb', line 294 def early_cse_memssa! add_pass('early-cse<memssa>') end |
#function_attrs! ⇒ Object Also known as: fun_attrs!
Returns self.
464 465 466 |
# File 'lib/llvm/transforms/pass_builder.rb', line 464 def function_attrs! add_pass('function-attrs') end |
#global_opt! ⇒ Object
Returns self.
498 499 500 |
# File 'lib/llvm/transforms/pass_builder.rb', line 498 def global_opt! add_pass('globalopt') end |
#globaldce! ⇒ Object Also known as: gdce!
Global Dead Code Elimination TODO: takes params
505 506 507 |
# File 'lib/llvm/transforms/pass_builder.rb', line 505 def globaldce! add_pass('globaldce') end |
#gobals_aa! ⇒ Object
Returns self.
389 390 391 |
# File 'lib/llvm/transforms/pass_builder.rb', line 389 def gobals_aa! add_pass('require<globals-aa>') end |
#gvn! ⇒ Object
Global Value Numbering pass llvm.org/doxygen/GVN_8h_source.html TODO: takes params
105 106 107 |
# File 'lib/llvm/transforms/pass_builder.rb', line 105 def gvn! add_pass('gvn') end |
#gvn_hoist! ⇒ Object
hoists expressions from branches to a common dominator. llvm.org/doxygen/GVNHoist_8cpp_source.html
119 120 121 |
# File 'lib/llvm/transforms/pass_builder.rb', line 119 def gvn_hoist! add_pass('gvn-hoist') end |
#gvn_sink! ⇒ Object
sink instructions into successors llvm.org/doxygen/GVNSink_8cpp_source.html
126 127 128 |
# File 'lib/llvm/transforms/pass_builder.rb', line 126 def gvn_sink! add_pass('gvn-sink') end |
#hwasan!(_options = {}) ⇒ Object
Hardware Assisted Address Sanitiver TODO: takes params clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html llvm.org/doxygen/HWAddressSanitizer_8cpp_source.html
560 561 562 |
# File 'lib/llvm/transforms/pass_builder.rb', line 560 def hwasan!( = {}) add_pass('hwasan') end |
#indvars! ⇒ Object
Returns self.
136 137 138 |
# File 'lib/llvm/transforms/pass_builder.rb', line 136 def indvars! add_pass('indvars') end |
#inline! ⇒ Object
The inliner pass for the new pass manager. llvm.org/doxygen/classllvm_1_1InlinerPass.html llvm.org/doxygen/Inliner_8h_source.html llvm.org/doxygen/Inliner_8cpp_source.html
537 538 539 |
# File 'lib/llvm/transforms/pass_builder.rb', line 537 def inline! add_pass('inline') end |
#instcombine! ⇒ Object
Combine instructions to form fewer, simple instructions. This pass does not modify the CFG. This pass is where algebraic simplification happens. llvm.org/doxygen/InstructionCombining_8cpp_source.html llvm.org/doxygen/InstCombineInternal_8h_source.html
207 208 209 |
# File 'lib/llvm/transforms/pass_builder.rb', line 207 def instcombine! add_pass('instcombine') end |
#instsimplify! ⇒ Object
Returns self.
212 213 214 |
# File 'lib/llvm/transforms/pass_builder.rb', line 212 def instsimplify! add_pass('instsimplify') end |
#internalize!(_all_but_main = true) ⇒ Object
TODO: test this
484 485 486 |
# File 'lib/llvm/transforms/pass_builder.rb', line 484 def internalize!(_all_but_main = true) # rubocop:disable Style/OptionalBooleanParameter add_pass('internalize') end |
#ipcp! ⇒ Object
624 625 626 |
# File 'lib/llvm/transforms/pass_builder.rb', line 624 def ipcp! deprecated('ipcp! / LLVMAddIPConstantPropagationPass was removed from LLVM') end |
#ipsccp! ⇒ Object
accept parameters ipsccp<no-func-spec;func-spec>
This pass implements interprocedural sparse conditional constant propagation and merging. llvm.org/doxygen/IPO_2SCCP_8h_source.html llvm.org/doxygen/IPO_2SCCP_8cpp_source.html
493 494 495 |
# File 'lib/llvm/transforms/pass_builder.rb', line 493 def ipsccp! add_pass('ipsccp') end |
#jump_threading! ⇒ Object
Returns self.
131 132 133 |
# File 'lib/llvm/transforms/pass_builder.rb', line 131 def jump_threading! add_pass('jump-threading') end |
#lcssa! ⇒ Object
Returns self.
299 300 301 |
# File 'lib/llvm/transforms/pass_builder.rb', line 299 def lcssa! add_pass('lcssa') end |
#licm! ⇒ Object
Returns self.
73 74 75 |
# File 'lib/llvm/transforms/pass_builder.rb', line 73 def licm! add_pass('licm') end |
#loop_deletion! ⇒ Object
Returns self.
146 147 148 |
# File 'lib/llvm/transforms/pass_builder.rb', line 146 def loop_deletion! add_pass('loop-deletion') end |
#loop_idiom! ⇒ Object
Returns self.
151 152 153 |
# File 'lib/llvm/transforms/pass_builder.rb', line 151 def loop_idiom! add_pass('loop-idiom') end |
#loop_reroll! ⇒ Object
Returns self.
161 162 163 |
# File 'lib/llvm/transforms/pass_builder.rb', line 161 def loop_reroll! add_pass('loop-reroll') end |
#loop_rotate! ⇒ Object
Returns self.
156 157 158 |
# File 'lib/llvm/transforms/pass_builder.rb', line 156 def loop_rotate! add_pass('loop-rotate') end |
#loop_unroll! ⇒ Object
Returns self.
166 167 168 |
# File 'lib/llvm/transforms/pass_builder.rb', line 166 def loop_unroll! add_pass('loop-unroll') end |
#loop_unroll_and_jam! ⇒ Object
Returns self.
171 172 173 |
# File 'lib/llvm/transforms/pass_builder.rb', line 171 def loop_unroll_and_jam! add_pass('loop-unroll-and-jam') end |
#loop_unswitch! ⇒ Object
Returns self.
181 182 183 |
# File 'lib/llvm/transforms/pass_builder.rb', line 181 def loop_unswitch! simple_loop_unswitch! end |
#loop_vectorize! ⇒ Object
TODO: takes params
187 188 189 |
# File 'lib/llvm/transforms/pass_builder.rb', line 187 def loop_vectorize! add_pass('loop-vectorize') end |
#lower_constant_intrinsics! ⇒ Object
Returns self.
332 333 334 |
# File 'lib/llvm/transforms/pass_builder.rb', line 332 def lower_constant_intrinsics! add_pass('lower-constant-intrinsics') end |
#lower_expect! ⇒ Object
Returns self.
317 318 319 |
# File 'lib/llvm/transforms/pass_builder.rb', line 317 def lower_expect! add_pass('lower-expect') end |
#loweratomic! ⇒ Object
Returns self.
217 218 219 |
# File 'lib/llvm/transforms/pass_builder.rb', line 217 def loweratomic! add_pass('loweratomic') end |
#lowerswitch! ⇒ Object
Returns self.
394 395 396 |
# File 'lib/llvm/transforms/pass_builder.rb', line 394 def lowerswitch! add_pass('lowerswitch') end |
#mem2reg! ⇒ Object
Returns self.
242 243 244 |
# File 'lib/llvm/transforms/pass_builder.rb', line 242 def mem2reg! add_pass('mem2reg') end |
#memcpyopt! ⇒ Object
Returns self.
192 193 194 |
# File 'lib/llvm/transforms/pass_builder.rb', line 192 def memcpyopt! add_pass('memcpyopt') end |
#memoryssa! ⇒ Object
Returns self.
304 305 306 |
# File 'lib/llvm/transforms/pass_builder.rb', line 304 def memoryssa! add_pass('require<memoryssa>') end |
#mergefunc! ⇒ Object
This pass looks for equivalent functions that are mergable and folds them. llvm.org/docs/MergeFunctions.html llvm.org/doxygen/MergeFunctions_8cpp_source.html llvm.org/doxygen/MergeFunctions_8h_source.html
422 423 424 |
# File 'lib/llvm/transforms/pass_builder.rb', line 422 def mergefunc! add_pass('mergefunc') end |
#mergeicmps! ⇒ Object
Returns self.
357 358 359 |
# File 'lib/llvm/transforms/pass_builder.rb', line 357 def mergeicmps! add_pass('mergeicmps') end |
#mergereturn! ⇒ Object
Returns self.
352 353 354 |
# File 'lib/llvm/transforms/pass_builder.rb', line 352 def mergereturn! add_pass('mergereturn') end |
#mldst_motion! ⇒ Object
Merged Load Store Motion
97 98 99 |
# File 'lib/llvm/transforms/pass_builder.rb', line 97 def mldst_motion! add_pass('mldst-motion') end |
#module_summary! ⇒ Object
Returns self.
252 253 254 |
# File 'lib/llvm/transforms/pass_builder.rb', line 252 def module_summary! add_pass('require<module-summary>') end |
#msan!(options = {}) ⇒ Object
Memory Sanitizer TODO: takes params llvm.org/doxygen/MemorySanitizer_8cpp.html llvm.org/doxygen/MemorySanitizer_8h_source.html clang.llvm.org/docs/MemorySanitizer.html KernelMemorySanitizer only supports X86_64 and SystemZ at the moment.
582 583 584 585 |
# File 'lib/llvm/transforms/pass_builder.rb', line 582 def msan!( = {}) opt_str = [:kernel] ? '<kernel>' : '' add_pass("msan#{opt_str}") end |
#newgvn! ⇒ Object
New Global Value Numbering pass llvm.org/doxygen/NewGVN_8cpp.html#details
112 113 114 |
# File 'lib/llvm/transforms/pass_builder.rb', line 112 def newgvn! add_pass('newgvn') end |
#no_op_cgscc! ⇒ Object
Returns self.
262 263 264 |
# File 'lib/llvm/transforms/pass_builder.rb', line 262 def no_op_cgscc! add_pass('no-op-cgscc') end |
#no_op_function! ⇒ Object
Returns self.
267 268 269 |
# File 'lib/llvm/transforms/pass_builder.rb', line 267 def no_op_function! add_pass('no-op-function') end |
#no_op_module! ⇒ Object
Returns self.
257 258 259 |
# File 'lib/llvm/transforms/pass_builder.rb', line 257 def no_op_module! add_pass('no-op-module') end |
#o!(opt_level = '0', options = {}) ⇒ Object
–O0 - Optimization level 0. Similar to clang -O0. Use -passes=‘default<O0>’ for the new PM –O1 - Optimization level 1. Similar to clang -O1. Use -passes=‘default<O1>’ for the new PM –O2 - Optimization level 2. Similar to clang -O2. Use -passes=‘default<O2>’ for the new PM –O3 - Optimization level 3. Similar to clang -O3. Use -passes=‘default<O3>’ for the new PM –Os - Like -O2 but size-conscious. Similar to clang -Os. Use -passes=‘default<Os>’ for the new PM –Oz - Like -O2 but optimize for code size above all else. Similar to clang -Oz. Use -passes=‘default<Oz>’ for the new PM
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/llvm/transforms/pass_builder.rb', line 44 def o!(opt_level = '0', = {}) opt_level = opt_level.to_s = OPT_PASSES[opt_level] if .nil? return add_pass("default<O#{opt_level}>") end if [:disable_inline] = .gsub('devirt<4>(inline,', 'devirt<4>(') end if [:disable_always_inline] = .gsub('always-inline,', '') end add_pass() end |
#objc_arc_aa ⇒ Object
Returns self.
369 370 371 |
# File 'lib/llvm/transforms/pass_builder.rb', line 369 def objc_arc_aa add_pass('require<objc-arc-aa>') end |
#partial_inliner! ⇒ Object
This pass performs partial inlining, typically by inlining an if statement that surrounds the body of the function. llvm.org/doxygen/PartialInlining_8h_source.html llvm.org/doxygen/PartialInlining_8cpp_source.html llvm.org/doxygen/PartialInlining_8h.html llvm.org/doxygen/PartialInlining_8cpp.html
413 414 415 |
# File 'lib/llvm/transforms/pass_builder.rb', line 413 def partial_inliner! add_pass('partial-inliner') end |
#partially_inline_libcalls! ⇒ Object
Returns self.
222 223 224 |
# File 'lib/llvm/transforms/pass_builder.rb', line 222 def partially_inline_libcalls! add_pass('partially-inline-libcalls') end |
#pass_string ⇒ Object
620 621 622 |
# File 'lib/llvm/transforms/pass_builder.rb', line 620 def pass_string passes.join(',') end |
#prune_eh! ⇒ Object
628 629 630 |
# File 'lib/llvm/transforms/pass_builder.rb', line 628 def prune_eh! deprecated('prune_eh! / LLVMAddPruneEHPass was removed in LLVM 16') end |
#reassociate! ⇒ Object
Returns self.
227 228 229 |
# File 'lib/llvm/transforms/pass_builder.rb', line 227 def reassociate! add_pass('reassociate') end |
#reg2mem! ⇒ Object
Returns self.
237 238 239 |
# File 'lib/llvm/transforms/pass_builder.rb', line 237 def reg2mem! add_pass('reg2mem') end |
#run(mod, target) ⇒ Object
606 607 608 609 610 611 612 613 614 615 616 617 618 |
# File 'lib/llvm/transforms/pass_builder.rb', line 606 def run(mod, target) return self if passes.empty? error = { || C.run_passes(mod, pass_string, target, ) } if !error.null? error_msg = C.(error) # TODO: clone then dispose of error_msg, currently produces "munmap_chunk(): invalid pointer" # save_message = error_msg.clone # C.dispose_error_message(error_msg) raise ArgumentError, error_msg end self end |
#sancov_module! ⇒ Object
596 597 598 |
# File 'lib/llvm/transforms/pass_builder.rb', line 596 def sancov_module! add_pass('sancov-module') end |
#sanmd_module! ⇒ Object
602 603 604 |
# File 'lib/llvm/transforms/pass_builder.rb', line 602 def sanmd_module! add_pass('sanmd-module') end |
#scalarizer! ⇒ Object
Returns self.
91 92 93 |
# File 'lib/llvm/transforms/pass_builder.rb', line 91 def scalarizer! add_pass('scalarizer') end |
#scalarrepl! ⇒ Object
636 637 638 |
# File 'lib/llvm/transforms/pass_builder.rb', line 636 def scalarrepl! deprecated('TODO: scalarrepl') end |
#scalarrepl_ssa! ⇒ Object
640 641 642 |
# File 'lib/llvm/transforms/pass_builder.rb', line 640 def scalarrepl_ssa! deprecated('TODO: scalarrepl_ssa') end |
#scalarrepl_threshold!(_threshold = 0) ⇒ Object
644 645 646 |
# File 'lib/llvm/transforms/pass_builder.rb', line 644 def scalarrepl_threshold!(_threshold = 0) deprecated('TODO: scalarrepl_threshold') end |
#sccp! ⇒ Object
Returns self.
197 198 199 |
# File 'lib/llvm/transforms/pass_builder.rb', line 197 def sccp! add_pass('sccp') end |
#scev_aa! ⇒ Object
Returns self.
374 375 376 |
# File 'lib/llvm/transforms/pass_builder.rb', line 374 def scev_aa! add_pass('require<scev-aa>') end |
#scoped_noalias_aa! ⇒ Object
Returns self.
379 380 381 |
# File 'lib/llvm/transforms/pass_builder.rb', line 379 def scoped_noalias_aa! add_pass('require<scoped-noalias-aa>') end |
#simple_loop_unswitch! ⇒ Object
Returns self.
176 177 178 |
# File 'lib/llvm/transforms/pass_builder.rb', line 176 def simple_loop_unswitch! add_pass('simple-loop-unswitch') end |
#simplify_libcalls! ⇒ Object
632 633 634 |
# File 'lib/llvm/transforms/pass_builder.rb', line 632 def simplify_libcalls! deprecated('simplify_libcalls! / LLVMAddSimplifyLibCallsPass was removed from LLVM') end |
#simplifycfg! ⇒ Object
A pass to simplify and canonicalize the CFG of a function. This pass iteratively simplifies the entire CFG of a function. It may change or remove control flow to put the CFG into a canonical form expected by other passes of the mid-level optimizer. Depending on the specified options, it may further optimize control-flow to create non-canonical form llvm.org/doxygen/SimplifyCFG_8h_source.html TODO: takes params Options: simplifycfg<no-forward-switch-cond;forward-switch-cond;no-switch-range-to-icmp;switch-range-to-icmp;no-switch-to-lookup;switch-to-lookup;no-keep-loops;keep-loops;no-hoist-common-insts;hoist-common-insts;no-sink-common-insts;sink-common-insts;bonus-inst-threshold=N>
86 87 88 |
# File 'lib/llvm/transforms/pass_builder.rb', line 86 def simplifycfg! add_pass('simplifycfg') end |
#slp_vectorize! ⇒ Object
Returns self.
337 338 339 |
# File 'lib/llvm/transforms/pass_builder.rb', line 337 def slp_vectorize! slp_vectorizer! end |
#slp_vectorizer! ⇒ Object
Returns self.
342 343 344 |
# File 'lib/llvm/transforms/pass_builder.rb', line 342 def slp_vectorizer! add_pass('slp-vectorizer') end |
#sroa! ⇒ Object
Scalar Replacement Of Aggregates llvm.org/doxygen/SROA_8h_source.html llvm.org/doxygen/SROA_8cpp.html
312 313 314 |
# File 'lib/llvm/transforms/pass_builder.rb', line 312 def sroa! add_pass('sroa') end |
#stack_safety! ⇒ Object
Returns self.
272 273 274 |
# File 'lib/llvm/transforms/pass_builder.rb', line 272 def stack_safety! add_pass('require<stack-safety>') end |
#strip! ⇒ Object
Returns self.
471 472 473 |
# File 'lib/llvm/transforms/pass_builder.rb', line 471 def strip! add_pass('strip') end |
#strip_dead_prototypes! ⇒ Object Also known as: sdp!
Returns self.
476 477 478 |
# File 'lib/llvm/transforms/pass_builder.rb', line 476 def strip_dead_prototypes! add_pass('strip-dead-prototypes') end |
#tailcallelim! ⇒ Object
Returns self.
232 233 234 |
# File 'lib/llvm/transforms/pass_builder.rb', line 232 def tailcallelim! add_pass('tailcallelim') end |
#tbaa! ⇒ Object
Returns self.
384 385 386 |
# File 'lib/llvm/transforms/pass_builder.rb', line 384 def tbaa! add_pass('require<tbaa>') end |
#tsan! ⇒ Object
Thread Sanitizer clang.llvm.org/docs/ThreadSanitizer.html
544 545 546 |
# File 'lib/llvm/transforms/pass_builder.rb', line 544 def tsan! add_pass('tsan') end |
#tsan_module! ⇒ Object
Thread Sanitiver - Module clang.llvm.org/docs/ThreadSanitizer.html
551 552 553 |
# File 'lib/llvm/transforms/pass_builder.rb', line 551 def tsan_module! add_pass('tsan-module') end |
#verify! ⇒ Object
Returns self.
247 248 249 |
# File 'lib/llvm/transforms/pass_builder.rb', line 247 def verify! add_pass('verify') end |