gentooLTO icon indicating copy to clipboard operation
gentooLTO copied to clipboard

`-fipa-pta` drastically increases compilation time

Open yshui opened this issue 2 years ago • 11 comments

I noticed this when building renderdoc. With -fipa-pta, the build lasted more than 8 hours, and I had to interrupt it. Without it, the build finished in a couple of minutes.

There are other examples, not as dramatic, usually it's single digit minutes -> half an hour-ish.

How much does -fipa-pta help performance? Is it worthwhile?

yshui avatar Aug 29 '22 20:08 yshui

What -fipa-pta does: http://stackoverflow.com/questions/13066663/ddg#13076073

TheMBL09898 avatar Aug 29 '22 20:08 TheMBL09898

@TheMBL09898 Thanks, but I feel that doesn't answer the question I was asking.

yshui avatar Aug 29 '22 21:08 yshui

Has this option been benchmarked? If the compilation times are hit so hard it better give a significant performance boost.

leg7 avatar Aug 29 '22 23:08 leg7

Since a typical program contains a large number of functions, with a huge number of possible call sequences, this kind of analysis can be very expensive.

Maybe you should disable the flag with package.cflags for the packages that are giving you trouble.

*FLAGS-="-fipa-pta"  media-gfx/renderdoc

But if it were me I'd just leave it on and perform the compilation overnight, as it supposedly "improves performance".

TheMBL09898 avatar Aug 30 '22 20:08 TheMBL09898

I just compiled renderdoc-1.20-r1 with the default parameters from gentooLTO in less than 2 minutes.

mccarverone avatar Sep 09 '22 15:09 mccarverone

@mccarverone did you enable qt and python in the use flags?

yshui avatar Sep 09 '22 15:09 yshui

Now I did and it actually did fail compiling at [283/288].

log.txt

mccarverone avatar Sep 09 '22 17:09 mccarverone

Looks like cc1plus ate too much memory. Does it compile without -fipa-pta?

yshui avatar Sep 09 '22 17:09 yshui

Yes it does.

So media-gfx/renderdoc *FLAGS-="${IPAPTA}" should be added to ipa-pta.conf. Would you submit a pull request?

mccarverone avatar Sep 09 '22 18:09 mccarverone

@mccarverone i am more wondering if -fipa-pta should not be enabled at all. is there some representative benchmarks I could run?

yshui avatar Sep 09 '22 19:09 yshui

Can't answer about that, sorry

mccarverone avatar Sep 09 '22 19:09 mccarverone