summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-06-30 11:19:56 +0000
committerFangrui Song <maskray@google.com>2019-06-30 11:19:56 +0000
commit78ee2fbf984b84db814bf7b3a68e2317e32b1a24 (patch)
tree83fad2d809aa8d625b95a949b0d36ef9ceeaa2e4 /llvm/lib/CodeGen
parent2d2cb77e45d4c9ca34d05f80430e0f9404252980 (diff)
downloadbcm5719-llvm-78ee2fbf984b84db814bf7b3a68e2317e32b1a24.tar.gz
bcm5719-llvm-78ee2fbf984b84db814bf7b3a68e2317e32b1a24.zip
Cleanup: llvm::bsearch -> llvm::partition_point after r364719
llvm-svn: 364720
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/ExecutionDomainFix.cpp4
-rw-r--r--llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp9
2 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/ExecutionDomainFix.cpp b/llvm/lib/CodeGen/ExecutionDomainFix.cpp
index c350ede635d..a2dd5eee33b 100644
--- a/llvm/lib/CodeGen/ExecutionDomainFix.cpp
+++ b/llvm/lib/CodeGen/ExecutionDomainFix.cpp
@@ -337,8 +337,8 @@ void ExecutionDomainFix::visitSoftInstr(MachineInstr *mi, unsigned mask) {
// Sorted insertion.
// Enables giving priority to the latest domains during merging.
const int Def = RDA->getReachingDef(mi, RC->getRegister(rx));
- auto I = llvm::bsearch(Regs, [&](int I) {
- return Def < RDA->getReachingDef(mi, RC->getRegister(I));
+ auto I = partition_point(Regs, [&](int I) {
+ return RDA->getReachingDef(mi, RC->getRegister(I)) <= Def;
});
Regs.insert(I, rx);
}
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
index 0010ca72d76..14df53b9e84 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
@@ -544,11 +544,10 @@ LegalizerInfo::findAction(const SizeAndActionsVec &Vec, const uint32_t Size) {
// Find the last element in Vec that has a bitsize equal to or smaller than
// the requested bit size.
// That is the element just before the first element that is bigger than Size.
- auto VecIt = llvm::bsearch(
- Vec, [=](const SizeAndAction &A) { return Size < A.first; });
- assert(VecIt != Vec.begin() && "Does Vec not start with size 1?");
- --VecIt;
- int VecIdx = VecIt - Vec.begin();
+ auto It = partition_point(
+ Vec, [=](const SizeAndAction &A) { return A.first <= Size; });
+ assert(It != Vec.begin() && "Does Vec not start with size 1?");
+ int VecIdx = It - Vec.begin() - 1;
LegalizeAction Action = Vec[VecIdx].second;
switch (Action) {
OpenPOWER on IntegriCloud