Skip to content

Commit 59fa32f

Browse files
committed
fix opt plugin for llvm unit tests
opt is now stricter in mixing old/new PM args
1 parent c02e490 commit 59fa32f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scripts/opt-alive.sh.in

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ set -e
1313
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"
1414
PASSREGISTRY="@LLVM_BUILD_MAIN_SRC_DIR@/lib/Passes/PassRegistry.def"
1515

16+
# see opt.cpp: shouldForceLegacyPM()
17+
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"
18+
1619
TV="-tv"
1720
SKIP_TV=0
1821
for arg in $@; do
@@ -44,7 +47,7 @@ for arg in $@; do
4447
set -- "$@" "$arg"
4548
fi
4649
else
47-
if [[ $arg == "-enable-new-pm=0" ]]; then
50+
if [[ $arg == "-enable-new-pm=0" || $arg == "-enable-new-pm=false" ]]; then
4851
NPM_TV=0
4952
fi
5053
set -- "$@" "$arg"
@@ -55,6 +58,12 @@ for arg in $@; do
5558
break
5659
fi
5760
done
61+
for p in $FORCE_OLD_NPM; do
62+
if [[ $arg == "-$p" ]]; then
63+
NPM_TV=0
64+
break
65+
fi
66+
done
5867
fi
5968
done
6069

0 commit comments

Comments
 (0)