[llvm] r288761 - [LVI] Remove duplicate code using existing helper function

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 18:36:59 PST 2016


Author: reames
Date: Mon Dec  5 20:36:58 2016
New Revision: 288761

URL: http://llvm.org/viewvc/llvm-project?rev=288761&view=rev
Log:
[LVI] Remove duplicate code using existing helper function


Modified:
    llvm/trunk/lib/Analysis/LazyValueInfo.cpp

Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyValueInfo.cpp?rev=288761&r1=288760&r2=288761&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LazyValueInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/LazyValueInfo.cpp Mon Dec  5 20:36:58 2016
@@ -1159,10 +1159,8 @@ bool LazyValueInfoImpl::solveBlockValueC
   // 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::solveBlockValueB
   // 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;
 }
 




More information about the llvm-commits mailing list