[llvm] r267481 - [LVI] Make a precondition explicit rather than handling a case which never happens [NFC]

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 15:21:25 PDT 2016


Author: reames
Date: Mon Apr 25 17:21:24 2016
New Revision: 267481

URL: http://llvm.org/viewvc/llvm-project?rev=267481&view=rev
Log:
[LVI] Make a precondition explicit rather than handling a case which never happens [NFC]


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=267481&r1=267480&r2=267481&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LazyValueInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/LazyValueInfo.cpp Mon Apr 25 17:21:24 2016
@@ -1116,7 +1116,8 @@ bool LazyValueInfoCache::solveBlockValue
 
 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. 




More information about the llvm-commits mailing list