[llvm] r252209 - Refactor: Simplify boolean conditional return statements in llvm/lib/Analysis
Alexander Kornienko via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 5 13:07:13 PST 2015
Author: alexfh
Date: Thu Nov 5 15:07:12 2015
New Revision: 252209
URL: http://llvm.org/viewvc/llvm-project?rev=252209&view=rev
Log:
Refactor: Simplify boolean conditional return statements in llvm/lib/Analysis
Patch by Richard Thomson!
Differential revision: http://reviews.llvm.org/D9967
Modified:
llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
llvm/trunk/lib/Analysis/CaptureTracking.cpp
llvm/trunk/lib/Analysis/CostModel.cpp
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=252209&r1=252208&r2=252209&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Thu Nov 5 15:07:12 2015
@@ -627,10 +627,7 @@ ModRefInfo BasicAAResult::getArgModRefIn
static bool isAssumeIntrinsic(ImmutableCallSite CS) {
const IntrinsicInst *II = dyn_cast<IntrinsicInst>(CS.getInstruction());
- if (II && II->getIntrinsicID() == Intrinsic::assume)
- return true;
-
- return false;
+ return II && II->getIntrinsicID() == Intrinsic::assume;
}
#ifndef NDEBUG
Modified: llvm/trunk/lib/Analysis/CaptureTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CaptureTracking.cpp?rev=252209&r1=252208&r2=252209&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CaptureTracking.cpp (original)
+++ llvm/trunk/lib/Analysis/CaptureTracking.cpp Thu Nov 5 15:07:12 2015
@@ -102,10 +102,7 @@ namespace {
SmallVector<BasicBlock*, 32> Worklist;
Worklist.append(succ_begin(BB), succ_end(BB));
- if (!isPotentiallyReachableFromMany(Worklist, BB, DT))
- return true;
-
- return false;
+ return !isPotentiallyReachableFromMany(Worklist, BB, DT);
}
// If the value is defined in the same basic block as use and BeforeHere,
Modified: llvm/trunk/lib/Analysis/CostModel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CostModel.cpp?rev=252209&r1=252208&r2=252209&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CostModel.cpp (original)
+++ llvm/trunk/lib/Analysis/CostModel.cpp Thu Nov 5 15:07:12 2015
@@ -152,10 +152,7 @@ static bool matchPairwiseShuffleMask(Shu
Mask[i] = val;
SmallVector<int, 16> ActualMask = SI->getShuffleMask();
- if (Mask != ActualMask)
- return false;
-
- return true;
+ return Mask == ActualMask;
}
static bool matchPairwiseReductionAtLevel(const BinaryOperator *BinOp,
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=252209&r1=252208&r2=252209&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Thu Nov 5 15:07:12 2015
@@ -7419,12 +7419,9 @@ bool ScalarEvolution::isKnownPredicateVi
// expensive; and using isKnownNonNegative(RHS) is sufficient for most of the
// interesting cases seen in practice. We can consider "upgrading" L >= 0 to
// use isKnownPredicate later if needed.
- if (isKnownNonNegative(RHS) &&
- isKnownPredicate(CmpInst::ICMP_SGE, LHS, getZero(LHS->getType())) &&
- isKnownPredicate(CmpInst::ICMP_SLT, LHS, RHS))
- return true;
-
- return false;
+ return isKnownNonNegative(RHS) &&
+ isKnownPredicate(CmpInst::ICMP_SGE, LHS, getZero(LHS->getType())) &&
+ isKnownPredicate(CmpInst::ICMP_SLT, LHS, RHS);
}
/// isLoopBackedgeGuardedByCond - Test whether the backedge of the loop is
More information about the llvm-commits
mailing list