bugMIT/GNU Scheme - Bugs: bug #27885, last year's changes to global...

 
 

bug #27885: last year's changes to global primitives defeated LIAR's constant folding

Submitter:  Taylor R. Campbell <riastradh>
Submitted:  Fri 30 Oct 2009 09:18:00 PM UTC
   
 
Category:  compiler Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Suboptimal behavior
Status:  Fixed Privacy:  Public
Assigned to:  riastradh Originator Name: 
Open/Closed:  Closed
Keywords: 
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 01 Nov 2009 10:02:26 PM UTC, comment #2: 

Should be fixed in commit 7451c947a397e4e68106dc9fb6afd324b949e167.

Taylor R. Campbell <riastradh>
Group Member
Sat 31 Oct 2009 08:38:05 PM UTC, comment #1: 

This is worse than I thought -- failure to fold constants causes more problems than just inefficiency:

(compile-procedure
 (eval `(LAMBDA () (,(make-primitive-procedure 'INTEGER-MULTIPLY) 1 2))
       (nearest-repl/environment)))
;CGEN-RINST: No matching rules (assign (register 19) (fixnum-2-args multiply-fixnum (object->fixnum (constant 1)) (object->fixnum (constant 2)) #t))

Remarkably, in the run-time system, the one use of INT:* following this pattern (in random.scm's LARGE-RANDOM-INTEGER) has operands exceeding 26 bits, so the i386 back end never complained, because RTL:CONSTANT-COST made RTL common subexpression elimination avoid this particular RTL instruction.

Taylor R. Campbell <riastradh>
Group Member
Fri 30 Oct 2009 09:18:00 PM UTC, original submission:  

Since most the values of most global variables that correspond with primitives are not actually primitives, but rather compiled procedures that invoke the primitives, LIAR's constant folder no longer believes them to be constant-foldable operators.

Taylor R. Campbell <riastradh>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by riastradh (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-12-17 riastradh StatusReady For Test Fixed
        Assigned toNone riastradh
        Open/ClosedOpen Closed
    2009-11-01 riastradh StatusNone Ready For Test
    2009-10-30 riastradh CategoryNone compiler
        Item GroupNone Suboptimal behavior

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code