<div dir="ltr">Nice work!<div><br></div><div><div>+      if (RHSKnownOne.countPopulation() == 1) {                                 </div><div>This looks too aggressive. Are you supposed to say there are (BitWidth - 1) known zeros? Do you also need to check this single one-bit is not the sign bit or is it implied by some later conditions? </div>
<div>+        // Ignore Sign Bit.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, May 18, 2014 at 9:49 PM, suyog sarda <span dir="ltr"><<a href="mailto:sardask01@gmail.com" target="_blank">sardask01@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Gentle Ping !! Please help in reviewing the patch.<br>
<br><div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">suyog sarda</b> <span dir="ltr"><<a href="mailto:sardask01@gmail.com" target="_blank">sardask01@gmail.com</a>></span><br>


Date: Fri, May 16, 2014 at 6:09 PM<br>Subject: Fwd: [PATCH] InstCombine Check if Signed Addition Overflows<br>To: <a href="mailto:benny.kra@gmail.com" target="_blank">benny.kra@gmail.com</a>, <a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>, <a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a><br>


<br><br><div dir="ltr"><div>Hi David, Ben, Rafael,<br><br></div>Please help in reviewing the patch.<br><div><div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">suyog sarda</b> <span dir="ltr"><<a href="mailto:sardask01@gmail.com" target="_blank">sardask01@gmail.com</a>></span><br>



Date: Thu, May 15, 2014 at 10:12 PM<br>Subject: [PATCH] Check if Signed Addition Overflows<br>To: <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br><br><br><div dir="ltr"><div><div>


<div><div><div><div>
<div><div><div><div>Hi,<br><br></div>Attaching patch for checking if Signed Addition overflows.<br></div>This patch implements two things :<br><br></div>1. If we know one number is positive and another is negative, we return true as signed addition of two opposite signed numbers will never overflow.<br>




<br></div>2. Implemented TODO : If one of the operands only has one non-zero bit, and if the other operand has a known-zero bit in a more significant place than it (not including the sign bit) the ripple may go up to and fill the zero, but won't change the sign.<br>




</div>e.x -  (x & ~4) + 1<br></div><div>We make sure that we are ignoring 0 at MSB.<br></div><div><br></div>3 Test case included :<br><br></div>1. To check if 0 in one number is at more significant place than 1 in second number. We emit 'add nsw' as we are sure there will be no overflow as the ripple will die at that zero.<br>




</div>2. If 0 is at less significant place than one, then emit normal 'add' as we are not sure if the ripple will die before reaching Sign bit.<br></div>3. IF the two numbers are of opposite sign, we emit 'add nsw' as we are sure that it will never overflow.<br>




<br></div>Please help in reviewing the patch.<span><font color="#888888"><span><font color="#888888"><br><br><div><div><div><div><div><div><div><div><div><div><div><div><div>-- <br>With regards,<br>Suyog Sarda<span class=""><font color="#888888"><br>


</font></span></div></div></div></div></div></div></div></div></div></div></div></div></div></font></span></font></span></div><span class=""><font color="#888888"><span><font color="#888888">
</font></span></font></span></div><span class=""><font color="#888888"><span><font color="#888888"><br><br clear="all"><br>-- <br>With regards,<br>Suyog Sarda<br>
</font></span></font></span></div></div></div><span class=""><font color="#888888">
</font></span></div><span class=""><font color="#888888"><br><br clear="all"><br>-- <br>With regards,<br>Suyog Sarda<br>
</font></span></div></div>
<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></div></div>