diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2016-08-12 00:18:03 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2016-08-12 00:18:03 +0000 |
| commit | 562e82945eec22679ae20fdb19b84dcd6959bf90 (patch) | |
| tree | a4b14e32c56ba3717d80cf0498fd32b0b7ed535d /llvm/lib/CodeGen/RegisterPressure.cpp | |
| parent | 067cc24aaf63078ae31e7e0a96cabb9515f2064f (diff) | |
| download | bcm5719-llvm-562e82945eec22679ae20fdb19b84dcd6959bf90.tar.gz bcm5719-llvm-562e82945eec22679ae20fdb19b84dcd6959bf90.zip | |
Use the range variant of find_if instead of unpacking begin/end
No functionality change is intended.
llvm-svn: 278443
Diffstat (limited to 'llvm/lib/CodeGen/RegisterPressure.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/RegisterPressure.cpp | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/llvm/lib/CodeGen/RegisterPressure.cpp b/llvm/lib/CodeGen/RegisterPressure.cpp index a21d6c1d4d6..dba8929ef05 100644 --- a/llvm/lib/CodeGen/RegisterPressure.cpp +++ b/llvm/lib/CodeGen/RegisterPressure.cpp @@ -328,10 +328,9 @@ void RegPressureTracker::initLiveThru(const RegPressureTracker &RPTracker) { static LaneBitmask getRegLanes(ArrayRef<RegisterMaskPair> RegUnits, unsigned RegUnit) { - auto I = std::find_if(RegUnits.begin(), RegUnits.end(), - [RegUnit](const RegisterMaskPair Other) { - return Other.RegUnit == RegUnit; - }); + auto I = find_if(RegUnits, [RegUnit](const RegisterMaskPair Other) { + return Other.RegUnit == RegUnit; + }); if (I == RegUnits.end()) return 0; return I->LaneMask; @@ -341,10 +340,9 @@ static void addRegLanes(SmallVectorImpl<RegisterMaskPair> &RegUnits, RegisterMaskPair Pair) { unsigned RegUnit = Pair.RegUnit; assert(Pair.LaneMask != 0); - auto I = std::find_if(RegUnits.begin(), RegUnits.end(), - [RegUnit](const RegisterMaskPair Other) { - return Other.RegUnit == RegUnit; - }); + auto I = find_if(RegUnits, [RegUnit](const RegisterMaskPair Other) { + return Other.RegUnit == RegUnit; + }); if (I == RegUnits.end()) { RegUnits.push_back(Pair); } else { @@ -354,10 +352,9 @@ static void addRegLanes(SmallVectorImpl<RegisterMaskPair> &RegUnits, static void setRegZero(SmallVectorImpl<RegisterMaskPair> &RegUnits, unsigned RegUnit) { - auto I = std::find_if(RegUnits.begin(), RegUnits.end(), - [RegUnit](const RegisterMaskPair Other) { - return Other.RegUnit == RegUnit; - }); + auto I = find_if(RegUnits, [RegUnit](const RegisterMaskPair Other) { + return Other.RegUnit == RegUnit; + }); if (I == RegUnits.end()) { RegUnits.push_back(RegisterMaskPair(RegUnit, 0)); } else { @@ -369,10 +366,9 @@ static void removeRegLanes(SmallVectorImpl<RegisterMaskPair> &RegUnits, RegisterMaskPair Pair) { unsigned RegUnit = Pair.RegUnit; assert(Pair.LaneMask != 0); - auto I = std::find_if(RegUnits.begin(), RegUnits.end(), - [RegUnit](const RegisterMaskPair Other) { - return Other.RegUnit == RegUnit; - }); + auto I = find_if(RegUnits, [RegUnit](const RegisterMaskPair Other) { + return Other.RegUnit == RegUnit; + }); if (I != RegUnits.end()) { I->LaneMask &= ~Pair.LaneMask; if (I->LaneMask == 0) @@ -676,10 +672,9 @@ void RegPressureTracker::discoverLiveInOrOut(RegisterMaskPair Pair, assert(Pair.LaneMask != 0); unsigned RegUnit = Pair.RegUnit; - auto I = std::find_if(LiveInOrOut.begin(), LiveInOrOut.end(), - [RegUnit](const RegisterMaskPair &Other) { - return Other.RegUnit == RegUnit; - }); + auto I = find_if(LiveInOrOut, [RegUnit](const RegisterMaskPair &Other) { + return Other.RegUnit == RegUnit; + }); LaneBitmask PrevMask; LaneBitmask NewMask; if (I == LiveInOrOut.end()) { |

