[LLVMbugs] [Bug 16639] New: very slow compilation at -O3

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 16 15:22:41 PDT 2013


            Bug ID: 16639
           Summary: very slow compilation at -O3
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: su at cs.ucdavis.edu
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following code takes much longer to compile at -O3 than at -O2, using the
current clang-trunk, clang 3.3, and clang 3.2 on x86_64-linux in both 32-bit
and 64-bit modes. 

$ clang-trunk -v 
clang version 3.4 (trunk 186424)
Target: x86_64-pc-linux-gnu
Thread model: posix
$ time clang-trunk -m64 -O3 -c small.c
47.09user 0.02system 0:47.15elapsed 99%CPU (0avgtext+0avgdata
0inputs+8outputs (0major+4755minor)pagefaults 0swaps
$ time clang-trunk -m64 -O2 -c small.c
0.13user 0.00system 0:00.14elapsed 98%CPU (0avgtext+0avgdata 53184maxresident)k
0inputs+8outputs (0major+4698minor)pagefaults 0swaps
$ time clang-3.3 -m64 -O3 -c small.c
53.13user 0.01system 0:53.16elapsed 99%CPU (0avgtext+0avgdata
0inputs+8outputs (0major+4592minor)pagefaults 0swaps
$ time clang-3.2 -m64 -O3 -c small.c
51.06user 0.01system 0:51.09elapsed 99%CPU (0avgtext+0avgdata
0inputs+8outputs (0major+4304minor)pagefaults 0swaps
$ time gcc-trunk -m64 -O3 -c small.c
0.04user 0.01system 0:00.06elapsed 88%CPU (0avgtext+0avgdata 44128maxresident)k
0inputs+16outputs (0major+4954minor)pagefaults 0swaps


int a, *b, c, d, g;

foo ()
  int e;
  int **f = &b;
  *f = &e;

bar ()
  for (d = 0; d <= 5; d++) {
    for (c = 0; c <= 5; c++) {
      if (g)
      for (a = 5; a; a--)
    foo ();

baz ()
  for (;;) {
    bar ();
    bar ();

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130716/cddd1fe4/attachment.html>

More information about the llvm-bugs mailing list