This patch makes template instantiations be already performed in the PCH instead of it being done in every single file that uses the PCH (but every single file will still do it as well in order to handle its own instantiations). I can see 20-30% build time saved with the few tests I've tried.
The delaying of template instantiations until the PCH is used comes from 7f76d11dcc9196e1fc9d1308da9ed2330a6b06c2 , which doesn't really give any useful reasoning for it, except for extending a unittest, which however now passes even with the instantiation moved back into the PCH. It is still possible that an instantiation may need to be done only in the TU, but the patch should detect and handle that.
I've built a complete debug build of LibreOffice with the patch and everything seems to work fine.
The change itself is rather simple, but ~22 tests fail merely because this change reorders things differently than the tests expect, without any actual change.