Skip to content

Commit

Permalink
[CodeGen] Use llvm::is_contained (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Nov 20, 2020
1 parent fbfbfa5 commit 2583d8e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
Expand Up @@ -198,8 +198,7 @@ static bool rescheduleCanonically(unsigned &PseudoIdempotentInstCount,

if (II->getOperand(i).isReg()) {
if (!Register::isVirtualRegister(II->getOperand(i).getReg()))
if (llvm::find(PhysRegDefs, II->getOperand(i).getReg()) ==
PhysRegDefs.end()) {
if (!llvm::is_contained(PhysRegDefs, II->getOperand(i).getReg())) {
continue;
}
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/MachineBasicBlock.cpp
Expand Up @@ -753,7 +753,7 @@ void MachineBasicBlock::splitSuccessor(MachineBasicBlock *Old,
bool NormalizeSuccProbs) {
succ_iterator OldI = llvm::find(successors(), Old);
assert(OldI != succ_end() && "Old is not a successor of this block!");
assert(llvm::find(successors(), New) == succ_end() &&
assert(!llvm::is_contained(successors(), New) &&
"New is already a successor of this block!");

// Add a new successor with equal probability as the original one. Note
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Expand Up @@ -9255,8 +9255,7 @@ bool SDNode::areOnlyUsersOf(ArrayRef<const SDNode *> Nodes, const SDNode *N) {
bool Seen = false;
for (SDNode::use_iterator I = N->use_begin(), E = N->use_end(); I != E; ++I) {
SDNode *User = *I;
if (llvm::any_of(Nodes,
[&User](const SDNode *Node) { return User == Node; }))
if (llvm::is_contained(Nodes, User))
Seen = true;
else
return false;
Expand Down

0 comments on commit 2583d8e

Please sign in to comment.