[LLVMbugs] [Bug 4327] New: Missed optimization on Benchmarks/Shootout/objinst

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Jun 4 14:32:14 PDT 2009


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

           Summary: Missed optimization on Benchmarks/Shootout/objinst
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: daniel at zuster.org
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=3063)
 --> (http://llvm.org/bugs/attachment.cgi?id=3063)
test script

clang used to not honor -mllvm -disable-llvm-optzns and so would end up running
-O3 level optimizations twice. It turns out this was giving a very dramatic
speedup on Benchmarks/Shootout/objinst:
--
ddunbar at lordcrumb:x$ cat test.sh
#!/bin/bash

for count in 0 1 2 3 4; do
    name="x$count"
    clang -m32 -O0 -c objinst.c -o $name.bc -emit-llvm
    i=0;
    while (($i < $count)); do
        opt -std-compile-opts $name.bc -o $name.bc -f
        i=$((i + 1));
    done
    llvm-ld $name.bc -o $name.linked -lc
    llc -O3 -f $name.linked.bc -o $name.linked.s
    gcc $name.linked.s -o $name -m32 -fomit-frame-pointer -mdynamic-no-pic -lm 

    echo "-- $count iterations (opt -std-compile-opts) --"
    time ./$name > /dev/null
done
ddunbar at lordcrumb:x$ ./test.sh
-- 0 iterations (opt -std-compile-opts) --

real    0m9.705s
user    0m9.699s
sys     0m0.004s
-- 1 iterations (opt -std-compile-opts) --

real    0m9.566s
user    0m9.560s
sys     0m0.005s
-- 2 iterations (opt -std-compile-opts) --

real    0m4.916s
user    0m4.912s
sys     0m0.003s
-- 3 iterations (opt -std-compile-opts) --

real    0m4.658s
user    0m4.652s
sys     0m0.004s
-- 4 iterations (opt -std-compile-opts) --

real    0m0.028s
user    0m0.026s
sys     0m0.002s
--

The full reduction to < .1s is probably not fair, but it might be worth looking
into the difference between running -O3 once and twice.

Drop the attached test in a directory with objinst.c to run.


-- 
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