[PATCH] Remove "localize global" optimization

Bob Wilson bob.wilson at apple.com
Wed Oct 2 10:08:34 PDT 2013


On Oct 2, 2013, at 8:33 AM, Alexey Samsonov <samsonov at google.com> wrote:

> 
> On Tue, Oct 1, 2013 at 10:39 PM, Bob Wilson <bob.wilson at apple.com> wrote:
> 
> On Oct 1, 2013, at 10:20 AM, Nick Lewycky <nlewycky at gmail.com> wrote:
> 
> >
> >  The optimization was "important" for some SPEC test, but I think we're past caring about that.
> 
> Not necessarily.  Has anyone measured the impact on SPEC and other benchmarks?
> 
> I'm going to submit this anyway.

That's not very friendly.  You may not care about SPEC but that doesn't mean that no one else cares.

> See Reid's comment in http://llvm-reviews.chandlerc.com/D1754 - looks like this optimization has incorrect assumptions about C programs.

The only comment I see from Reid there is this: "I missed any earlier discussion about this. Don't we want to keep this optimization, even if it's a real corner case that fires once in a blue moon? isLeakCheckerRoot() doesn't check any flags to see if any of the sanitizers are on."

> $ cat tmp/glob_di/main.c
> static int glob;
> static int rec;
> 
> int main() {
>   glob++;
>   if (!rec) {
>     rec = 1;
>     main();
>   }
>   return glob;
> }
> $ gcc -O2 tmp/glob_di/main.c ; ./a.out ; echo $?
> 2
> $ ./bin/clang -O2 tmp/glob_di/main.c ; ./a.out ; echo $?
> 1

Have you considered any options to fix it instead of just removing it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131002/d6a84a71/attachment.html>


More information about the llvm-commits mailing list