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 | 3993e7473a1a7eba4181c8cc6e16255d76b8bf52 (patch) | |
tree | 81094328ac5c57d0c81ab583996a46089396e37e /stdlib | |
parent | 95b77ddddc32115d185b84e4a4ec896de5bc398d (diff) | |
download | txr-3993e7473a1a7eba4181c8cc6e16255d76b8bf52.tar.gz txr-3993e7473a1a7eba4181c8cc6e16255d76b8bf52.tar.bz2 txr-3993e7473a1a7eba4181c8cc6e16255d76b8bf52.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.
Diffstat (limited to 'stdlib')
-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))] |