forked from OSchip/llvm-project
[SCEV] Extract helper function from isImpliedCond; NFC
Summary: This new helper routine will be used in a subsequent change. Reviewers: hfinkel Subscribers: hfinkel, sanjoy, llvm-commits Differential Revision: http://reviews.llvm.org/D12949 llvm-svn: 248607
This commit is contained in:
parent
fdec9deb13
commit
df1635d394
|
@ -506,6 +506,13 @@ namespace llvm {
|
|||
Value *FoundCondValue,
|
||||
bool Inverse);
|
||||
|
||||
/// Test whether the condition described by Pred, LHS, and RHS is true
|
||||
/// whenever the condition described by FoundPred, FoundLHS, FoundRHS is
|
||||
/// true.
|
||||
bool isImpliedCond(ICmpInst::Predicate Pred, const SCEV *LHS,
|
||||
const SCEV *RHS, ICmpInst::Predicate FoundPred,
|
||||
const SCEV *FoundLHS, const SCEV *FoundRHS);
|
||||
|
||||
/// Test whether the condition described by Pred, LHS, and RHS is true
|
||||
/// whenever the condition described by Pred, FoundLHS, and FoundRHS is
|
||||
/// true.
|
||||
|
|
|
@ -7151,6 +7151,14 @@ bool ScalarEvolution::isImpliedCond(ICmpInst::Predicate Pred,
|
|||
const SCEV *FoundLHS = getSCEV(ICI->getOperand(0));
|
||||
const SCEV *FoundRHS = getSCEV(ICI->getOperand(1));
|
||||
|
||||
return isImpliedCond(Pred, LHS, RHS, FoundPred, FoundLHS, FoundRHS);
|
||||
}
|
||||
|
||||
bool ScalarEvolution::isImpliedCond(ICmpInst::Predicate Pred, const SCEV *LHS,
|
||||
const SCEV *RHS,
|
||||
ICmpInst::Predicate FoundPred,
|
||||
const SCEV *FoundLHS,
|
||||
const SCEV *FoundRHS) {
|
||||
// Balance the types.
|
||||
if (getTypeSizeInBits(LHS->getType()) <
|
||||
getTypeSizeInBits(FoundLHS->getType())) {
|
||||
|
|
Loading…
Reference in New Issue