Skip to content

Commit

Permalink
Get rid of ykconfig -ao.
Browse files Browse the repository at this point in the history
Not so long ago we added `yk-config -ao <level>` to allow us to run our
pre-canned franken-O1 pipeline for the entire test suite. This was only
ever designed as an interim hack, and we've wanted Yk to simply work
with standard optimisation flags like -O1, -O2 etc.

This change is a step in that direction.

We remove `-ao` and our non-standard defaults and add the ability for
individual tests to specify extra compiler flags. This gives us the
ability to specify optimisation parameters on a per-test basis.

I then ported as many tests as were practical to use -O1. The remaining
tests (that were either too involved for me to convert right now, or
actually rely on an IR shape generated by our old default pipeline) I've
left using our franken-O1 by passing:

-O0 -Xclang -disable-O0-optnone -Xlinker \
    --lto-newpm-passes=instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>

We do have to disable yklua in CI for now, as yklua still uses
`yk-config -ao` and we have to break a circular dependency.
  • Loading branch information
vext01 committed Oct 3, 2024
1 parent 94623c0 commit 4120f1f
Show file tree
Hide file tree
Showing 31 changed files with 72 additions and 81 deletions.
1 change: 1 addition & 0 deletions .buildbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ TRACERS="hwt swt"
# - `yk-config` must be in PATH.
# - YK_BUILD_TYPE must be set.
test_yklua() {
return # FIXME: temporarily disable yklua to break a circular dep in CI.
if [ ! -e "yklua" ]; then
git clone https://github.com/ykjit/yklua
fi
Expand Down
78 changes: 7 additions & 71 deletions bin/yk-config
Original file line number Diff line number Diff line change
Expand Up @@ -10,59 +10,16 @@ if [ ! -d "${DIR}/../ykrt" ]; then
exit 1
fi

set_aot_pipeline() {
level=$1
# env var always takes precident.
if [ ! -z "${YKB_AOT_OPTLEVEL}" ]; then
level=${YKB_AOT_OPTLEVEL}
fi
case ${level} in
0)
POSTLINK_PASSES=${POSTLINK_PASSES_AO0}
PRELINK_PASSES=${PRELINK_PASSES_AO0}
;;
1)
POSTLINK_PASSES=${POSTLINK_PASSES_AO1}
PRELINK_PASSES=${PRELINK_PASSES_AO1}
;;
*)
echo "error: invalid yk AOT optimisation level '${level}'" >&2
exit 1
;;
esac
}

# Canned pipelines.
#
# Ideally we'd detect the optimisation level from the CFLAGS env var, but it's
# not easy to reliably parse that info out of CFLAGS. So for now we allow `--ao
# <n>` to yk-config (or set YKB_AOT_OPTLEVEL in the env) to specify the AOT
# optimisation level.
#
# Note that clang is still passed -O0 regardless. We just add our own pipeline
# specification on top.
PRELINK_PASSES_AO0=""
POSTLINK_PASSES_AO0="instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>"
PRELINK_PASSES_AO1=""
# The whole -O1 pipeline, as reported by `opt -O1 -print-pipeline-passes
# /dev/null`.
POSTLINK_PASSES_AO1="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>),require<globals-aa>,function(invalidate<aa>),require<profile-summary>,cgscc(devirt<4>(inline<only-mandatory>,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"
# Initialise the AOT pipeline to level 0 unless YKB_AOT_OPTLEVEL is set.
set_aot_pipeline 0

OUTPUT=""

usage() {
echo "Generate C compiler flags for building against the yk JIT.\n"
echo "Usage:"
echo " yk-config <profile> [--ao <0|1>] \\"
echo " yk-config <profile> \\"
echo " <--cc|--cxx|--ar|--ranlib|--cppflags|--cflags|--ldflags>\n"
echo " Where <profile> is a Rust cargo profile starting with either 'debug' or 'release'.\n"
echo " --cc, --cxx, --ar, --ranlib, --cppflags, --cflags and --ldflags specify "
echo " what flags to output.\n"
echo " --ao specifies the yk-specific AOT optimisation pipeline to use for flags "
echo " that follow. Defaults to 0, but (if set) the YKB_AOT_OPTLEVEL environment "
echo " variable always takes precedent."
echo " what flags to output.\n\n"
}

