diff options
| author | Ali Tamur <tamur@google.com> | 2019-04-11 17:35:20 +0000 | 
|---|---|---|
| committer | Ali Tamur <tamur@google.com> | 2019-04-11 17:35:20 +0000 | 
| commit | 7822b4618853a41aaa5ee3a7f14e0e32b1d29a64 (patch) | |
| tree | 16ff223e5739891d3b6f700cb4f6daa63ad7d43a /llvm/lib/Transforms/Utils | |
| parent | 528b01e998474ac3ada4c5dcc1b99c1d594b0d37 (diff) | |
| download | bcm5719-llvm-7822b4618853a41aaa5ee3a7f14e0e32b1d29a64.tar.gz bcm5719-llvm-7822b4618853a41aaa5ee3a7f14e0e32b1d29a64.zip  | |
Revert "Use llvm::lower_bound. NFC"
This reverts commit rL358161.
This patch have broken the test:
llvm/test/tools/llvm-exegesis/X86/uops-CMOV16rm-noreg.s
llvm-svn: 358199
Diffstat (limited to 'llvm/lib/Transforms/Utils')
| -rw-r--r-- | llvm/lib/Transforms/Utils/LowerSwitch.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 14 | 
2 files changed, 11 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerSwitch.cpp b/llvm/lib/Transforms/Utils/LowerSwitch.cpp index 680b5d31a42..3c973e7c142 100644 --- a/llvm/lib/Transforms/Utils/LowerSwitch.cpp +++ b/llvm/lib/Transforms/Utils/LowerSwitch.cpp @@ -62,8 +62,9 @@ static bool IsInRanges(const IntRange &R,    // Find the first range whose High field is >= R.High,    // then check if the Low field is <= R.Low. If so, we    // have a Range that covers R. -  auto I = llvm::lower_bound( -      Ranges, R, [](IntRange A, IntRange B) { return A.High < B.High; }); +  auto I = std::lower_bound( +      Ranges.begin(), Ranges.end(), R, +      [](const IntRange &A, const IntRange &B) { return A.High < B.High; });    return I != Ranges.end() && I->Low <= R.Low;  } diff --git a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index b0fb427c40e..5748b06a76b 100644 --- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -487,10 +487,11 @@ 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 = llvm::lower_bound( -        StoresByIndex, -        std::make_pair(LoadIdx, static_cast<StoreInst *>(nullptr)), -        less_first()); +    StoresByIndexTy::iterator I = +        std::lower_bound(StoresByIndex.begin(), StoresByIndex.end(), +                         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. @@ -757,8 +758,9 @@ 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 = llvm::lower_bound( -          Preds, SomePHI->getIncomingBlock(i), CompareBBNumbers); +      SmallVectorImpl<BasicBlock *>::iterator EntIt = std::lower_bound( +          Preds.begin(), Preds.end(), SomePHI->getIncomingBlock(i), +          CompareBBNumbers);        assert(EntIt != Preds.end() && *EntIt == SomePHI->getIncomingBlock(i) &&               "PHI node has entry for a block which is not a predecessor!");  | 

