diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-03-03 08:37:48 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-03-03 08:37:48 -0800 |
commit | d6b6dfcf6b8adcb6c2fbc453c2c0fcbf3a27cbc3 (patch) | |
tree | 0338c87ec7a942b553741bcd196ae618b5411b54 /lisplib.c | |
parent | 87ad7742d1fb7dd757f37dbf922eb30872e1b8ed (diff) | |
download | txr-d6b6dfcf6b8adcb6c2fbc453c2c0fcbf3a27cbc3.tar.gz txr-d6b6dfcf6b8adcb6c2fbc453c2c0fcbf3a27cbc3.tar.bz2 txr-d6b6dfcf6b8adcb6c2fbc453c2c0fcbf3a27cbc3.zip |
compiler: new late-peephole pass.
I noticed a lot of this in compiled code:
(if reg label1)
label2
(jmp label3)
label1
by inverting the test, this can be shortened to
(ifq reg (t 0) label2)
label1
We must keep label1 in case it is the target of other
branches. Also, we only perform this if label2 is unreachable:
the (jmp label3) instruction is reached only when the previous
if branch is not taken.
* share/txr/stdlib/optimize.tl (basic-blocks get-insns): Call
new late-peephole method.
(basic-blocks late-peephole): New method, incorporating the
above pattern.
Diffstat (limited to 'lisplib.c')
0 files changed, 0 insertions, 0 deletions