aboutsummaryrefslogtreecommitdiff
path: root/utils/findmisopt
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-11-16 18:32:47 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-11-16 18:32:47 +0000
commita8c3ff456aedbc55ac5ccd853e721812d0369ea0 (patch)
tree974c25a73a60b81d60ac24ab6fa5d2b0f30f0bd3 /utils/findmisopt
parentcb53595d70c33c2f11b9dd95653649372a5fe489 (diff)
Use a release version of bugpoint, if found. Include gccld passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31786 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/findmisopt')
-rwxr-xr-xutils/findmisopt24
1 files changed, 19 insertions, 5 deletions
diff --git a/utils/findmisopt b/utils/findmisopt
index 80b8006178..cb390aa7ef 100755
--- a/utils/findmisopt
+++ b/utils/findmisopt
@@ -12,7 +12,9 @@
# uses (in the same order) and will narrow down which optimizations
# cause the program either generate different output or return a
# different result code. When the passes have been narrowed down,
-# bugpoint is invoked to further refine the problem to its origin.
+# bugpoint is invoked to further refine the problem to its origin. If a
+# release version of bugpoint is available it will be used, otherwise
+# debug.
#
# Usage:
# findmisopt bcfile outdir progargs [match]
@@ -24,7 +26,7 @@
# is a directory into which intermediate results are placed
# progargs
# is a single argument containing all the arguments the program needs
-# match
+# match
# if specified to any value causes the result code of the program to
# be used to determine success/fail. If not specified success/fail is
# determined by diffing the program's output with the non-optimized
@@ -35,6 +37,16 @@ if [ "$#" -lt 3 ] ; then
exit 1
fi
+dir="${0%%/utils/findmisopt}"
+if [ -x "$dir/Release/bin/bugpoint" ] ; then
+ bugpoint="$dir/Release/bin/bugpoint"
+elif [ -x "$dir/Debug/bin/bugpoint" ] ; then
+ bugpoint="$dir/Debug/bin/bugpoint"
+else
+ echo "findmisopt: bugpoint not found"
+ exit 1
+fi
+
bcfile="$1"
outdir="$2"
args="$3"
@@ -71,8 +83,9 @@ llvm-dis "$bcfile" -o "$ll" -f || exit 1
llc "$bcfile" -o "$s" -f || exit 1
gcc "$s" -o "$prog" -lstdc++ -lc -lm || exit 1
-# Define the list of optimizations to run
-all_switches="-verify -lowersetjmp -funcresolve -raiseallocs -simplifycfg -mem2reg -globalopt -globaldce -ipconstprop -deadargelim -instcombine -simplifycfg -prune-eh -inline -simplify-libcalls -argpromotion -raise -tailduplicate -simplifycfg -scalarrepl -instcombine -predsimplify -condprop -tailcallelim -simplifycfg -reassociate -licm -loop-unswitch -instcombine -indvars -loop-unroll -instcombine -load-vn -gcse -sccp -instcombine -condprop -dse -dce -simplifycfg -deadtypeelim -constmerge"
+# Define the list of optimizations to run. This comprises the same set of
+# optimizations that gccas and gccld run, in the same order.
+all_switches="-verify -lowersetjmp -funcresolve -raiseallocs -simplifycfg -mem2reg -globalopt -globaldce -ipconstprop -deadargelim -instcombine -simplifycfg -prune-eh -inline -simplify-libcalls -argpromotion -raise -tailduplicate -simplifycfg -scalarrepl -instcombine -predsimplify -condprop -tailcallelim -simplifycfg -reassociate -licm -loop-unswitch -instcombine -indvars -loop-unroll -instcombine -load-vn -gcse -sccp -instcombine -condprop -dse -dce -simplifycfg -deadtypeelim -constmerge -funcresolve -internalize -ipsccp -globalopt -constmerge -deadargelim -inline -prune-eh -globalopt -globaldce -argpromotion -instcombine -predsimplify -scalarrepl -globalsmodref-aa -licm -load-vn -gcse -dse -instcombine -simplify-cfg -verify"
# Current set of switches is empty
function tryit {
@@ -138,7 +151,8 @@ if [ "$final" == " $all_switches" ] ; then
exit 0
fi
echo "Smallest Optimization list=$final"
-bpcmd="bugpoint -run-llc --output "$out" --input /dev/null $bcfile $final --args $args"
+
+bpcmd="$bugpoint -run-llc -disable-loop-extraction --output "$out" --input /dev/null $bcfile $final --args $args"
echo "Running: $bpcmd"
$bpcmd