[Interest] Tempalted QObjects

Thiago Macieira thiago.macieira at intel.com
Thu Feb 25 00:23:46 CET 2016


On quarta-feira, 24 de fevereiro de 2016 22:28:23 PST Jean-Michaƫl Celerier 
wrote:
> On Wed, Feb 24, 2016 at 8:50 PM, Thiago Macieira <thiago.macieira at intel.com>
> wrote:
> > no compilers is currently able to merge implementations that
> > produce the same code, if they come from different functions.
> 
> Isn't this what MSVC's /OPT:ICF (
> https://msdn.microsoft.com/en-us/library/bxwfs976%28v=vs.140%29.aspx)

I've never seen that before. I'll need to take a better look.

> and gcc's -ffunction-sections -fdata-sections --gc-sections 

No.

> or gold's --icf

Kinda. As the link you pointed out:

> https://gcc.gnu.org/ml/gcc-patches/2014-06/msg01499.html

Says, a compiler-based ICF is more efficient than a linker-based ICF. The linker 
can only do ICF if you've compiled with -ffunction-sections and can only do it 
at function granularity. The compiler can do better.

> 
> do ? (although maybe not with a 100% hit rate).
> 
> A quick research has shown that clang contains a "mergefunc" option but it
> does not seem to be production-quality.

It looks like the GCC option -fipa-icf is already enabled at -O2 level and has 
been for some time. That is good, but given that I am still seeing duplicate 
code where strict analysis says it isn't needed, it means there's still a long 
way to go for the compilers to do the heavy-lifting.

Helping the compiler is still necessary.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list