[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>
> > 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
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits