OSDN Git Service

[LVI] Make a precondition explicit rather than handling a case which never happens...
authorPhilip Reames <listmail@philipreames.com>
Mon, 25 Apr 2016 22:21:24 +0000 (22:21 +0000)
committerPhilip Reames <listmail@philipreames.com>
Mon, 25 Apr 2016 22:21:24 +0000 (22:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267481 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LazyValueInfo.cpp

index 98136b8..66b64c5 100644 (file)
@@ -1116,7 +1116,8 @@ bool LazyValueInfoCache::solveBlockValueBinaryOp(LVILatticeVal &BBLV,
 
 bool getValueFromFromCondition(Value *Val, ICmpInst *ICI,
                                LVILatticeVal &Result, bool isTrueDest) {
-  if (ICI && isa<Constant>(ICI->getOperand(1))) {
+  assert(ICI && "precondition");
+  if (isa<Constant>(ICI->getOperand(1))) {
     if (ICI->isEquality() && ICI->getOperand(0) == Val) {
       // We know that V has the RHS constant if this is a true SETEQ or
       // false SETNE.