[llvm-dev] RFC: std::vector and identified objects
Mehdi Amini via llvm-dev
llvm-dev at lists.llvm.org
Fri Apr 1 09:40:32 PDT 2016
> On Apr 1, 2016, at 9:35 AM, Renato Golin <renato.golin at linaro.org> wrote:
>
> 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...
Oh it reminds me of a heuristic I wanted to explore: add an inlining bonus when all the arguments to the function are constant at the call site (independently of LTO or not).
--
Mehdi
More information about the llvm-dev
mailing list