[Issue 20189] Codegen - functions that call other functions with the same arguments do redundant copying between stack and registers.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 3 02:18:41 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20189

--- Comment #1 from elronnd at elronnd.net ---
Ideally, a fix would also handle partial or complete argument reordering -- so
if first() called second(b, a), then all the stack munging could just be
straight 'xchg esi, edi'.  (However, making that work in more complicated
functions that pass many arguments--some from their own arguments, others from
local variables--would probably require a lot more effort, and mess with the
register allocator quite a bit: is it worth it to place this local variable in
a register instead of on the stack, knowing that means clobbering that register
so it will have to be restored later?)

--


More information about the Digitalmars-d-bugs mailing list