[llvm-commits] [llvm] r112812 - in /llvm/trunk: lib/VMCore/AsmWriter.cpp test/Transforms/IndVarSimplify/2003-12-10-IndVarDeadCode.ll

Dan Gohman gohman at apple.com
Thu Sep 2 09:43:59 PDT 2010


On Sep 2, 2010, at 1:52 AM, Duncan Sands wrote:

> Author: baldrick
> Date: Thu Sep  2 03:52:23 2010
> New Revision: 112812
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=112812&view=rev
> Log:
> Print the number of uses of a function in the .ll since it can be informative
> and there seems to be no reason not to.

Hi Duncan,

IMHO, the AsmPrinter should just print the IR. It shouldn't be doing
extra unnecessary analysis (especially not when the analysis has
quadratic worst-case complexity :-}). There has been a fair amount of
confusion from newcomers about whether these numbers are an explicit
part of the IR; they aren't.

Also, in the case of functions with external linkage, the use count
is more misleading than useful, because such functions may have
any number of users outside their module.

And, the first line of function definitions is already a pretty
crowded place, and it's liable to become more crowded in the future.

I've actually been considering removing use count printing altogether,
possibly adding an AsmAnnotationWriter for printing use counts as an
option when the information is actually desired.

Another possibility is to suppress use counts for single-use
instructions and global values with external linkage. This would
reduce the clutter while still preserving the information that
is useful.

Dan





More information about the llvm-commits mailing list