Open Quuxplusone opened 10 years ago
Attached beam_emu-clang.i
(858075 bytes, application/octet-stream): Preprocessed input
Attached beam_emu-clang.bc
(191404 bytes, application/octet-stream): Input bitcode
[Fix typos in commands to replicate the bug]
clang -O3 -emit-llvm beam_emu-clang.i -o beam_emu-clang.bc
llc -O3 beam_emu-clang.bc
It is a well-known problem that the register allocator has quadratic complexity
w.r.t. the number of basic blocks:
http://llvm.org/bugs/show_bug.cgi?id=12652
http://llvm.org/bugs/show_bug.cgi?id=17409
Unfortunately, Jakob, the primary author of the register allocator, isn't
working on LLVM these days, so it's unlikely that this will be addressed any
time soon. :(
Although the register allocator is a problem, profiling while running this example the dominant part of the execution time (66%) goes to PHI-elimination, 13% to the coalescer and only 4% to register allocation (unless you consider all those as register-allocation). Also the profile does not look at all like the profiles in bugs http://llvm.org/bugs/show_bug.cgi?id=12652 and http://llvm.org/bugs/show_bug.cgi?id=17409
I will attach a .dot-file with the annotated call graph (produced by gprof2dot[1]) for running this input.
Attached dump.dot
(22240 bytes, application/dot): Annotated call graph with profiling result
(In reply to comment #4)
> Although the register allocator is a problem, profiling while running this
> example the dominant part of the execution time (66%) goes to
> PHI-elimination, 13% to the coalescer and only 4% to register allocation
> (unless you consider all those as register-allocation). Also the profile
> does not look at all like the profiles in bugs
> http://llvm.org/bugs/show_bug.cgi?id=12652 and
> http://llvm.org/bugs/show_bug.cgi?id=17409
>
> I will attach a .dot-file with the annotated call graph (produced by
> gprof2dot[1]) for running this input.
>
> [1] https://code.google.com/p/jrfonseca/wiki/Gprof2Dot
Interesting, then this may fixable.
s/NewPC/PC
Attached 0001-LiveVariables-isLiveOut-Avoid-expensive-sort-if-poss.patch
(1701 bytes, text/plain): LiveVariables::isLiveOut: Avoid expensive sort if possible
Attached 0001-LiveVariables-isLiveOut-Avoid-expensive-sort-if-poss.patch
(1692 bytes, text/plain): LiveVariables::isLiveOut: Avoid expensive sort if possible
Please make sure that you send patches to the llvm-commits list, or use reviews.llvm.org (see http://llvm.org/docs/Phabricator.html), for review. Patches posted to bug reports will likely be ignored. When you post for review, please write a description of the problem and the proposed solution (don't just say, for example, "Fix for PR21185"). Please see http://llvm.org/docs/DeveloperPolicy.html for more information. Thanks!
beam_emu-clang.i
(858075 bytes, application/octet-stream)beam_emu-clang.bc
(191404 bytes, application/octet-stream)dump.dot
(22240 bytes, application/dot)0001-LiveVariables-isLiveOut-Avoid-expensive-sort-if-poss.patch
(1701 bytes, text/plain)0001-LiveVariables-isLiveOut-Avoid-expensive-sort-if-poss.patch
(1692 bytes, text/plain)