Skip to content

Commit

Permalink
Merged main:eb44682d671d into amd-gfx:bd6b8bb61d19
Browse files Browse the repository at this point in the history
Local branch amd-gfx bd6b8bb Merged main:e007b3286429 into amd-gfx:b0c247a55684
Remote branch main eb44682 [Analysis] Use is_contained (NFC)
  • Loading branch information
Sw authored and Sw committed Dec 12, 2020
2 parents bd6b8bb + eb44682 commit 6106c5a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/Analysis/CFG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ bool llvm::isCriticalEdge(const Instruction *TI, const BasicBlock *Dest,
assert(TI->isTerminator() && "Must be a terminator to have successors!");
if (TI->getNumSuccessors() == 1) return false;

assert(find(predecessors(Dest), TI->getParent()) != pred_end(Dest) &&
assert(is_contained(predecessors(Dest), TI->getParent()) &&
"No edge between TI's block and Dest.");

const_pred_iterator I = pred_begin(Dest), E = pred_end(Dest);
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ size_t getSize(Function &F, TargetTransformInfo &TTI) {
size_t Ret = 0;
for (const auto &BB : F)
for (const auto &I : BB)
Ret += TTI.getInstructionCost(
&I, TargetTransformInfo::TargetCostKind::TCK_CodeSize);
Ret += *(TTI.getInstructionCost(
&I, TargetTransformInfo::TargetCostKind::TCK_CodeSize).getValue());
return Ret;
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Analysis/InstructionSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4669,7 +4669,7 @@ static Value *SimplifyShuffleVectorInst(Value *Op0, Value *Op1,
// Don't fold a shuffle with undef mask elements. This may get folded in a
// better way using demanded bits or other analysis.
// TODO: Should we allow this?
if (find(Indices, -1) != Indices.end())
if (is_contained(Indices, -1))
return nullptr;

// Check if every element of this shuffle can be mapped back to the
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Analysis/LazyValueInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ ValueLatticeElement getValueFromCondition(Value *Val, Value *Cond,

// Return true if Usr has Op as an operand, otherwise false.
static bool usesOperand(User *Usr, Value *Op) {
return find(Usr->operands(), Op) != Usr->op_end();
return is_contained(Usr->operands(), Op);
}

// Return true if the instruction type of Val is supported by
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Analysis/ScalarEvolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10639,7 +10639,7 @@ static bool IsMinMaxConsistingOf(const SCEV *MaybeMinMaxExpr,
if (!MinMaxExpr)
return false;

return find(MinMaxExpr->operands(), Candidate) != MinMaxExpr->op_end();
return is_contained(MinMaxExpr->operands(), Candidate);
}

static bool IsKnownPredicateViaAddRecStart(ScalarEvolution &SE,
Expand Down

0 comments on commit 6106c5a

Please sign in to comment.