Skip to content

Commit 59723e4

Browse files
[Target] Use llvm::is_contained (NFC)
1 parent e7541f5 commit 59723e4

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,15 +2219,11 @@ bool HexagonInstrInfo::isDependent(const MachineInstr &ProdMI,
22192219
if (RegA == RegB)
22202220
return true;
22212221

2222-
if (RegA.isPhysical())
2223-
for (MCPhysReg SubReg : HRI.subregs(RegA))
2224-
if (RegB == SubReg)
2225-
return true;
2226-
2227-
if (RegB.isPhysical())
2228-
for (MCPhysReg SubReg : HRI.subregs(RegB))
2229-
if (RegA == SubReg)
2230-
return true;
2222+
if (RegA.isPhysical() && llvm::is_contained(HRI.subregs(RegA), RegB))
2223+
return true;
2224+
2225+
if (RegB.isPhysical() && llvm::is_contained(HRI.subregs(RegB), RegA))
2226+
return true;
22312227
}
22322228

22332229
return false;

llvm/lib/Target/WebAssembly/WebAssemblyDebugValueManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ WebAssemblyDebugValueManager::getSinkableDebugValues(
107107
SmallDenseMap<DebugVariable, SmallVector<MachineInstr *, 2>>
108108
SeenDbgVarToDbgValues;
109109
for (auto *DV : DbgValuesInBetween) {
110-
if (std::find(DbgValues.begin(), DbgValues.end(), DV) == DbgValues.end()) {
110+
if (!llvm::is_contained(DbgValues, DV)) {
111111
DebugVariable Var(DV->getDebugVariable(), DV->getDebugExpression(),
112112
DV->getDebugLoc()->getInlinedAt());
113113
SeenDbgVarToDbgValues[Var].push_back(DV);
@@ -220,7 +220,7 @@ bool WebAssemblyDebugValueManager::isInsertSamePlace(
220220
for (MachineBasicBlock::iterator MI = std::next(Def->getIterator()),
221221
ME = Insert;
222222
MI != ME; ++MI) {
223-
if (std::find(DbgValues.begin(), DbgValues.end(), MI) == DbgValues.end()) {
223+
if (!llvm::is_contained(DbgValues, MI)) {
224224
return false;
225225
}
226226
}

0 commit comments

Comments
 (0)