Refactor: Simplify boolean expressions in lib/Analysis
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 24 Mar 2015 16:33:19 +0000 (16:33 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 24 Mar 2015 16:33:19 +0000 (16:33 +0000)
Simplify boolean expressions using `true` and `false` with `clang-tidy`

Patch by Richard Thomson.

Reviewed By: nlewycky

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233091 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolution.cpp

index c3290e0a12368439151bbe5854eb990ba2bfd1ed..fdfe5cbd4989f5d71d651d39912e5890db2ce9ea 100644 (file)
@@ -5308,12 +5308,9 @@ static bool canConstantEvolve(Instruction *I, const Loop *L) {
   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