[PATCH] D14148: [GlobalOpt] Demote globals to locals more aggressively

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 09:35:44 PST 2015


> On 2015-Nov-16, at 07:53, James Molloy <james.molloy at arm.com> wrote:
> 
> Hi,
>> On 16 Nov 2015, at 15:49, Mehdi Amini <mehdi.amini at apple.com> wrote:
>> 
>> So there will be cases where we will regress in the optimization for “main()”, when we can’t prove that the pointer is dead on entry. I don’t think it really matters that much in practice though, but it may look bad on some benchmarks.
> 
> That is true.
> 
> We could bake in some knowledge about main again for this? Now that main can be marked norecurse it’s slightly less of a massive bug to hardcode “main is only called once”, although it’d be a pity to reintroduce that layering violation again!
> 
> James

In theory we could add a `calledonce` attribute (which could be
propagated down the call tree, as opposed to up).  Although I kind of
doubt this would be generally useful...

Does this cause any benchmark regressions?  If not then maybe we don't
need to solve this.


More information about the llvm-commits mailing list