[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 02/25: Fix specialization of the allocate-words family o
From: |
Andy Wingo |
Subject: |
[Guile-commits] 02/25: Fix specialization of the allocate-words family of instructions |
Date: |
Mon, 8 Jan 2018 09:25:01 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit 7162c758b3d2dc1cd713136e228e24204223d1bc
Author: Andy Wingo <address@hidden>
Date: Fri Jan 5 19:51:17 2018 +0100
Fix specialization of the allocate-words family of instructions
* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
Fix specialization of allocate-words and friends.
---
module/language/cps/specialize-primcalls.scm | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/module/language/cps/specialize-primcalls.scm
b/module/language/cps/specialize-primcalls.scm
index 9767ee4..b791a20 100644
--- a/module/language/cps/specialize-primcalls.scm
+++ b/module/language/cps/specialize-primcalls.scm
@@ -1,6 +1,6 @@
;;; Continuation-passing style (CPS) intermediate language (IL)
-;; Copyright (C) 2013, 2014, 2015, 2017 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2015, 2017-2018 Free Software Foundation, Inc.
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -115,7 +115,9 @@
(define-syntax-rule (specialize-case (pat (op c (arg ...))) ...)
(match (cons name args)
(pat
- (compute-constant c (build-exp ($primcall 'op c (arg ...)))))
+ (let* ((param* (intmap-ref constants c))
+ (param (if param (cons param param*) param*)))
+ (build-exp ($primcall 'op param (arg ...)))))
...
(_ #f)))
(specialize-case
@@ -125,11 +127,11 @@
(('allocate-struct v (? uint? n)) (allocate-struct/immediate n (v)))
(('struct-ref s (? uint? n)) (struct-ref/immediate n (s)))
(('struct-set! s (? uint? n) x) (struct-set!/immediate n (s x)))
- (('allocate-words (? uint? n)) (allocate-words/immediate (n (cons
param n)) ()))
- (('scm-ref o (? uint? i)) (scm-ref/immediate (i (cons param i)) (o)))
- (('scm-set! o (? uint? i) x) (scm-set!/immediate (i (cons param i)) (o
x)))
- (('word-ref o (? uint? i)) (word-ref/immediate (i (cons param i)) (o)))
- (('word-set! o (? uint? i) x) (word-set!/immediate (i (cons param i))
(o x)))
+ (('allocate-words (? uint? n)) (allocate-words/immediate n ()))
+ (('scm-ref o (? uint? i)) (scm-ref/immediate i (o)))
+ (('scm-set! o (? uint? i) x) (scm-set!/immediate i (o x)))
+ (('word-ref o (? uint? i)) (word-ref/immediate i (o)))
+ (('word-set! o (? uint? i) x) (word-set!/immediate i (o x)))
(('add x (? num? y)) (add/immediate y (x)))
(('add (? num? y) x) (add/immediate y (x)))
(('sub x (? num? y)) (sub/immediate y (x)))
- [Guile-commits] 19/25: Expand pair-related primcalls, (continued)
- [Guile-commits] 19/25: Expand pair-related primcalls, Andy Wingo, 2018/01/08
- [Guile-commits] 16/25: Re-add compiler backend support for immutable vectors, Andy Wingo, 2018/01/08
- [Guile-commits] 25/25: Save VM compare result before calling out to hooks, Andy Wingo, 2018/01/08
- [Guile-commits] 01/25: Fix verify.scm for call-thunk/no-inline, Andy Wingo, 2018/01/08
- [Guile-commits] 22/25: Better compilation of vector constructors and initializers, Andy Wingo, 2018/01/08
- [Guile-commits] 08/25: Instruction explosion for /immediate variants of vector prims, Andy Wingo, 2018/01/08
- [Guile-commits] 06/25: Fix primitive reification for scm-set! / word-set!., Andy Wingo, 2018/01/08
- [Guile-commits] 17/25: Compiler frontend support for vector mutability checks, Andy Wingo, 2018/01/08
- [Guile-commits] 23/25: Improve make-vector compilation for known big sizes, Andy Wingo, 2018/01/08
- [Guile-commits] 04/25: Make integer devirtualization less eager, Andy Wingo, 2018/01/08
- [Guile-commits] 02/25: Fix specialization of the allocate-words family of instructions,
Andy Wingo <=
- [Guile-commits] 14/25: Fix bug in struct-ref effects analysis, Andy Wingo, 2018/01/08
- [Guile-commits] 20/25: Remove special optimizer and backend support for pairs, Andy Wingo, 2018/01/08