[PATCH] D25344: Add a fast path to alignTo.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 21:00:22 PST 2016

On Thu, Oct 6, 2016 at 3:52 PM, Rafael EspĂ­ndola via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> On 6 October 2016 at 18:47, David Majnemer <david.majnemer at gmail.com>
> wrote:
> > Is alignTo actually showing up in profiles of real world code?
> Not significantly. The numbers I posted are for lld. I just noticed it
> because there was a call to alignTo close to a hot code path, but divq
> seems to be really fast on Intel when the right hand side is a power
> of 2.

How did you measure this / where did you learn this? Last I looked, most
CPU's do integer division via an iterative algorithm. Ignoring microcode
costs, IIRC Haswell produces 4 bits of the quotient per cycle, and Jaguar 2
bits of the quotient per cycle.

-- Sean Silva

> Cheers,
> Rafael
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161213/d3fbcfb8/attachment.html>

More information about the llvm-commits mailing list