summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-04-12 02:02:06 +0000
committerFangrui Song <maskray@google.com>2019-04-12 02:02:06 +0000
commitcecc4352508928f7ceeeee92fcde2986a5c55535 (patch)
treefd00bcfc8259cefe24787b0c848cedd79ff9137f /llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
parent21375ca136025f2a6dc55418d43630455ca0e98b (diff)
downloadbcm5719-llvm-cecc4352508928f7ceeeee92fcde2986a5c55535.tar.gz
bcm5719-llvm-cecc4352508928f7ceeeee92fcde2986a5c55535.zip
Use llvm::lower_bound. NFC
This reapplies rL358161. That commit inadvertently reverted an exegesis file to an old version. llvm-svn: 358246
Diffstat (limited to 'llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
index 5748b06a76b..b0fb427c40e 100644
--- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+++ b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
@@ -487,11 +487,10 @@ static bool promoteSingleBlockAlloca(AllocaInst *AI, const AllocaInfo &Info,
unsigned LoadIdx = LBI.getInstructionIndex(LI);
// Find the nearest store that has a lower index than this load.
- StoresByIndexTy::iterator I =
- std::lower_bound(StoresByIndex.begin(), StoresByIndex.end(),
- std::make_pair(LoadIdx,
- static_cast<StoreInst *>(nullptr)),
- less_first());
+ StoresByIndexTy::iterator I = llvm::lower_bound(
+ StoresByIndex,
+ std::make_pair(LoadIdx, static_cast<StoreInst *>(nullptr)),
+ less_first());
if (I == StoresByIndex.begin()) {
if (StoresByIndex.empty())
// If there are no stores, the load takes the undef value.
@@ -758,9 +757,8 @@ void PromoteMem2Reg::run() {
// them from the Preds list.
for (unsigned i = 0, e = SomePHI->getNumIncomingValues(); i != e; ++i) {
// Do a log(n) search of the Preds list for the entry we want.
- SmallVectorImpl<BasicBlock *>::iterator EntIt = std::lower_bound(
- Preds.begin(), Preds.end(), SomePHI->getIncomingBlock(i),
- CompareBBNumbers);
+ SmallVectorImpl<BasicBlock *>::iterator EntIt = llvm::lower_bound(
+ Preds, SomePHI->getIncomingBlock(i), CompareBBNumbers);
assert(EntIt != Preds.end() && *EntIt == SomePHI->getIncomingBlock(i) &&
"PHI node has entry for a block which is not a predecessor!");
OpenPOWER on IntegriCloud