diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-04-10 00:49:55 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-04-10 00:49:55 -0700 |
commit | a6e3a7aabd3563120afdac87d1788e891a359ced (patch) | |
tree | 03294b67db00c3c8f178ba304f7bc87259c36495 | |
parent | 80de7a55930bb213b7901148e1e3f9624d1adef5 (diff) | |
download | txr-a6e3a7aabd3563120afdac87d1788e891a359ced.tar.gz txr-a6e3a7aabd3563120afdac87d1788e891a359ced.tar.bz2 txr-a6e3a7aabd3563120afdac87d1788e891a359ced.zip |
compiler: buggy t-reg move peephole case.
* stdlib/optimize.tl (basic-blocks do-peephole-block): In the
unnecessary copying t-reg case, let's just stay away from
doing it if the source operand is a v-reg. It breaks under the
recent "eval order of variables" commit, indicating that the
conditions that it uses for replacing a v-reg with the t-reg
are not correct. The most likely reason is that the v-reg
can be assigned, but this doesn't show up in the liveness
info which tracks only t-regs.
-rw-r--r-- | stdlib/optimize.tl | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/stdlib/optimize.tl b/stdlib/optimize.tl index 8651db00..7b495617 100644 --- a/stdlib/optimize.tl +++ b/stdlib/optimize.tl @@ -390,9 +390,7 @@ ;; unnecessary copying t-reg (@(require ((mov @(as dst (t @n)) @src) . @rest) (only-locally-used-treg (car insns) n) - (or (neq (car src) 'v) - (none rest [andf [chain car (op eq 'end)] - [chain bb.li-hash .used (lop bit n)]])) + (neq (car src) 'v) (not (find dst rest : [chain bb.li-hash .def])) (not (find src rest : [chain bb.li-hash .def]))) (pushnew bl bb.rescan) |