[llvm] r233091 - Refactor: Simplify boolean expressions in lib/Analysis

David Blaikie dblaikie at gmail.com
Tue Mar 24 09:33:19 PDT 2015


Author: dblaikie
Date: Tue Mar 24 11:33:19 2015
New Revision: 233091

URL: http://llvm.org/viewvc/llvm-project?rev=233091&view=rev
Log:
Refactor: Simplify boolean expressions in lib/Analysis

Simplify boolean expressions using `true` and `false` with `clang-tidy`

Patch by Richard Thomson.

Reviewed By: nlewycky

Differential Revision: http://reviews.llvm.org/D8528

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

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=233091&r1=233090&r2=233091&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Mar 24 11:33:19 2015
@@ -5308,12 +5308,9 @@ static bool canConstantEvolve(Instructio
   if (!L->contains(I)) return false;
 
   if (isa<PHINode>(I)) {
-    if (L->getHeader() == I->getParent())
-      return true;
-    else
-      // We don't currently keep track of the control flow needed to evaluate
-      // PHIs, so we cannot handle PHIs inside of loops.
-      return false;
+    // We don't currently keep track of the control flow needed to evaluate
+    // PHIs, so we cannot handle PHIs inside of loops.
+    return L->getHeader() == I->getParent();
   }
 
   // If we won't be able to constant fold this expression even if the operands





More information about the llvm-commits mailing list