diff options
author | Owen Anderson <resistor@mac.com> | 2010-08-11 04:24:25 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-08-11 04:24:25 +0000 |
commit | 0bd61240e9617ea2180f14b3f2c13291fd4f693c (patch) | |
tree | e938839fe2de0ed9d3953195092524e3620b06c6 /llvm/lib/Analysis/LazyValueInfo.cpp | |
parent | 2235f32bbdddf52d1e3a1119c747a0861143616d (diff) | |
download | bcm5719-llvm-0bd61240e9617ea2180f14b3f2c13291fd4f693c.tar.gz bcm5719-llvm-0bd61240e9617ea2180f14b3f2c13291fd4f693c.zip |
Improve indentation.
llvm-svn: 110778
Diffstat (limited to 'llvm/lib/Analysis/LazyValueInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/LazyValueInfo.cpp | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index 48778232002..c932e81e245 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -511,37 +511,38 @@ LVILatticeVal LVIQuery::getEdgeValue(BasicBlock *BBFrom, BasicBlock *BBTo) { // If the condition of the branch is an equality comparison, we may be // able to infer the value. - if (ICmpInst *ICI = dyn_cast<ICmpInst>(BI->getCondition())) - if (ICI->getOperand(0) == Val && isa<Constant>(ICI->getOperand(1))) { - if (ICI->isEquality()) { - // We know that V has the RHS constant if this is a true SETEQ or - // false SETNE. - if (isTrueDest == (ICI->getPredicate() == ICmpInst::ICMP_EQ)) - return LVILatticeVal::get(cast<Constant>(ICI->getOperand(1))); - return LVILatticeVal::getNot(cast<Constant>(ICI->getOperand(1))); - } else if (ConstantInt *CI = - dyn_cast<ConstantInt>(ICI->getOperand(1))) { - - // Calculate the range of values that would satisfy the comparison. - ConstantRange CmpRange(CI->getValue(), CI->getValue()+1); - ConstantRange TrueValues = - ConstantRange::makeICmpRegion(ICI->getPredicate(), CmpRange); - - // If we're interested in the false dest, invert the condition. - if (!isTrueDest) TrueValues = TrueValues.inverse(); + ICmpInst *ICI = dyn_cast<ICmpInst>(BI->getCondition()); + if (ICI && ICI->getOperand(0) == Val && + isa<Constant>(ICI->getOperand(1))) { + if (ICI->isEquality()) { + // We know that V has the RHS constant if this is a true SETEQ or + // false SETNE. + if (isTrueDest == (ICI->getPredicate() == ICmpInst::ICMP_EQ)) + return LVILatticeVal::get(cast<Constant>(ICI->getOperand(1))); + return LVILatticeVal::getNot(cast<Constant>(ICI->getOperand(1))); + } + + if (ConstantInt *CI = dyn_cast<ConstantInt>(ICI->getOperand(1))) { + // Calculate the range of values that would satisfy the comparison. + ConstantRange CmpRange(CI->getValue(), CI->getValue()+1); + ConstantRange TrueValues = + ConstantRange::makeICmpRegion(ICI->getPredicate(), CmpRange); - // Figure out the possible values of the query BEFORE this branch. - LVILatticeVal InBlock = getBlockValue(BBFrom); - if (!InBlock.isConstantRange()) return InBlock; + // If we're interested in the false dest, invert the condition. + if (!isTrueDest) TrueValues = TrueValues.inverse(); + + // Figure out the possible values of the query BEFORE this branch. + LVILatticeVal InBlock = getBlockValue(BBFrom); + if (!InBlock.isConstantRange()) return InBlock; - // Find all potential values that satisfy both the input and output - // conditions. - ConstantRange PossibleValues = - TrueValues.intersectWith(InBlock.getConstantRange()); + // Find all potential values that satisfy both the input and output + // conditions. + ConstantRange PossibleValues = + TrueValues.intersectWith(InBlock.getConstantRange()); - return LVILatticeVal::getRange(PossibleValues); - } + return LVILatticeVal::getRange(PossibleValues); } + } } } |