From 0e613f7c652b0ad33bb6768bb419698fcd544124 Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Tue, 6 Dec 2016 02:36:58 +0000 Subject: [PATCH] [LVI] Remove duplicate code using existing helper function llvm-svn: 288761 --- llvm/lib/Analysis/LazyValueInfo.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index 646895a..fb7c949 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/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; } -- 2.7.4