<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, May 8, 2017 at 10:32 AM Craig Topper <<a href="mailto:craig.topper@gmail.com">craig.topper@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">They are required to be the same width so the buffer is the same size. I just did it for symmetry, but you're right that could be confusing. I'll go drop one of them.</div></blockquote><div><br>If you reckon the symmetry's better - totally up to you. Just figured I'd mention it - could see it going either way. :)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"></div><div class="gmail_extra"><br clear="all"><div><div class="m_-4563536827788806984gmail_signature" data-smartmail="gmail_signature">~Craig</div></div></div><div class="gmail_extra">
<br><div class="gmail_quote">On Mon, May 8, 2017 at 10:19 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Is it useful to std::move both sides of a binary operator like that? Or is it equivalent/enough to move only the LHS?<br><br>I mean I can appreciate the symmetry too, but it strikes me when reading it as surprising "wait, is there something weird going on that this could use both left and right data"?<br><br>I guess maybe it can take memory from either if one has a larger internal buffer?</div><br><div class="gmail_quote"><div dir="ltr">On Fri, May 5, 2017 at 10:36 PM Craig Topper via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ctopper<br>
Date: Sat May  6 00:22:56 2017<br>
New Revision: 302334<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=302334&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=302334&view=rev</a><br>
Log:<br>
[SCEV] Use std::move to avoid some APInt copies.<br>
<br>
Modified:<br>
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp<br>
<br>
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=302334&r1=302333&r2=302334&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=302334&r1=302333&r2=302334&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sat May  6 00:22:56 2017<br>
@@ -2970,7 +2970,7 @@ static const APInt gcd(const SCEVConstan<br>
   else if (ABW < BBW)<br>
     A = A.zext(BBW);<br>
<br>
-  return APIntOps::GreatestCommonDivisor(A, B);<br>
+  return APIntOps::GreatestCommonDivisor(std::move(A), std::move(B));<br>
 }<br>
<br>
 /// Get a canonical unsigned division expression, or something simpler if<br>
@@ -8980,7 +8980,7 @@ bool ScalarEvolution::doesIVOverflowOnLT<br>
                                 .getSignedMax();<br>
<br>
     // SMaxRHS + SMaxStrideMinusOne > SMaxValue => overflow!<br>
-    return (MaxValue - MaxStrideMinusOne).slt(MaxRHS);<br>
+    return (std::move(MaxValue) - std::move(MaxStrideMinusOne)).slt(MaxRHS);<br>
   }<br>
<br>
   APInt MaxRHS = getUnsignedRange(RHS).getUnsignedMax();<br>
@@ -8989,7 +8989,7 @@ bool ScalarEvolution::doesIVOverflowOnLT<br>
                               .getUnsignedMax();<br>
<br>
   // UMaxRHS + UMaxStrideMinusOne > UMaxValue => overflow!<br>
-  return (MaxValue - MaxStrideMinusOne).ult(MaxRHS);<br>
+  return (std::move(MaxValue) - std::move(MaxStrideMinusOne)).ult(MaxRHS);<br>
 }<br>
<br>
 bool ScalarEvolution::doesIVOverflowOnGT(const SCEV *RHS, const SCEV *Stride,<br>
@@ -9006,7 +9006,7 @@ bool ScalarEvolution::doesIVOverflowOnGT<br>
                                .getSignedMax();<br>
<br>
     // SMinRHS - SMaxStrideMinusOne < SMinValue => overflow!<br>
-    return (MinValue + MaxStrideMinusOne).sgt(MinRHS);<br>
+    return (std::move(MinValue) + std::move(MaxStrideMinusOne)).sgt(MinRHS);<br>
   }<br>
<br>
   APInt MinRHS = getUnsignedRange(RHS).getUnsignedMin();<br>
@@ -9015,7 +9015,7 @@ bool ScalarEvolution::doesIVOverflowOnGT<br>
                             .getUnsignedMax();<br>
<br>
   // UMinRHS - UMaxStrideMinusOne < UMinValue => overflow!<br>
-  return (MinValue + MaxStrideMinusOne).ugt(MinRHS);<br>
+  return (std::move(MinValue) + std::move(MaxStrideMinusOne)).ugt(MinRHS);<br>
 }<br>
<br>
 const SCEV *ScalarEvolution::computeBECount(const SCEV *Delta, const SCEV *Step,<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</blockquote></div><br></div></blockquote></div></div>