[m-rev.] For review: eliminate some while loop labels

Zoltan Somogyi zoltan.somogyi at runbox.com
Wed Jan 22 15:57:51 AEDT 2014


I was originally looking to fix the problem caused by multi-line gcc error messages by eliminating the source of the problem. The first multiline error message I looked up happened to be a label that started a while loop, and wasn't referred to from anywhere else, since all the gotos to it have been turned into "continue" statements. So I wrote this diff to eliminate all such labels.

Short afterwards I realized that (a) the problem occurs even for labels that start predicates, so it cannot be completely eliminated this way, and (b) this diff is nevertheless useful, because it can yield a speedup. Here is the output of speedtest. Both versions have a version of this diff, but only in the second is it enabled.

EXTRA_MCFLAGS = 
GRADE = asm_fast.gc.stseg
mercury_compile.01 9.722u 0.204s 0:09.94 99.7%  0+0k 0+15344io 0pf+0w
mercury_compile.01 9.670u 0.071s 0:09.77 99.6%  0+0k 0+15280io 0pf+0w
mercury_compile.01 9.563u 0.095s 0:09.68 99.6%  0+0k 0+15280io 0pf+0w
mercury_compile.01 9.779u 0.055s 0:09.84 99.7%  0+0k 0+15280io 0pf+0w
mercury_compile.01 9.790u 0.055s 0:09.85 99.8%  0+0k 0+15280io 0pf+0w
mercury_compile.01 9.639u 0.067s 0:09.71 99.7%  0+0k 0+15280io 0pf+0w
EXTRA_MCFLAGS = --experiment=uwl
GRADE = asm_fast.gc.stseg
mercury_compile.02 9.567u 0.047s 0:09.62 99.7%  0+0k 0+15280io 0pf+0w
mercury_compile.02 9.514u 0.072s 0:09.60 99.7%  0+0k 0+15280io 0pf+0w
mercury_compile.02 9.533u 0.059s 0:09.60 99.7%  0+0k 0+15280io 0pf+0w
mercury_compile.02 9.676u 0.071s 0:09.76 99.7%  0+0k 0+15280io 0pf+0w
mercury_compile.02 9.657u 0.047s 0:09.75 99.3%  0+0k 40+15280io 0pf+0w
mercury_compile.02 9.674u 0.059s 0:09.74 99.7%  0+0k 0+15280io 0pf+0w

The average times are 9.70 and 9.61, which is a 1% speedup.

For review by anyone.

Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Log
Type: application/octet-stream
Size: 823 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20140122/ddf2b8d4/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.undef_while_labels
Type: application/octet-stream
Size: 31196 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20140122/ddf2b8d4/attachment-0001.obj>


More information about the reviews mailing list