Improved optimization of CONCATENATE
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.
; 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:
; 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.)
Changed in sbcl: | |
importance: | Undecided → Wishlist |