handle_arg() {
Expand All @@ -77,32 +34,18 @@ handle_arg() {
fi

case $1 in
--ao) set_aot_pipeline $2;;
--cc) OUTPUT="${ykllvm_bin_dir}/clang" ;;
--cxx) OUTPUT="${ykllvm_bin_dir}/clang++" ;;
--ar) OUTPUT="${ykllvm_bin_dir}/llvm-ar" ;;
--ranlib) OUTPUT="${ykllvm_bin_dir}/llvm-ranlib" ;;
--cflags)
# FIXME: we can only do -O0 for now.
OUTPUT="${OUTPUT} -O0"
# Enable LTO.
OUTPUT="${OUTPUT} -flto"
# Outline functions containing loops during AOT compilation. Needed
# for `yk_unroll_safe`.
OUTPUT="${OUTPUT} -fyk-noinline-funcs-with-loops"
# Required so that our curated set of optimisation passes can run.
# Without this, clang will slap `optnone` attributes on every
# function, causing optimisations to skip them.
OUTPUT="${OUTPUT} -Xclang -disable-O0-optnone"
# Run these "prelink" optimisation passes.
#
# These are run on the individual pre-LTO-merged LLVM modules.
if [ ! -z "${PRELINK_PASSES}" ]; then
OUTPUT="${OUTPUT} -mllvm --newpm-passes=${PRELINK_PASSES}"
fi
case $profile in
debug*) OUTPUT="$OUTPUT -g" ;;
esac
# Don't optimise functions by changing their calling convention.
OUTPUT="${OUTPUT} -mllvm -yk-dont-opt-func-abi"
;;
--cppflags)
# Path to yk.h
Expand Down Expand Up @@ -167,18 +110,11 @@ handle_arg() {
if [ "${YKB_TRACER}" = "swt" ]; then
OUTPUT="${OUTPUT} -Wl,--mllvm=--yk-basicblock-tracer"
fi
# Add known yk-friendly optimisations.
#
# This pairs with `-Xclang -disable-O0-optnone`. See above.
# Disable backend optimisations that Yk can't handle by adding the
# `optnone` attribute onto every function after high-level IR
# optimisations have finished.
OUTPUT="${OUTPUT} -Wl,--mllvm=--yk-optnone-after-ir-passes"

# Run these post-link passes.
#
# These are run on the merged LTO LLVM module.
if [ ! -z "${POSTLINK_PASSES}" ]; then
OUTPUT="${OUTPUT} -Xlinker --lto-newpm-passes=${POSTLINK_PASSES}"
fi

# Emit a basic block map section. Used for block mapping.
OUTPUT="${OUTPUT} -Wl,--lto-basic-block-sections=labels"

Expand Down
5 changes: 4 additions & 1 deletion tests/c/aot_debuginfo.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// ignore-if: test $YK_CARGO_PROFILE != "debug"
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1 -g
// Run-time:
// env-var: YKD_LOG_IR=-:aot
// env-var: YKD_SERIALISE_COMPILATION=1
Expand All @@ -9,13 +10,15 @@
// %{{_}}: ptr = call yk_mt_new(0x0)
// ...
// # aot_debuginfo.c:{{_}}: yk_mt_hot_threshold_set(mt, 0);
// ...
// call yk_mt_hot_threshold_set(%{{_}}, 0i32)
// ...
// # aot_debuginfo.c:{{_}}: YkLocation loc = yk_location_new();
// ...
// %{{_}}: i64 = call yk_location_new()
// ...
// # aot_debuginfo.c:{{_}}: int i = 4;
// ...
// *%{{_}} = 4i32
// ...
// # aot_debuginfo.c:{{_}}: while (i > 0) {
Expand Down
2 changes: 2 additions & 0 deletions tests/c/arithmetic.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:jit-pre-opt,jit-post-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
2 changes: 2 additions & 0 deletions tests/c/ashr_exact.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O0 -Xclang -disable-O0-optnone -Xlinker --lto-newpm-passes=instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>
// Run-time:
// env-var: YKD_LOG_IR=-:jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
2 changes: 2 additions & 0 deletions tests/c/bf.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O0 -Xclang -disable-O0-optnone -Xlinker --lto-newpm-passes=instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
Expand Down
3 changes: 2 additions & 1 deletion tests/c/call_ext_simple.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// stderr:
// ...
// func_decl putchar (i32) -> i32
// func_decl putc (i32, ptr) -> i32
// ...
// %{{6}}: i32 = call @putc...
// ...
Expand Down
2 changes: 2 additions & 0 deletions tests/c/double.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
2 changes: 2 additions & 0 deletions tests/c/doubleinline.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
2 changes: 2 additions & 0 deletions tests/c/dyn_ptradd_mixed.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
4 changes: 3 additions & 1 deletion tests/c/dyn_ptradd_multidim.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O0 -Xclang -disable-O0-optnone -Xlinker --lto-newpm-passes=instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>
// Run-time:
// env-var: YKD_LOG_IR=-:aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down Expand Up @@ -51,8 +53,8 @@ int main(int argc, char **argv) {

int i = 0;
NOOPT_VAL(loc);
NOOPT_VAL(i);
NOOPT_VAL(array);
NOOPT_VAL(i);
while (i < 4) {
yk_mt_control_point(mt, &loc);
fprintf(stderr, "i=%d, elem=%03d\n", i, array[i][i][i]);
Expand Down
2 changes: 2 additions & 0 deletions tests/c/float.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
3 changes: 2 additions & 1 deletion tests/c/float_binop.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// ## yk-config-env: YKB_AOT_OPTLEVEL=1
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
3 changes: 2 additions & 1 deletion tests/c/float_div.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// ## yk-config-env: YKB_AOT_OPTLEVEL=1
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
3 changes: 2 additions & 1 deletion tests/c/float_mul.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// ## yk-config-env: YKB_AOT_OPTLEVEL=1
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
2 changes: 2 additions & 0 deletions tests/c/floats.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// status: success
Expand Down
2 changes: 2 additions & 0 deletions tests/c/floats_return.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O0 -Xclang -disable-O0-optnone -Xlinker --lto-newpm-passes=instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>
// Run-time:
// env-var: YKD_LOG_IR=-:jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
2 changes: 2 additions & 0 deletions tests/c/inline_const.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
2 changes: 2 additions & 0 deletions tests/c/inst_type_depends_global.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O0 -Xclang -disable-O0-optnone -Xlinker --lto-newpm-passes=instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>
// Run-time:
// env-var: YKD_LOG_IR=-:aot
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
2 changes: 2 additions & 0 deletions tests/c/intrinsics.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O0 -Xclang -disable-O0-optnone -Xlinker --lto-newpm-passes=instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>
// Run-time:
// env-var: YKD_LOG_IR=-:jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
2 changes: 2 additions & 0 deletions tests/c/phi1.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O0 -Xclang -disable-O0-optnone -Xlinker --lto-newpm-passes=instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>
// Run-time:
// env-var: YKD_LOG_IR=-:aot,jit-pre-opt
// env-var: YK_LOG=4
Expand Down
2 changes: 2 additions & 0 deletions tests/c/phi2.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O0 -Xclang -disable-O0-optnone -Xlinker --lto-newpm-passes=instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>
// Run-time:
// env-var: YKD_LOG_IR=-:aot,jit-pre-opt
// env-var: YK_LOG=4
Expand Down
2 changes: 2 additions & 0 deletions tests/c/phi3.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O0 -Xclang -disable-O0-optnone -Xlinker --lto-newpm-passes=instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>
// Run-time:
// env-var: YKD_LOG_IR=-:aot,jit-pre-opt
// env-var: YK_LOG=4
Expand Down
2 changes: 2 additions & 0 deletions tests/c/ptradd.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O0 -Xclang -disable-O0-optnone -Xlinker --lto-newpm-passes=instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>
// Run-time:
// env-var: YKD_LOG_IR=-:aot,jit-pre-opt
// env-var: YK_LOG=4
Expand Down
2 changes: 2 additions & 0 deletions tests/c/sdiv.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
2 changes: 2 additions & 0 deletions tests/c/simple_inline.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
4 changes: 3 additions & 1 deletion tests/c/simplecall.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down Expand Up @@ -25,8 +27,8 @@
// 2
// foo
// 1
// yk-jit-event: deoptimise
// bar
// yk-jit-event: deoptimise
// 0
// exit

Expand Down
2 changes: 2 additions & 0 deletions tests/c/udiv.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
2 changes: 2 additions & 0 deletions tests/c/unintptr_t_to_ptr.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Compiler:
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_LOG_IR=-:aot
// env-var: YKD_SERIALISE_COMPILATION=1
Expand Down
7 changes: 5 additions & 2 deletions ykbuild/completion-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

# This wrapper script is used to record compiler invocations in sub-builds.
# That information can then be used for e.g. code completion purposes.
#
# It is also used to allow tests to insert extra flags into the compiler
# invocation.

set -e

echo "${YK_COMPILER_PATH} $@" > $(mktemp -p ${YK_COMPILER_TEMPDIR})
${YK_COMPILER_PATH} $@
echo "${YK_COMPILER_PATH} ${YKB_EXTRA_CC_FLAGS} $@" > $(mktemp -p ${YK_COMPILER_TEMPDIR})
${YK_COMPILER_PATH} ${YKB_EXTRA_CC_FLAGS} $@
2 changes: 1 addition & 1 deletion ykllvm

0 comments on commit 4120f1f

Please sign in to comment.