[llvm-commits] patch: go crazy, compute bits for an entire add instruction
nlewycky at google.com
Tue Jul 12 17:46:18 CDT 2011
Let's start with one piece, what if we just added the calls to
ComputeMaskedBits from InstructionSimplify?
On 5 July 2011 23:26, Nick Lewycky <nicholas at mxc.ca> wrote:
> This is a patch to ComputeMaskedBits primarily, though it's hard to observe
> the effect in a small testcase without also adding more smarts someplace
> else, which this patch does for instsimplify.
> When faced with an add instruction, ComputeMaskedBits will look at the
> leading bits and the trailing bits to attempt to establish a pattern -- and
> it does a decent job. However, there may be bits we could calculate in the
> middle, which we currently don't. Go wild, try to compute every bit in an
> This requires a new loop that is O(n) in the number of bits, which I think
> is sensible enough given that most values will be either 32 or 64 bits,
> making this effectively a constant-time operation.
> Please review!
> If this patch is okay, I'm going to do it for sub as well obviously, but
> eventually for multiply. Currently if we transform some things to mul (using
> mul as a bit-spreading operation, basically) we lose optimization power
> because we can no longer analyze it as well as the equivalent series of
> shifts with add's/or's.
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits