[LLVMdev] -fplugin-arg-dragonegg-enable-gcc-optzns status

Duncan Sands baldrick at free.fr
Fri Jun 10 08:16:22 PDT 2011


Hi Jack,

>      These numbers were from release builds for both FSF gcc 4.5.4 and llvm. It seems that
> -fplugin-arg-dragonegg-llvm-ir-optimize=2 provides a small offsetting reduction in compile
> time to compensate for the increased compile time from -fplugin-arg-dragonegg-enable-gcc-optzns
> at -O3 -ffast-math. It also appears that with -fplugin-arg-dragonegg-llvm-ir-optimize=2,
> the addition of -fplugin-arg-dragonegg-enable-gcc-optzns slows compilation by 24%
> with -O3 -ffast-math (which is very close to the 23% increase in compile time seen
> without -fplugin-arg-dragonegg-llvm-ir-optimize=2). We should rebenchmark pb05 with -O2 -ffast-math
> to see if -fplugin-arg-dragonegg-enable-gcc-optzns has the same impact on compile times.
> IMHO, if -fplugin-arg-dragonegg-enable-gcc-optzns has less effect at -O2, it would might make sense
> to default -fplugin-arg-dragonegg-enable-gcc-optzns on in dragonegg. That is, if the compile time
> regressions are mainly at -O3 that would be tolerable because run-time of the resulting binaries
> should be more important there.

I did some compile time benchmarking using gcc-as-one-big-file (750000 SLOC) and
bzip2-as-one-big-file (7000 SLOC).  At -O3, adding -fplugin-arg-dragonegg-
enable-gcc-optzns didn't change the compile time (gcc) or decreased it slightly
(bzip2).  At -O2 it increased the compile time of gcc by 8%, and decreased the
compile time of bzip2 by 11%.  At -O1 it increased the compile time of gcc by
9% and did not change the compile time of bzip2.

With my latest patch that turns off module level LLVM optimizations if GCC
optimizations are enabled: at -O3, adding -fplugin-arg-dragonegg-
enable-gcc-optzns decreased the compile time of gcc by 27% and decreased the
compile time of bzip2 by 36%.  At -O2 it decreased the compile time of gcc by
20%, and decreased the compile time of bzip2 by 36%.  At -O1 it decreased the
compile time of gcc by 12% and decreased the compile time of bzip2 by 26%.

The above two paragraphs represent two extreme situations, the trick is now to
find a level between the two where run-time performance is excellent while still
having decent compile times.

Ciao, Duncan.

PS: All compiling was done with -fno-tree-vectorize.
PPS: "Adding -fplugin-arg-dragonegg-enable-gcc-optzns" is short-hand for:
using the dragonegg plugin (-fplugin=dragonegg.so) along with the
-fplugin-arg-dragonegg-enable-gcc-optzns option.  I.e. I am comparing stock
gcc-4.5 with dragonegg+gcc-optimizations.



More information about the llvm-dev mailing list