From: Philip Reames Date: Tue, 6 Dec 2016 02:36:58 +0000 (+0000) Subject: [LVI] Remove duplicate code using existing helper function X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d37747e061dcd4cd71c54934c39170832a547837;p=llvm [LVI] Remove duplicate code using existing helper function git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288761 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/LazyValueInfo.cpp b/lib/Analysis/LazyValueInfo.cpp index 646895a0dff..fb7c949e12d 100644 --- a/lib/Analysis/LazyValueInfo.cpp +++ b/lib/Analysis/LazyValueInfo.cpp @@ -1159,10 +1159,8 @@ bool LazyValueInfoImpl::solveBlockValueCast(LVILatticeVal &BBLV, // NOTE: We're currently limited by the set of operations that ConstantRange // can evaluate symbolically. Enhancing that set will allows us to analyze // more definitions. - LVILatticeVal Result; auto CastOp = (Instruction::CastOps) BBI->getOpcode(); - Result.markConstantRange(LHSRange.castOp(CastOp, ResultBitWidth)); - BBLV = Result; + BBLV = LVILatticeVal::getRange(LHSRange.castOp(CastOp, ResultBitWidth)); return true; } @@ -1220,10 +1218,8 @@ bool LazyValueInfoImpl::solveBlockValueBinaryOp(LVILatticeVal &BBLV, // NOTE: We're currently limited by the set of operations that ConstantRange // can evaluate symbolically. Enhancing that set will allows us to analyze // more definitions. - LVILatticeVal Result; auto BinOp = (Instruction::BinaryOps) BBI->getOpcode(); - Result.markConstantRange(LHSRange.binaryOp(BinOp, RHSRange)); - BBLV = Result; + BBLV = LVILatticeVal::getRange(LHSRange.binaryOp(BinOp, RHSRange)); return true; }