wanted: smarter analysis of interaction between statements

Bug #643470 reported by Roman Marynchak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Won't Fix
Wishlist
Unassigned

Bug Description

This code

(defun f (x)
 (incf x)
 (incf x)
 (incf x)
 (incf x)
 (incf x)
 (incf x)
 (incf x)
 (incf x)
 (incf x)
 x)

compiles into a series of calls

...

; 4F8: E8D32C29FE CALL #x220001D0 ; GENERIC-+
; 4FD: 7302 JNB L6
; 4FF: 8BE3 MOV ESP, EBX
; 501: L6: 8BC2 MOV EAX, EDX
; 503: BF04000000 MOV EDI, 4
; 508: 8BD0 MOV EDX, EAX
; 50A: E8C12C29FE CALL #x220001D0 ; GENERIC-+
; 50F: 7302 JNB L7
; 511: 8BE3 MOV ESP, EBX
; 513: L7: 8BC2 MOV EAX, EDX
; 515: BF04000000 MOV EDI, 4
; 51A: 8BD0 MOV EDX, EAX
; 51C: E8AF2C29FE CALL #x220001D0 ; GENERIC-+

...

instead of making the single increment. While the example itself is trivial and even 'useless', it shows the absence of this feature.

Changed in sbcl:
assignee: nobody → Roman Marynchak (roman-marynchak)
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

Roman, if you're not actually working on this, please mark this as confirmed and remove the assignment. Literature pointers would also be good, of course.

(I seriously doubt if this is an important optimization for 99% of code out there, but I've been wrong before...)

Changed in sbcl:
importance: Undecided → Wishlist
status: New → In Progress
tags: added: compiler optimization
Revision history for this message
Roman Marynchak (roman-marynchak) wrote :

I was asked to prepare CLOS implementation presentation at my daily job (we have some standard promotion scheme, which requires presentations preparation from time to time), so I read about it and I have some plans to review (or even fix/improve) our PCL code as well. So, SSA/optimizations activities are suspended at this time, and I am marking this issue as you have suggested.

Changed in sbcl:
status: In Progress → Confirmed
assignee: Roman Marynchak (roman-marynchak) → nobody
Revision history for this message
Douglas Katzman (dougk) wrote :

too open-ended to be actionable

Changed in sbcl:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.