It's not DMD doing a good job here, but GDC11 shooting itself in the foot by requiring additional esoteric command line options if you really want to produce optimized binaries.
The D language shot itself in the foot by requiring templates to have weak semantics.
If DMD and LDC inline weak functions, that's their bug.