[LLVMbugs] [Bug 11502] New: llvm-3.0 creates massive .ll asm file where llvm-2.9 did not

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 7 09:26:15 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=11502

             Bug #: 11502
           Summary: llvm-3.0 creates massive .ll asm file where llvm-2.9
                    did not
           Product: new-bugs
           Version: 3.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: luked at cs.rochester.edu
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 7684
  --> http://llvm.org/bugs/attachment.cgi?id=7684
Preprocessed source that triggers bug.

We have a number of large tables of structs (lock structures) that are
statically allocated and zero initialized, as displayed in the included
preprocessed source. In llvm-2.9, using llvm-gcc, a .ll output is approximately
30k. In llvm-3.0, using clang-3.0, the .ll output is 25MB, and using
gcc-4.6.2/dragonegg-3.0 the .ll output is 75MB.

A discussion with Duncan on irc shows that this seems to be due to how llvm
choses to represent the tables a struct with lots of fields rather than a
struct with one array field. I don't know why this happens (maybe it has
something to do with how we specify the zero initialization?). A trace of the
three compilations for the preprocessed source is below.

luked at node2x6x2a ~/temp $ time
/u/luked/local/llvm-gcc4.2-2.9-x86_64-linux/bin/llvm-g++ -O0 -m64 -emit-llvm -o
preprocessed.ll -S preprocessed.cpp

real    0m0.126s
user    0m0.102s
sys     0m0.022s

luked at node2x6x2a ~/temp $ ls -l preprocessed.ll 
-rw-r--r-- 1 luked people 33762 Dec  7 12:17 preprocessed.ll

luked at node2x6x2a ~/temp $ clang -v
clang version 3.0 (tags/RELEASE_30/final)
Target: x86_64-redhat-linux-gnu
Thread model: posix

luked at node2x6x2a ~/temp $ time clang -O0 -m64 -emit-llvm -o preprocessed.ll -S
preprocessed.cpp

real    0m0.695s
user    0m0.579s
sys     0m0.115s

luked at node2x6x2a ~/temp $ ls -l preprocessed.ll 
-rw-r--r-- 1 luked people 24166071 Dec  7 12:17 preprocessed.ll

luked at node2x6x2a ~/temp $ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/localdisk/luked/local/gcc-4.6.2/bin/../libexec/gcc/x86_64-redhat-linux-gnu/4.6.2/lto-wrapper
Target: x86_64-redhat-linux-gnu
Configured with: ../configure --prefix=/u/luked/local/gcc-4.6.2
--enable-languages=c,c++ --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --enable-plugin --with-arch_32=i686
--host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu
--build=x86_64-redhat-linux-gnu --disable-nls --enable-checking=release
--without-ppl --without-cloog
Thread model: posix
gcc version 4.6.2 (GCC) 

luked at node2x6x2a ~/temp $ time gcc -fplugin=dragonegg -O0 -m64 -flto -o
preprocessed.ll -S preprocessed.cpp

real    0m18.737s
user    0m2.698s
sys     0m16.025s

luked at node2x6x2a ~/temp $ ls -l preprocessed.ll 
-rw-r--r-- 1 luked people 74496790 Dec  7 12:18 preprocessed.ll

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list