<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jun 24, 2013, at 10:40 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Mon, Jun 24, 2013 at 10:30 PM, Nadav Rotem <<a href="mailto:nrotem@apple.com">nrotem@apple.com</a>> wrote:<br><blockquote type="cite">Author: nadav<br>Date: Tue Jun 25 00:30:56 2013<br>New Revision: 184827<br><br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=184827&view=rev">http://llvm.org/viewvc/llvm-project?rev=184827&view=rev</a><br>Log:<br>Fix a typo in the code that collected the costs recursively.<br></blockquote><br>Any test case for this?<br></div></blockquote><div dir="auto"><br></div><div dir="auto">It is difficult to come up with a test because it slightly changed the estimated cost of expressions. </div><div dir="auto"><br></div><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">(Hmm, I wonder if there's any way we could warn on something like this<br>- a combination of typo correction ("hey, you've got a similarly named<br>variable...") & a somewhat strange way of writing *= 2? I suppose<br>that's not really a strong enough signal)<br></div></blockquote><div><br></div>I think that the static analyzer gives a warning for this kind of an error. <br><div><br></div><br><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite"><br><br>Modified:<br>   llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp<br><br>Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=184827&r1=184826&r2=184827&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=184827&r1=184826&r2=184827&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)<br>+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Tue Jun 25 00:30:56 2013<br>@@ -727,7 +727,7 @@ int FuncSLP::getTreeCost_rec(ArrayRef<Va<br>      int Cost = getTreeCost_rec(Operands, Depth + 1);<br>      if (Cost == MAX_COST)<br>        return MAX_COST;<br>-      TotalCost += TotalCost;<br>+      TotalCost += Cost;<br>    }<br><br>    // Calculate the cost of this instruction.<br><br><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">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></blockquote></div></blockquote></div><br></body></html>