[llvm-commits] CVS: llvm/utils/findmisopt
Reid Spencer
reid at x10sys.com
Mon Nov 13 08:09:06 PST 2006
Changes in directory llvm/utils:
findmisopt updated: 1.4 -> 1.5
---
Log message:
Add some output so the user is informed while they wait.
---
Diffs of the changes: (+14 -3)
findmisopt | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
Index: llvm/utils/findmisopt
diff -u llvm/utils/findmisopt:1.4 llvm/utils/findmisopt:1.5
--- llvm/utils/findmisopt:1.4 Sat Nov 11 04:22:48 2006
+++ llvm/utils/findmisopt Mon Nov 13 10:08:51 2006
@@ -54,6 +54,15 @@
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 @@
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 @@
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 @@
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"
More information about the llvm-commits
mailing list