Ping!<div><br></div><div>Let's start with one piece, what if we just added the calls to ComputeMaskedBits from InstructionSimplify?</div><div><br></div><div>Nick<br><br><div class="gmail_quote">On 5 July 2011 23:26, Nick Lewycky <span dir="ltr"><<a href="mailto:nicholas@mxc.ca">nicholas@mxc.ca</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">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.<br>


<br>
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 add.<br>


<br>
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.<br>
<br>
Please review!<br>
<br>
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.<br>

<font color="#888888">
<br>
Nick<br>
</font><br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>