summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-11-29 07:12:49 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-11-29 07:12:49 -0800
commitdf63481b5964133ee7853eef47a35da190219a7b (patch)
tree6f4ffec174634a3fc0def7db552b4e814a12b7af
parentd81dd6735cbc12007dd3857ea1f62077a1baf132 (diff)
downloadtxr-df63481b5964133ee7853eef47a35da190219a7b.tar.gz
txr-df63481b5964133ee7853eef47a35da190219a7b.tar.bz2
txr-df63481b5964133ee7853eef47a35da190219a7b.zip
compiler: revise no-longer-matching late peephole case.
* stdlib/optimize.tl (basic-blocks late-peephole): This pattern doesn't match any more because of code removed by the previous commit. If we shorten it by removing the lab1 block, then it matches. Because the pattern is shorter, the reduction being performed by the replacement is no longer needed; it has already been done. The remaining value is that threads the jump from lab3 to lab4. This missing threading is what I noticed when evaluating the effects of the previous patch; this restores it.
-rw-r--r--stdlib/optimize.tl17
1 files changed, 3 insertions, 14 deletions
diff --git a/stdlib/optimize.tl b/stdlib/optimize.tl
index 2274e424..a8e4ba9d 100644
--- a/stdlib/optimize.tl
+++ b/stdlib/optimize.tl
@@ -601,25 +601,14 @@
,*rest))))
(((mov (t @tn) (d @dn))
(jmp @lab3)
- @lab1
- (mov (t @tn) (t 0))
- (jmp @lab3)
@lab2
(mov (t @tn) (t 0))
@(symbolp @lab3)
(ifq (t @tn) (t 0) @lab4)
. @rest)
- (let ((lab5 (gensym "nl")))
- ^((mov (t ,tn) (d ,dn))
- (jmp ,lab4)
- ,lab1
- ,lab2
- (mov (t ,tn) (t 0))
- (jmp ,lab5)
- ,lab3
- (ifq (t ,tn) (t 0) ,lab4)
- ,lab5
- ,*rest)))
+ ^(,(car insns)
+ (jmp ,lab4)
+ ,*(cddr insns)))
(((mov (t @tx) (t @ty))
(if (t @ty) @lab2)
@(symbolp @lab1)