llvm.org GIT mirror llvm / a8c3ff4
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 Reid Spencer 14 years ago
1 changed file(s) with 19 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
1111 # uses (in the same order) and will narrow down which optimizations
1212 # cause the program either generate different output or return a
1313 # different result code. When the passes have been narrowed down,
14 # bugpoint is invoked to further refine the problem to its origin.
14 # bugpoint is invoked to further refine the problem to its origin. If a
15 # release version of bugpoint is available it will be used, otherwise
16 # debug.
1517 #
1618 # Usage:
1719 # findmisopt bcfile outdir progargs [match]
2325 # is a directory into which intermediate results are placed
2426 # progargs
2527 # is a single argument containing all the arguments the program needs
26 # match
28 # match
2729 # if specified to any value causes the result code of the program to
2830 # be used to determine success/fail. If not specified success/fail is
2931 # determined by diffing the program's output with the non-optimized
3133 #
3234 if [ "$#" -lt 3 ] ; then
3335 echo "usage: findmisopt bcfile outdir progargs [match]"
36 exit 1
37 fi
38
39 dir="${0%%/utils/findmisopt}"
40 if [ -x "$dir/Release/bin/bugpoint" ] ; then
41 bugpoint="$dir/Release/bin/bugpoint"
42 elif [ -x "$dir/Debug/bin/bugpoint" ] ; then
43 bugpoint="$dir/Debug/bin/bugpoint"
44 else
45 echo "findmisopt: bugpoint not found"
3446 exit 1
3547 fi
3648
7082 llc "$bcfile" -o "$s" -f || exit 1
7183 gcc "$s" -o "$prog" -lstdc++ -lc -lm || exit 1
7284
73 # Define the list of optimizations to run
74 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"
85 # Define the list of optimizations to run. This comprises the same set of
86 # optimizations that gccas and gccld run, in the same order.
87 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"
7588
7689 # Current set of switches is empty
7790 function tryit {
137150 exit 0
138151 fi
139152 echo "Smallest Optimization list=$final"
140 bpcmd="bugpoint -run-llc --output "$out" --input /dev/null $bcfile $final --args $args"
153
154 bpcmd="$bugpoint -run-llc -disable-loop-extraction --output "$out" --input /dev/null $bcfile $final --args $args"
141155
142156 echo "Running: $bpcmd"
143157 $bpcmd