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

</div></div></div></div></div></div></div></div></div></div></div></div></div></font></span></font></span></div><span><font color="#888888">
</font></span></div><span><font color="#888888"><br><br clear="all"><br>-- <br>With regards,<br>Suyog Sarda<br>
</font></span></div></div></div>
</div><br><br clear="all"><br>-- <br>With regards,<br>Suyog Sarda<br>
</div></div>