asm-verbose (on by default) is really, really slow

$ time ./llc -march=x86 -mcpu=pentium4 -filetype=asm eon.bc -o eon.s
-asm-verbose=false

real 0m17.855s
user 0m17.480s
sys 0m0.380s

$ time ./llc -march=x86 -mcpu=pentium4 -filetype=asm eon.bc -o eon.s

real 0m53.304s
user 0m52.880s
sys 0m0.420s

Maybe this should be off by default?

- David Meyer

Maybe this should be off by default?

It's off by default on any user-visible tools (e.g. clang / llvm-gcc).
Since llc is a developer tool it does make sense to enable verbose
output by default.

Very true, but we do want the testsuite to run fast. Can it be sped up?

-Chris

Very true, but we do want the testsuite to run fast. Can it be sped up?

Can't we just run testsuite with asm-verbose=0 ?

That is already the default. From test-suite/Makefile.programs:

# Disable asm-verbose. This can slow down compilation and is not what the
# compilers default to using.
LLCFLAGS += -asm-verbose=false

Most (new) nightly testers run TEST=simple which doesn't invoke llc at all.

/jakob

I meant llvm/test. I'm just surprised it is that slow, what is costing all the time?

-Chris

Chris,

When asm-verbose=true, it is spending the extra time here:

% cumulative self self total
time seconds seconds calls s/call s/call name
33.67 17.19 17.19 849 0.02 0.04 AddModuleTypesToPrinter

17.51 26.13 8.94 265849169 0.00 0.00 llvm::Value::getType()

8.74 30.59 4.46 258948922 0.00 0.00 ::TypeFinder::IncorporateType
3.25 32.25 1.66 5242575 0.00 0.00 ::TypeFinder::IncorporateValue

  • David Meyer

Thanks, fixed in r121691.

-Chris

Anton Korobeynikov <anton@korobeynikov.info> writes:

Very true, but we do want the testsuite to run fast. Can it be sped up?

Can't we just run testsuite with asm-verbose=0 ?

No. There are tests that look for line numbers, for example.

                            -Dave