<div dir="ltr">If Ty is a vector type wasn't that ConstantInt::get in the original code going to create a splat of the Constant?</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div>
<br><div class="gmail_quote">On Thu, Mar 30, 2017 at 3:44 PM, Friedman, Eli <span dir="ltr"><<a href="mailto:efriedma@codeaurora.org" target="_blank">efriedma@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 3/30/2017 3:21 PM, Craig Topper via llvm-commits wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: ctopper<br>
Date: Thu Mar 30 17:21:16 2017<br>
New Revision: 299121<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=299121&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=299121&view=rev</a><br>
Log:<br>
[InstSimplify] Use m_SignBit instead of calling getSignBit and using m_Specific. NFCI<br>
<br>
Modified:<br>
llvm/trunk/lib/Analysis/Instr<wbr>uctionSimplify.cpp<br>
<br>
Modified: llvm/trunk/lib/Analysis/Instru<wbr>ctionSimplify.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstructionSimplify.cpp?rev=299121&r1=299120&r2=299121&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/Analysis/<wbr>InstructionSimplify.cpp?rev=<wbr>299121&r1=299120&r2=299121&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/Analysis/Instru<wbr>ctionSimplify.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/Instru<wbr>ctionSimplify.cpp Thu Mar 30 17:21:16 2017<br>
@@ -565,10 +565,8 @@ static Value *SimplifyAddInst(Value *Op0<br>
// add nsw/nuw (xor Y, signbit), signbit --> Y<br>
// The no-wrapping add guarantees that the top bit will be set by the add.<br>
// Therefore, the xor must be clearing the already set sign bit of Y.<br>
- Constant *SignBit =<br>
- ConstantInt::get(Ty, APInt::getSignBit(Ty->getScala<wbr>rSizeInBits()));<br>
- if ((isNSW || isNUW) && match(Op1, m_Specific(SignBit)) &&<br>
- match(Op0, m_Xor(m_Value(Y), m_Specific(SignBit))))<br>
+ if ((isNSW || isNUW) && match(Op1, m_SignBit()) &&<br>
+ match(Op0, m_Xor(m_Value(Y), m_SignBit())))<br>
return Y;<br>
<br>
</blockquote>
<br>
Are you certain there's no functional change here? m_SignBit() also matches vectors.<span class="HOEnZb"><font color="#888888"><br>
<br>
-Eli<br>
<br>
-- <br>
Employee of Qualcomm Innovation Center, Inc.<br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<br>
<br>
</font></span></blockquote></div><br></div>