|
@@ -1508,6 +1508,7 @@ gb_internal WORKER_TASK_PROC(lb_llvm_module_pass_worker_proc) {
|
|
|
case 1:
|
|
|
// default<Os>
|
|
|
// Passes removed: coro, openmp, sroa
|
|
|
+#if LLVM_VERSION_MAJOR == 17
|
|
|
array_add(&passes, u8R"(
|
|
|
annotation2metadata,
|
|
|
forceattrs,
|
|
@@ -1523,13 +1524,14 @@ globalopt,
|
|
|
function<eager-inv>(
|
|
|
mem2reg,
|
|
|
instcombine<max-iterations=1000;no-use-loop-info>,
|
|
|
- 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>),
|
|
|
- require<globals-aa>,
|
|
|
- function(
|
|
|
- invalidate<aa>
|
|
|
- ),
|
|
|
- require<profile-summary>,
|
|
|
- cgscc(
|
|
|
+ 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>
|
|
|
+),
|
|
|
+require<globals-aa>,
|
|
|
+function(
|
|
|
+ invalidate<aa>
|
|
|
+),
|
|
|
+require<profile-summary>,
|
|
|
+cgscc(
|
|
|
devirt<4>(
|
|
|
inline<only-mandatory>,
|
|
|
inline,
|
|
@@ -1630,10 +1632,138 @@ function(
|
|
|
),
|
|
|
verify
|
|
|
)");
|
|
|
+#else
|
|
|
+ array_add(&passes, u8R"(
|
|
|
+annotation2metadata,
|
|
|
+forceattrs,
|
|
|
+inferattrs,
|
|
|
+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>,
|
|
|
+ early-cse<>
|
|
|
+),
|
|
|
+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>(
|
|
|
+ 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
|
|
|
+ ),
|
|
|
+ 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>
|
|
|
+ ),
|
|
|
+ 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>
|
|
|
+ )
|
|
|
+ )
|
|
|
+),
|
|
|
+deadargelim,
|
|
|
+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,
|
|
|
+ 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
|
|
|
+)");
|
|
|
+#endif
|
|
|
break;
|
|
|
// default<O2>
|
|
|
// Passes removed: coro, openmp, sroa
|
|
|
case 2:
|
|
|
+#if LLVM_VERSION_MAJOR == 17
|
|
|
array_add(&passes, u8R"(
|
|
|
annotation2metadata,
|
|
|
forceattrs,
|
|
@@ -1758,11 +1888,140 @@ function(
|
|
|
),
|
|
|
verify
|
|
|
)");
|
|
|
+#else
|
|
|
+ array_add(&passes, u8R"(
|
|
|
+annotation2metadata,
|
|
|
+forceattrs,
|
|
|
+inferattrs,
|
|
|
+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>,
|
|
|
+ early-cse<>
|
|
|
+),
|
|
|
+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>(
|
|
|
+ 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
|
|
|
+ ),
|
|
|
+ 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>
|
|
|
+ ),
|
|
|
+ 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>
|
|
|
+ )
|
|
|
+ )
|
|
|
+),
|
|
|
+deadargelim,
|
|
|
+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,
|
|
|
+ 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
|
|
|
+)");
|
|
|
+#endif
|
|
|
break;
|
|
|
|
|
|
case 3:
|
|
|
// default<O3>
|
|
|
// Passes removed: coro, openmp, sroa
|
|
|
+#if LLVM_VERSION_MAJOR == 17
|
|
|
array_add(&passes, u8R"(
|
|
|
annotation2metadata,
|
|
|
forceattrs,
|
|
@@ -1890,6 +2149,131 @@ function(
|
|
|
),
|
|
|
verify
|
|
|
)");
|
|
|
+#else
|
|
|
+ array_add(&passes, u8R"(
|
|
|
+annotation2metadata,
|
|
|
+forceattrs,
|
|
|
+inferattrs,
|
|
|
+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>,
|
|
|
+ early-cse<>,
|
|
|
+ callsite-splitting
|
|
|
+),
|
|
|
+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,
|
|
|
+ function<eager-inv;no-rerun>(
|
|
|
+ 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
|
|
|
+ ),
|
|
|
+ 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>),
|
|
|
+ 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>
|
|
|
+ )
|
|
|
+ )
|
|
|
+),
|
|
|
+deadargelim,
|
|
|
+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,
|
|
|
+ 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
|
|
|
+)");
|
|
|
+#endif
|
|
|
break;
|
|
|
}
|
|
|
|