Improved optimization of CONCATENATE

Bug #1953637 reported by Paul F. Dietz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Wishlist
Unassigned

Bug Description

Calls to CONCATENATE with (some) constant arguments can be simplified by combining some of the constants together. For example, currently

(disassemble (lambda () (concatenate 'string "foo" "bar"))

=>

; disassembly for (LAMBDA ())
; Size: 39 bytes. Origin: #x536DB40C ; (LAMBDA ())
; 0C: 498B4510 MOV RAX, [R13+16] ; thread.binding-stack-pointer
; 10: 488945F8 MOV [RBP-8], RAX
; 14: 488B15BDFFFFFF MOV RDX, [RIP-67] ; "foo"
; 1B: 488B3DBEFFFFFF MOV RDI, [RIP-66] ; "bar"
; 22: B904000000 MOV ECX, 4
; 27: FF7508 PUSH QWORD PTR [RBP+8]
; 2A: B8A2C93550 MOV EAX, #x5035C9A2 ; #<FDEFN SB-KERNEL:%CONCATENATE-TO-STRING>
; 2F: FFE0 JMP RAX
; 31: CC10 INT3 16

but these two string constants could be combined (the code would still have to copy that combined string, though.)

Stas Boukarev (stassats)
Changed in sbcl:
importance: Undecided → Wishlist
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.