]> granicus.if.org Git - llvm/commitdiff
[LVI] Remove duplicate code using existing helper function
authorPhilip Reames <listmail@philipreames.com>
Tue, 6 Dec 2016 02:36:58 +0000 (02:36 +0000)
committerPhilip Reames <listmail@philipreames.com>
Tue, 6 Dec 2016 02:36:58 +0000 (02:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288761 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LazyValueInfo.cpp

index 646895a0dfffbb786d1299651a957653267ffdb0..fb7c949e12d93710e9653c3a3ec8c940e52802a6 100644 (file)
@@ -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;
 }