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

Benjamin Kramer benny.kra at googlemail.com
Wed Jul 27 10:46:49 PDT 2011


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




More information about the llvm-commits mailing list