X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=utils%2Ffindmisopt;h=f2a872c6dc3e70f85f3fa4f4e26fa25d529756f8;hb=cfbece50f602c561c5eac046bcfc9a07c8c006cb;hp=2c1dc0812aafe73eb103e6b34c52e87f76e7ba94;hpb=90a2eb02e50f171866d03aab56db868c3f3a1cec;p=oota-llvm.git diff --git a/utils/findmisopt b/utils/findmisopt index 2c1dc0812aa..f2a872c6dc3 100755 --- a/utils/findmisopt +++ b/utils/findmisopt @@ -7,7 +7,7 @@ # it from finding a problem unless the set of failing optimizations are # known and given to it on the command line. # -# Given a bytecode file that produces correct output (or return code), +# Given a bitcode file that produces correct output (or return code), # this script will run through all the optimizations passes that gccas # uses (in the same order) and will narrow down which optimizations # cause the program either generate different output or return a @@ -21,7 +21,7 @@ # # Where: # bcfile -# is the bytecode file input (the unoptimized working case) +# is the bitcode file input (the unoptimized working case) # outdir # is a directory into which intermediate results are placed # progargs @@ -73,6 +73,13 @@ echo "Test Name: $name" echo "Unoptimized program: $prog" echo " Optimized program: $optprog" +# Define the list of optimizations to run. This comprises the same set of +# optimizations that opt -std-compile-opts and gccld run, in the same order. +opt_switches=`llvm-as < /dev/null -o - | opt -std-compile-opts -disable-output -debug-pass=Arguments 2>&1 | sed 's/Pass Arguments: //'` +ld_switches=`llvm-as < /dev/null -o - | llvm-ld - -debug-pass=Arguments 2>&1 | sed 's/Pass Arguments: //'` +all_switches="$opt_switches $ld_switches" +echo "Passes : $all_switches" + # Create output directory if it doesn't exist if [ -f "$outdir" ] ; then echo "$outdir is not a directory" @@ -92,13 +99,6 @@ gcc "$s" -o "$prog" $ldflags || exit 1 "$prog" $args > "$out" 2>&1 <$input ex1=$? -# Define the list of optimizations to run. This comprises the same set of -# optimizations that opt -std-compile-opts and gccld run, in the same order. -opt_switches=`llvm-as < /dev/null -o - | opt -std-compile-opts -disable-output -debug-pass=Arguments 2>&1 | sed 's/Pass Arguments: //'` -gccld_switches="-internalize -ipsccp -globalopt -constmerge -deadargelim -inline -prune-eh -globalopt -globaldce -argpromotion -instcombine -predsimplify -scalarrepl -globalsmodref-aa -licm -load-vn -gcse -dse -instcombine -simplifycfg -verify" -all_switches="$opt_switches $gccld_switches" -echo "Passes : $all_switches" - # Current set of switches is empty function tryit { switches_to_use="$1"