[PATCH] Remove "localize global" optimization

Nick Lewycky nlewycky at google.com
Wed Oct 2 10:32:25 PDT 2013


On 2 October 2013 08:33, 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. See Reid's comment in
> http://llvm-reviews.chandlerc.com/D1754 - looks like this optimization
> has incorrect assumptions about C programs.
> $ 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
>
>
Please add this as a testcase to test/Transforms/GlobalOpt.

Nick

 >
>> > http://llvm-reviews.chandlerc.com/D1769
>> >
>> > BRANCH
>> >  svn
>> >
>> > ARCANIST PROJECT
>> >  llvm
>> > _______________________________________________
>> > llvm-commits mailing list
>> > llvm-commits at cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>
>
> --
> Alexey Samsonov, MSK
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131002/e4ae11f0/attachment.html>


More information about the llvm-commits mailing list