Detailed info on link-time optimization (LTO) behavior
Detailed info on link-time optimization (LTO) behavior
- Subject: Detailed info on link-time optimization (LTO) behavior
- From: Jens Alfke <email@hidden>
- Date: Tue, 07 Feb 2017 09:46:32 -0800
Is there any documentation about Clang’s link-time optimizer that gives more of a description of what specifically it does? Generally it appears as sort of a black box, exposed only as a checkbox in Xcode. I understand how it gives Clang much more flexibility in inlining functions, but there are a lot of details I’d like to know when optimizing my code, like:
* What are the heuristics for when to inline a call? Does putting a method implementation inside the class declaration or marking it ‘inline’ have any effect anymore? Does it give a higher priority to inlining?
* Does LTO perform monomorphic-method optimizations for virtual methods, i.e. downgrading the method to non-virtual if there is only one implementation, or replacing a virtual call with a direct call if the implementation is known at that call-site?
* If source files are compiled with different optimization settings, like -Os (size) vs. -O3 or -Ofast (speed), are those settings still honored at link time — for example, will the functions compiled with -Os have less aggressive inlining applied at link-time? (In my case I want to compile the majority of my library with -Os but the performance-critical parts with -Ofast.)
(This may not be the ideal mailing list, but if someone here has some pointers to docs, that would save me from having to go through a subscribe / ask / unsubscribe cycle for a more specific list. Thanks.)
—Jens
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden