<div dir="ltr">Replaced in r254260.<div><br></div><div>FWIW, there's also this code in ScalarEvolution.cpp that does similar.</div><div><br></div><div><div> // If FlagNSW is true and all the operands are non-negative, infer FlagNUW.</div><div> auto IsKnownNonNegative =</div><div> std::bind(std::mem_fn(&ScalarEvolution::isKnownNonNegative), SE, _1);</div><div><br></div><div> if (SignOrUnsignWrap == SCEV::FlagNSW &&</div><div> std::all_of(Ops.begin(), Ops.end(), IsKnownNonNegative))</div><div> Flags =</div><div> ScalarEvolution::setFlags(Flags, (SCEV::NoWrapFlags)SignOrUnsignMask);</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 29, 2015 at 7:20 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 class="HOEnZb"><div class="h5"><p dir="ltr"><br>
On Nov 29, 2015 3:28 AM, "Alex Bradbury via llvm-commits" <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
><br>
> On 29 November 2015 at 04:37, Craig Topper via llvm-commits<br>
> <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
> > Author: ctopper<br>
> > Date: Sat Nov 28 22:37:11 2015<br>
> > New Revision: 254242<br>
> ><br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=254242&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=254242&view=rev</a><br>
> > Log:<br>
> > [SelectionDAG] Use std::any_of instead of a manually coded loop. NFC<br>
> ><br>
> > Modified:<br>
> > llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp<br>
> ><br>
> > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=254242&r1=254241&r2=254242&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=254242&r1=254241&r2=254242&view=diff</a><br>
> > ==============================================================================<br>
> > --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)<br>
> > +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Nov 28 22:37:11 2015<br>
> > @@ -11317,15 +11317,11 @@ bool DAGCombiner::MergeConsecutiveStores<br>
> > break;<br>
> > }<br>
> ><br>
> > - bool Alias = false;<br>
> > // Check if this store interferes with any of the loads that we found.<br>
> > - for (unsigned ld = 0, lde = AliasLoadNodes.size(); ld < lde; ++ld)<br>
> > - if (isAlias(AliasLoadNodes[ld], StoreNodes[i].MemNode)) {<br>
> > - Alias = true;<br>
> > - break;<br>
> > - }<br>
> > - // We found a load that alias with this store. Stop the sequence.<br>
> > - if (Alias)<br>
> > + // If we find a load that alias with this store. Stop the sequence.<br>
> > + if (std::any_of(AliasLoadNodes.begin(), AliasLoadNodes.end(),<br>
> > + std::bind(std::mem_fn(&DAGCombiner::isAlias), this,<br>
> > + std::placeholders::_1, StoreNodes[i].MemNode)))<br>
><br>
> I know this comes partly down to personal preference, but I can't help<br>
> but think this would be more readable with a lambda (like the recent<br>
> cleanups to CodeGenDAGPatterns by you and David Blaikie).</p>
</div></div><p dir="ltr">Yeah, that's what the Google style guide has suggested (that bind just isn't worth it & lambdas should just be used instead, even in the few cases where bind might be lexically shorter) & I tend to agree with it, but not totally fussed, personally, if people want to play with bind and see how it feels</p><div class="HOEnZb"><div class="h5">
<p dir="ltr">><br>
> Alex<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" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</p>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">~Craig</div>
</div>