llvm.org GIT mirror llvm / b1788a3
Remove some clutter and make it keep going instead of stopping at the first difference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32645 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 13 years ago
1 changed file(s) with 23 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
2020 # The script operates by iteratively applying the optimizations that gccas
2121 # and gccld run until there is a difference in the assembly resulting
2222 # from the optimization. The difference is then reported with the set of
23 # optimization passes that produce the difference.
23 # optimization passes that produce the difference. The processing
24 # continues until all optimization passes have been tried. The differences
25 # for each pass, if they do differ, are placed in a diffs.# file.
2426 #
2527 # To work around differences in the assembly language format, the script
2628 # can also take two filter arguments that post-process the assembly
4951 bc1=$3
5052 bc2=$4
5153 filt1=$5
54 filt2=$6
5255 if [ -z "$filt1" ] ; then
5356 filt1="cat"
5457 fi
55 filt2=$6
5658 if [ -z "$filt2" ] ; then
5759 filt2="cat"
5860 fi
59 opt1=opt.$bc1
60 opt2=opt.$bc2
61 ll1=${bc1}.ll
62 ll2=${bc2}.ll
63 dir1="/proj/llvm/llvm-test-1/External/SPEC/CINT2000/300.twolf"
64 opt1="/proj/llvm/llvm-1/Debug/bin/opt"
65 dis1="/proj/llvm/llvm-1/Debug/bin/llvm-dis"
66 dir2="/proj/llvm/llvm-test-2/External/SPEC/CINT2000/300.twolf"
67 opt2="/proj/llvm/llvm-2/Debug/bin/opt"
68 dis2="/proj/llvm/llvm-2/Debug/bin/llvm-dis"
69 bcfile="Output/300.twolf.linked.rbc"
70 optll="opt.ll"
61 opt1="${bc1}.opt"
62 opt2="${bc2}.opt"
63 ll1="${bc1}.ll"
64 ll2="${bc2}.ll"
65 opt1ll="${bc1}.opt.ll"
66 opt2ll="${bc2}.opt.ll"
67 dis1="$llvm1/Debug/bin/llvm-dis"
68 dis2="$llvm2/Debug/bin/llvm-dis"
69 opt1="$llvm1/Debug/bin/opt"
70 opt2="$llvm2/Debug/bin/opt"
7171
7272 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 -simplifycfg -verify"
7373
74 #counter=0
7475 function tryit {
7576 switches_to_use="$1"
76 cd $dir1
77 $opt1 $switches_to_use "$bcfile" -o - | $dis1 | $filt1 > "$optll"
78 cd $dir2
79 $opt2 $switches_to_use "$bcfile" -o - | $dis2 | $filt2 > "$optll"
80 diff "$dir1/$optll" "$dir2/$optll" > /dev/null
77 $opt1 $switches_to_use "$bc1" -o - | $dis1 | $filt1 > "$opt1ll"
78 $opt2 $switches_to_use "$bc2" -o - | $dis2 | $filt2 > "$opt2ll"
79 diffs="diffs."$((counter++))
80 diff "$opt1ll" "$opt2ll" > $diffs
8181 if [ $? -ne 0 ] ; then
8282 echo
8383 echo "Diff fails with these switches:"
8484 echo $switches
8585 echo "Differences:"
86 diff "$dir1/$optll" "$dir2/$optll" | head
87 exit 1
86 head $diffs
87 echo 'Switches:' $switches_to_use >> $diffs
88 else
89 rm $diffs
8890 fi
8991 return 1
9092 }