diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-07-28 18:38:49 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-07-28 18:38:49 -0700 |
commit | 2fa7edd7d034c4af4325b1dbe7bf59942bc977b6 (patch) | |
tree | 81094328ac5c57d0c81ab583996a46089396e37e | |
parent | 448177d2b7e54aeda8d825b1ab2cce260e9261ef (diff) | |
download | txr-2fa7edd7d034c4af4325b1dbe7bf59942bc977b6.tar.gz txr-2fa7edd7d034c4af4325b1dbe7bf59942bc977b6.tar.bz2 txr-2fa7edd7d034c4af4325b1dbe7bf59942bc977b6.zip |
compiler: use partition-if for basic block division.
* stdlib/optimize.tl (basic-blocks :postinit): Calculate the
basic block partitions more directly using partition-if,
eliminating the calculation of two sequences of indices
that have to be merged and then passed to the partition
function.
-rw-r--r-- | stdlib/optimize.tl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/stdlib/optimize.tl b/stdlib/optimize.tl index 908b7e0d..3ca7f07c 100644 --- a/stdlib/optimize.tl +++ b/stdlib/optimize.tl @@ -74,11 +74,11 @@ (:postinit (bb) (let* ((insns (early-peephole (dedup-labels (cons bb.start bb.insns)))) - (cuts (merge [where symbolp insns] - [where [andf consp - (op memq (car @1) bb.jump-ops)] - (cons nil insns)])) - (parts (partition insns cuts)) + (parts (partition-if (lambda (prev next) + (or (symbolp next) + (and (consp prev) + (memq (car prev) bb.jump-ops)))) + insns)) (lparts (mapcar [iff [chain car symbolp] use (op cons (gensym))] |