[llvm-commits] [llvm] r126782 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Cameron Zwarich zwarich at apple.com
Tue Mar 1 15:44:51 PST 2011


On Mar 1, 2011, at 3:37 PM, Chris Lattner wrote:

> On Mar 1, 2011, at 1:13 PM, Cameron Zwarich wrote:
> 
>> Author: zwarich
>> Date: Tue Mar  1 15:13:53 2011
>> New Revision: 126782
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=126782&view=rev
>> Log:
>> Stop computing the number of uses twice per value in CodeGenPrepare's sinking of
>> addressing code. On 403.gcc this almost halves CodeGenPrepare time and reduces
>> total llc time by 9.5%. Unfortunately, getNumUses() is still the hottest function
>> in llc.
> 
> Wow!  Can this use hasNUsesOrMore() to avoid walking the entire use list of things with tons of uses?  Is this asking things like "i32 1" for the use count?  Maybe constants can be filtered earlier?

I don't think we can use hasNUsesOrMore(), because when it has fewer uses we need to walk them all to prove that, and when it has more uses we need to walk them all anyways because we need to compute the new maximum number of uses.

I will experiment with filtering some things earlier though.

Cameron



More information about the llvm-commits mailing list