Skip to content

Commit 2583d8e

Browse files
[CodeGen] Use llvm::is_contained (NFC)
1 parent fbfbfa5 commit 2583d8e

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

llvm/lib/CodeGen/MIRCanonicalizerPass.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ static bool rescheduleCanonically(unsigned &PseudoIdempotentInstCount,
198198

199199
if (II->getOperand(i).isReg()) {
200200
if (!Register::isVirtualRegister(II->getOperand(i).getReg()))
201-
if (llvm::find(PhysRegDefs, II->getOperand(i).getReg()) ==
202-
PhysRegDefs.end()) {
201+
if (!llvm::is_contained(PhysRegDefs, II->getOperand(i).getReg())) {
203202
continue;
204203
}
205204
}

llvm/lib/CodeGen/MachineBasicBlock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ void MachineBasicBlock::splitSuccessor(MachineBasicBlock *Old,
753753
bool NormalizeSuccProbs) {
754754
succ_iterator OldI = llvm::find(successors(), Old);
755755
assert(OldI != succ_end() && "Old is not a successor of this block!");
756-
assert(llvm::find(successors(), New) == succ_end() &&
756+
assert(!llvm::is_contained(successors(), New) &&
757757
"New is already a successor of this block!");
758758

759759
// Add a new successor with equal probability as the original one. Note

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9255,8 +9255,7 @@ bool SDNode::areOnlyUsersOf(ArrayRef<const SDNode *> Nodes, const SDNode *N) {
92559255
bool Seen = false;
92569256
for (SDNode::use_iterator I = N->use_begin(), E = N->use_end(); I != E; ++I) {
92579257
SDNode *User = *I;
9258-
if (llvm::any_of(Nodes,
9259-
[&User](const SDNode *Node) { return User == Node; }))
9258+
if (llvm::is_contained(Nodes, User))
92609259
Seen = true;
92619260
else
92629261
return false;

0 commit comments

Comments
 (0)