[llvm-commits] [llvm] r136222 - /llvm/trunk/lib/Support/BlockFrequency.cpp

Jakub Staszak jstaszak at apple.com
Wed Jul 27 10:52:35 PDT 2011


-Kuba

On Jul 27, 2011, at 10:46 AM, Benjamin Kramer wrote:

> On Wed, Jul 27, 2011 at 09:50, Chris Lattner <clattner at apple.com> wrote:
>> 
>> On Jul 27, 2011, at 9:00 AM, Jakub Staszak wrote:
>> 
>>> Author: kuba
>>> Date: Wed Jul 27 11:00:40 2011
>>> New Revision: 136222
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=136222&view=rev
>>> Log:
>>> Optimize 96-bit division a little bit.
>> 
>> How about:
>>  if (top_part1 == 0 && top_part2 == 0)
>>    return low1/low2;
>>  .. slow path..
> 
> It looks like the code already checks that and only uses 96 bit
> arithmetic if it's really necessary. However, there's a lot of
> optimization potential in the 96 bit division algorithm. As the bit
> widths are known it should be possible to do it with a bunch of 64 bit
> divs+mods.
> 
> Trying to optimize it without unit tests is dangerous though …
> 
> - Ben

I'm working on unit tests right now. Actually I have them, I'm just copying them to unittests/Support/.  I will also try to optimize the algorithm, but it is not so easy (for me) as I thought at the beginning. I had an algorithm with "bunch of 64 bit divs+mods" and it was slower than the one we have here.

- Kuba
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110727/a7249b84/attachment.html>


More information about the llvm-commits mailing list