diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-11-26 00:55:59 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-11-26 00:55:59 -0800 |
commit | 8e371ae722600e4e39b2bb9129e36f894810ddf7 (patch) | |
tree | 6c262067a560a65d5918fce5db14a21e6b8b09e6 /parser.c | |
parent | c860aa452e10b450b2edeb64b6812d95e826c611 (diff) | |
download | txr-8e371ae722600e4e39b2bb9129e36f894810ddf7.tar.gz txr-8e371ae722600e4e39b2bb9129e36f894810ddf7.tar.bz2 txr-8e371ae722600e4e39b2bb9129e36f894810ddf7.zip |
compiler: another late peephole pattern.
There are six hits for this in stdlib, two of them in
optimize.tl itself. The situation is like:
label1
(instruction ...)
(jmp label3)
label2
(instruction ...)
label3
where (instruction ...) is identical in both places.
label1 and label2 are functionally identical blocks, which
means that the pattern can be rewritten as:
label1
label2
(instruction ...)
label3
When the label1 path is taken it's faster due to the
elimination of the jmp, and code size is reduced by two
instructions.
This pattern may possibly the result of an imperfection in the
design of the basic-blocks method merge-jump-thunks.
The label1 and label2 blocks are functionally identical.
But merge-jump-thunks looks strictly for blocks that end in a
jmp instruction. It's possible that there was a jmp
instruction and the end of the label2 block, which got
eliminated before merge-jump-thunks, which is done late, just
before late-peephole.
* stdlib/optimize.tl (basic-blocks late-peephole): New rule
for the above pattern.
Diffstat (limited to 'parser.c')
0 files changed, 0 insertions, 0 deletions