forked from OSchip/llvm-project
[NFC] Fold isHugeExpression into hasHugeExpression and update callers
accordingly.
This commit is contained in:
parent
b82d18e1e8
commit
de022a8824
|
@ -872,15 +872,12 @@ static inline int sizeOfSCEV(const SCEV *S) {
|
|||
return F.Size;
|
||||
}
|
||||
|
||||
/// Returns true if the subtree of \p S contains at least HugeExprThreshold
|
||||
/// nodes.
|
||||
static bool isHugeExpression(const SCEV *S) {
|
||||
return S->getExpressionSize() >= HugeExprThreshold;
|
||||
}
|
||||
|
||||
/// Returns true of \p Ops contains a huge SCEV (see definition above).
|
||||
/// Returns true if \p Ops contains a huge SCEV (the subtree of S contains at
|
||||
/// least HugeExprThreshold nodes).
|
||||
static bool hasHugeExpression(ArrayRef<const SCEV *> Ops) {
|
||||
return any_of(Ops, isHugeExpression);
|
||||
return any_of(Ops, [](const SCEV *S) {
|
||||
return S->getExpressionSize() >= HugeExprThreshold;
|
||||
});
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
@ -3104,8 +3101,7 @@ const SCEV *ScalarEvolution::getMulExpr(SmallVectorImpl<const SCEV *> &Ops,
|
|||
// Limit max number of arguments to avoid creation of unreasonably big
|
||||
// SCEVAddRecs with very complex operands.
|
||||
if (AddRec->getNumOperands() + OtherAddRec->getNumOperands() - 1 >
|
||||
MaxAddRecSize || isHugeExpression(AddRec) ||
|
||||
isHugeExpression(OtherAddRec))
|
||||
MaxAddRecSize || hasHugeExpression({AddRec, OtherAddRec}))
|
||||
continue;
|
||||
|
||||
bool Overflow = false;
|
||||
|
|
Loading…
Reference in New Issue