On 12/07/2012 13:50, Tobias Pankrath wrote:
Another weapon to attack the problem is introducing in the DMD
back-end an optimization (already present in LLVM, but I think not
used on default), merging of functions with the same body (leaving
just a jump as the body of the removed function, to keep their
function pointers distinct).

Why not drop that requirement? What is the use case of different
function pointers for different but equivalent functions? Does anyone
depend on this?

Nothing prevent the linker to link directly to the new function if the body is only a branch instruction. This have a cost only when doing indirect call, and the indirect call is greater than a branch instruction.

Reply via email to