diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-11-13 16:08:51 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-11-13 16:08:51 +0000 |
commit | 024409995684ed37250a0d6dec4956316368a42a (patch) | |
tree | 03d4b5d948b7c4b15f19da4a14478ddaca9b8c5e /utils | |
parent | 7cbe67d789e57e49d1781f710341d16d20b4d601 (diff) |
Add some output so the user is informed while they wait.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/findmisopt | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/utils/findmisopt b/utils/findmisopt index 2f5745b0ea4..80b8006178e 100755 --- a/utils/findmisopt +++ b/utils/findmisopt @@ -54,6 +54,15 @@ echo "Test Name: $name" echo "Unoptimized program: $prog" echo " Optimized program: $optprog" +# Create output directory if it doesn't exist +if [ -f "$outdir" ] ; then + echo "$outdir is not a directory" + exit 1 +fi + +if [ ! -d "$outdir" ] ; then + mkdir "$outdir" || exit 1 +fi # Generate the disassembly llvm-dis "$bcfile" -o "$ll" -f || exit 1 @@ -72,9 +81,9 @@ function tryit { llvm-dis "$optbc" -o "$optll" -f || exit llc "$optbc" -o "$opts" -f || exit gcc "$opts" -o "$optprog" -lstdc++ -lc -lm || exit - "$prog" $args > "$out" + "$prog" $args > "$out" 2>&1 ex1=$? - "$optprog" $args > "$optout" + "$optprog" $args > "$optout" 2>&1 ex2=$? if [ -n "$match" ] ; then @@ -98,7 +107,9 @@ function tryit { return 1 } +echo "Trying to find optimization that breaks program:" for sw in $all_switches ; do + echo -n " $sw" switches="$switches $sw" if tryit "$switches" ; then break; @@ -123,7 +134,7 @@ while [ ! -z "$switches" ] ; do done if [ "$final" == " $all_switches" ] ; then - echo "findmisopt: Can't find a set of optimizations that make it fail" + echo "findmisopt: All optimizations pass. Perhaps this isn't a misopt?" exit 0 fi echo "Smallest Optimization list=$final" |