[polly] 7552b4d - [polly] Use llvm::erase_value (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 20 23:45:30 PDT 2023
Author: Kazu Hirata
Date: 2023-10-20T23:45:18-07:00
New Revision: 7552b4d9ee7e5e9b6012adeb8c93ca37614da48c
URL: https://github.com/llvm/llvm-project/commit/7552b4d9ee7e5e9b6012adeb8c93ca37614da48c
DIFF: https://github.com/llvm/llvm-project/commit/7552b4d9ee7e5e9b6012adeb8c93ca37614da48c.diff
LOG: [polly] Use llvm::erase_value (NFC)
Added:
Modified:
polly/lib/Analysis/ScopInfo.cpp
Removed:
################################################################################
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index ffa61bb7787f73b..e29474030747b17 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -1647,9 +1647,7 @@ void Scop::removeFromStmtMap(ScopStmt &Stmt) {
} else {
auto StmtMapIt = StmtMap.find(Stmt.getBasicBlock());
if (StmtMapIt != StmtMap.end())
- StmtMapIt->second.erase(std::remove(StmtMapIt->second.begin(),
- StmtMapIt->second.end(), &Stmt),
- StmtMapIt->second.end());
+ llvm::erase_value(StmtMapIt->second, &Stmt);
for (Instruction *Inst : Stmt.getInstructions())
InstStmtMap.erase(Inst);
}
@@ -2424,15 +2422,13 @@ void Scop::removeAccessData(MemoryAccess *Access) {
ValueDefAccs.erase(Access->getAccessValue());
} else if (Access->isOriginalValueKind() && Access->isRead()) {
auto &Uses = ValueUseAccs[Access->getScopArrayInfo()];
- auto NewEnd = std::remove(Uses.begin(), Uses.end(), Access);
- Uses.erase(NewEnd, Uses.end());
+ llvm::erase_value(Uses, Access);
} else if (Access->isOriginalPHIKind() && Access->isRead()) {
PHINode *PHI = cast<PHINode>(Access->getAccessInstruction());
PHIReadAccs.erase(PHI);
} else if (Access->isOriginalAnyPHIKind() && Access->isWrite()) {
auto &Incomings = PHIIncomingAccs[Access->getScopArrayInfo()];
- auto NewEnd = std::remove(Incomings.begin(), Incomings.end(), Access);
- Incomings.erase(NewEnd, Incomings.end());
+ llvm::erase_value(Incomings, Access);
}
}
More information about the llvm-commits
mailing list