[llvm-dev] RFC: std::vector and identified objects

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Fri Apr 1 09:35:41 PDT 2016


On 1 April 2016 at 17:30, Mehdi Amini <mehdi.amini at apple.com> wrote:
>> Isn't this a case for LTO inlining / specialization?
>
> I'm curious about what you have in mind exactly? What extra-information are available at LTO-time in this case compare to a non-LTO compilation?

Right, that was more of a question really...

My reasoning is that, if LTO generated different versions of resize(),
some with constant folding at link time (due to the types of
arguments, ex. resize(256)), you could end up with a deeper inlining
and maybe get to a point where resize() is inlined into the caller for
that one particular case. This would expose the call to new(), and
therefore help the alias analysis to see that the pointers don't
alias.

That would be a poor man's version of compile-time inter-procedural
analysis, but at link time, if that makes any sense...

cheers,
--renato


More information about the llvm-dev mailing list