Laurent GUERBY <[EMAIL PROTECTED]> writes: > I noticed insn-attrtab compilation is about 5mn20s and probably > explain about all of the not so perfect speedup: when I look at top it > takes more than 1 minute per stage finishing alone. I've seen it up to 3 > minutes alone. There's a comment in the Makefile about trying to > compile it earlier but it doesn't seem to work all the time > (likely reason behind c,fortran faster than =c)
First I'll note that insn-attrtab.c is particularly slow for x86/x86_64, presumably due to the many processor varieties and complex scheduling. It is much faster for other targets. Compiling it earlier than it would otherwise be does work. The problem is that insn-attrtab.o depends on the generated file insn-attr.h. GNU make works by making a pass over the targets, and it builds all the ones whose dependencies are already built. Then it makes another pass. The effect is that all the objects which do not depend upon insn-attr.h wind up getting built before insn-attrtab.o. We could game the system to force insn-attrtab.o to be compiler even earlier by adding false dependencies in the Makefile. A cleaner approach would be to somehow change genattrtab.c to generate multiple files. Or, in general, to somehow invert the sense of the functions to work as a switch on ix86_tune, rather than testing it in every single conditional. I'm guessing, but I think that inverting the function that way should significantly reduce the number of basic blocks and speed up compilation. Ian