wanted: smarter analysis of interaction between statements
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) |
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...)