<div dir="ltr">Looks good to me - seems reasonable for post-commit review, FWIW.<br><br>(you might need llvm::none_of, or it might get confused with std::none_of (if AddrModeInsts is a standard container/from the std namespace ADL would kick in, etc))</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 21, 2016 at 10:23 AM Justin Lebar via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">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">jlebar created this revision.<br class="gmail_msg">
jlebar added a reviewer: arsenm.<br class="gmail_msg">
jlebar added a subscriber: llvm-commits.<br class="gmail_msg">
Herald added a subscriber: wdng.<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D26924" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D26924</a><br class="gmail_msg">
<br class="gmail_msg">
Files:<br class="gmail_msg">
llvm/lib/CodeGen/CodeGenPrepare.cpp<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
Index: llvm/lib/CodeGen/CodeGenPrepare.cpp<br class="gmail_msg">
===================================================================<br class="gmail_msg">
--- llvm/lib/CodeGen/CodeGenPrepare.cpp<br class="gmail_msg">
+++ llvm/lib/CodeGen/CodeGenPrepare.cpp<br class="gmail_msg">
@@ -3813,18 +3813,10 @@<br class="gmail_msg">
}<br class="gmail_msg">
TPT.commit();<br class="gmail_msg">
<br class="gmail_msg">
- // Check to see if any of the instructions supersumed by this addr mode are<br class="gmail_msg">
- // non-local to I's BB.<br class="gmail_msg">
- bool AnyNonLocal = false;<br class="gmail_msg">
- for (unsigned i = 0, e = AddrModeInsts.size(); i != e; ++i) {<br class="gmail_msg">
- if (IsNonLocalValue(AddrModeInsts[i], MemoryInst->getParent())) {<br class="gmail_msg">
- AnyNonLocal = true;<br class="gmail_msg">
- break;<br class="gmail_msg">
- }<br class="gmail_msg">
- }<br class="gmail_msg">
-<br class="gmail_msg">
// If all the instructions matched are already in this BB, don't do anything.<br class="gmail_msg">
- if (!AnyNonLocal) {<br class="gmail_msg">
+ if (none_of(AddrModeInsts, [&](Value *V) {<br class="gmail_msg">
+ return IsNonLocalValue(V, MemoryInst->getParent());<br class="gmail_msg">
+ })) {<br class="gmail_msg">
DEBUG(dbgs() << "CGP: Found local addrmode: " << AddrMode << "\n");<br class="gmail_msg">
return false;<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
llvm-commits mailing list<br class="gmail_msg">
<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="gmail_msg">
</blockquote></div>