mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
[C++11] Convert sort predicates into lambdas.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203288 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1674,15 +1674,6 @@ SCEVExpander::getOrInsertCanonicalInductionVariable(const Loop *L,
|
||||
return V;
|
||||
}
|
||||
|
||||
/// Sort values by integer width for replaceCongruentIVs.
|
||||
static bool width_descending(Value *lhs, Value *rhs) {
|
||||
// Put pointers at the back and make sure pointer < pointer = false.
|
||||
if (!lhs->getType()->isIntegerTy() || !rhs->getType()->isIntegerTy())
|
||||
return rhs->getType()->isIntegerTy() && !lhs->getType()->isIntegerTy();
|
||||
return rhs->getType()->getPrimitiveSizeInBits()
|
||||
< lhs->getType()->getPrimitiveSizeInBits();
|
||||
}
|
||||
|
||||
/// replaceCongruentIVs - Check for congruent phis in this loop header and
|
||||
/// replace them with their most canonical representative. Return the number of
|
||||
/// phis eliminated.
|
||||
@@ -1699,7 +1690,13 @@ unsigned SCEVExpander::replaceCongruentIVs(Loop *L, const DominatorTree *DT,
|
||||
Phis.push_back(Phi);
|
||||
}
|
||||
if (TTI)
|
||||
std::sort(Phis.begin(), Phis.end(), width_descending);
|
||||
std::sort(Phis.begin(), Phis.end(), [](Value *LHS, Value *RHS) {
|
||||
// Put pointers at the back and make sure pointer < pointer = false.
|
||||
if (!LHS->getType()->isIntegerTy() || !RHS->getType()->isIntegerTy())
|
||||
return RHS->getType()->isIntegerTy() && !LHS->getType()->isIntegerTy();
|
||||
return RHS->getType()->getPrimitiveSizeInBits() <
|
||||
LHS->getType()->getPrimitiveSizeInBits();
|
||||
});
|
||||
|
||||
unsigned NumElim = 0;
|
||||
DenseMap<const SCEV *, PHINode *> ExprToIVMap;
|
||||
|
Reference in New Issue
Block a user