diff options
| author | Justin Lebar <jlebar@google.com> | 2016-11-21 22:49:11 +0000 |
|---|---|---|
| committer | Justin Lebar <jlebar@google.com> | 2016-11-21 22:49:11 +0000 |
| commit | 838c7f5a85a96f642fea0e2167c92e32682222b6 (patch) | |
| tree | 447419a69438fc717fca2d82329bcf41c7c45751 /llvm/lib | |
| parent | 54fa41b99c7f9d6e042cd61ebe9dc30aab7693cc (diff) | |
| download | bcm5719-llvm-838c7f5a85a96f642fea0e2167c92e32682222b6.tar.gz bcm5719-llvm-838c7f5a85a96f642fea0e2167c92e32682222b6.zip | |
[CodeGenPrepare] Rewrite a loop in terms of llvm::none_of. NFC.
Reviewers: arsenm
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D26924
llvm-svn: 287590
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index aff4e9519e1..87ad3075873 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -3909,18 +3909,10 @@ bool CodeGenPrepare::optimizeMemoryInst(Instruction *MemoryInst, Value *Addr, } TPT.commit(); - // Check to see if any of the instructions supersumed by this addr mode are - // non-local to I's BB. - bool AnyNonLocal = false; - for (unsigned i = 0, e = AddrModeInsts.size(); i != e; ++i) { - if (IsNonLocalValue(AddrModeInsts[i], MemoryInst->getParent())) { - AnyNonLocal = true; - break; - } - } - // If all the instructions matched are already in this BB, don't do anything. - if (!AnyNonLocal) { + if (none_of(AddrModeInsts, [&](Value *V) { + return IsNonLocalValue(V, MemoryInst->getParent()); + })) { DEBUG(dbgs() << "CGP: Found local addrmode: " << AddrMode << "\n"); return false; } |

