more efficient use of a dyn_cast; no functional change intended
authorSanjay Patel <spatel@rotateright.com>
Fri, 9 Jan 2015 16:28:15 +0000 (16:28 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 9 Jan 2015 16:28:15 +0000 (16:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225523 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LazyValueInfo.cpp

index 342d1d13834f6be93594f8a2a64a469aa62e70df..f7f5e32d4429da0e9cddb39ce63a6d6fd00bcfc1 100644 (file)
@@ -905,9 +905,9 @@ static bool getEdgeValueLocal(Value *Val, BasicBlock *BBFrom,
       
       // If the condition of the branch is an equality comparison, we may be
       // able to infer the value.
-      ICmpInst *ICI = dyn_cast<ICmpInst>(BI->getCondition());
-      if (getValueFromFromCondition(Val, ICI, Result, isTrueDest))
-        return true;
+      if (ICmpInst *ICI = dyn_cast<ICmpInst>(BI->getCondition()))
+        if (getValueFromFromCondition(Val, ICI, Result, isTrueDest))
+          return true;
     }
   }