Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang: missed optimization: copy global to local, prefetch #9091

Open Quuxplusone opened 13 years ago

Quuxplusone commented 13 years ago
Bugzilla Link PR8724
Status NEW
Importance P normal
Reported by Török Edwin (edwin+bugs@etorok.eu)
Reported on 2010-12-02 03:56:36 -0800
Last modified on 2011-01-04 17:53:13 -0800
Version 2.8
Hardware PC Linux
CC llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments gy.i.bz2 (24896 bytes, application/x-bzip)
Blocks
Blocked by PR8571
See also
Created attachment 5856
gy.i.bz2

See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46763

clang 2.8 -O2 misses that optimization too:
$ clang gy.i -O2 -lm
$ ./a.out
             default: 1.405707s ( 100.0%)
            glob2loc: 1.295956s ( 92.2% +- 5.219%)
         prefetchnta: 1.226949s ( 87.3% +- 0.9207%)
            prefetch: 1.292528s ( 91.9% +- 0.05732%)
glob2loc+prefetchnta: 1.205552s ( 85.8% +- 0.9699%)

It also misses some other optimizations, because with gcc-4.5 I get:
             default: 1.325195s ( 100.0%)
            glob2loc: 1.268875s ( 95.8% +- 1.024%)
         prefetchnta: 1.207342s ( 91.1% +- 0.4986%)
            prefetch: 1.277638s ( 96.4% +- 0.1179%)
glob2loc+prefetchnta: 1.199906s ( 90.5% +- 0.3629%)

CPU: AMD Phenom(tm) II X6 1090T Processor
clang version 2.8 (tags/RELEASE_28/rc3)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Quuxplusone commented 13 years ago

Attached gy.i.bz2 (24896 bytes, application/x-bzip): gy.i.bz2