Skip to content

Commit

Permalink
fix opt plugin for llvm unit tests
Browse files Browse the repository at this point in the history
opt is now stricter in mixing old/new PM args
  • Loading branch information
nunoplopes committed Mar 20, 2022
1 parent c02e490 commit 59fa32f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scripts/opt-alive.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ set -e
PASSES="argpromotion deadargelim globalopt hotcoldsplit inline ipconstprop ipsccp mergefunc partial-inliner function-specialization =tbaa loop-extract extract-blocks safe-stack place-safepoints attributor function-attrs metarenamer sample-profile lowertypetests extract-blocks openmp-opt-cgscc prune-eh tailcallelim iroutliner globals-aa -O0 -Os -Oz -O1 -O2 -O3"
PASSREGISTRY="@LLVM_BUILD_MAIN_SRC_DIR@/lib/Passes/PassRegistry.def"

# see opt.cpp: shouldForceLegacyPM()
FORCE_OLD_NPM="safe-stack codegenprepare interleaved-load-combine unreachableblockelim atomic-expand hardware-loops interleaved-access global-merge expand-reductions indirectbr-expand pre-isel-intrinsic-lowering loop-reduce expandmemcmp"

TV="-tv"
SKIP_TV=0
for arg in $@; do
Expand Down Expand Up @@ -44,7 +47,7 @@ for arg in $@; do
set -- "$@" "$arg"
fi
else
if [[ $arg == "-enable-new-pm=0" ]]; then
if [[ $arg == "-enable-new-pm=0" || $arg == "-enable-new-pm=false" ]]; then
NPM_TV=0
fi
set -- "$@" "$arg"
Expand All @@ -55,6 +58,12 @@ for arg in $@; do
break
fi
done
for p in $FORCE_OLD_NPM; do
if [[ $arg == "-$p" ]]; then
NPM_TV=0
break
fi
done
fi
done

Expand Down

0 comments on commit 59fa32f

Please sign in to comment.