Index: lib/Transforms/Scalar/EarlyCSE.cpp =================================================================== --- lib/Transforms/Scalar/EarlyCSE.cpp +++ lib/Transforms/Scalar/EarlyCSE.cpp @@ -215,9 +215,7 @@ return false; CallInst *CI = dyn_cast(Inst); - if (!CI || !CI->onlyReadsMemory()) - return false; - return true; + return !(!CI || !CI->onlyReadsMemory()); } }; } Index: lib/Transforms/Scalar/JumpThreading.cpp =================================================================== --- lib/Transforms/Scalar/JumpThreading.cpp +++ lib/Transforms/Scalar/JumpThreading.cpp @@ -790,9 +790,7 @@ // All the rest of our checks depend on the condition being an instruction. if (!CondInst) { // FIXME: Unify this with code below. - if (ProcessThreadableEdges(Condition, BB, Preference, Terminator)) - return true; - return false; + return ProcessThreadableEdges(Condition, BB, Preference, Terminator); } Index: lib/Transforms/Scalar/LICM.cpp =================================================================== --- lib/Transforms/Scalar/LICM.cpp +++ lib/Transforms/Scalar/LICM.cpp @@ -726,10 +726,7 @@ // As a degenerate case, if the loop is statically infinite then we haven't // proven anything since there are no exit blocks. - if (ExitBlocks.empty()) - return false; - - return true; + return !ExitBlocks.empty(); } namespace { Index: lib/Transforms/Scalar/LoopIdiomRecognize.cpp =================================================================== --- lib/Transforms/Scalar/LoopIdiomRecognize.cpp +++ lib/Transforms/Scalar/LoopIdiomRecognize.cpp @@ -659,12 +659,7 @@ return true; } -bool LoopIdiomRecognize::runOnNoncountableLoop() { - if (recognizePopcount()) - return true; - - return false; -} +bool LoopIdiomRecognize::runOnNoncountableLoop() { return recognizePopcount(); } /// Check if the given conditional branch is based on the comparison between /// a variable and zero, and if the variable is non-zero, the control yields to Index: lib/Transforms/Scalar/LoopInterchange.cpp =================================================================== --- lib/Transforms/Scalar/LoopInterchange.cpp +++ lib/Transforms/Scalar/LoopInterchange.cpp @@ -177,9 +177,7 @@ } // We don't have a DepMatrix to check legality return false - if (DepMatrix.size() == 0) - return false; - return true; + return DepMatrix.size() != 0; } // A loop is moved from index 'from' to an index 'to'. Update the Dependence @@ -838,10 +836,7 @@ } // The loop latch ended and we didn't find the induction variable return as // current limitation. - if (!FoundInduction) - return true; - - return false; + return !FoundInduction; } bool LoopInterchangeLegality::canInterchangeLoops(unsigned InnerLoopId, Index: lib/Transforms/Scalar/LoopStrengthReduce.cpp =================================================================== --- lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -2843,11 +2843,8 @@ MemAccessTy AccessTy = getAccessType(UserInst); int64_t IncOffset = IncConst->getValue()->getSExtValue(); - if (!isAlwaysFoldable(TTI, LSRUse::Address, AccessTy, /*BaseGV=*/nullptr, - IncOffset, /*HaseBaseReg=*/false)) - return false; - - return true; + return isAlwaysFoldable(TTI, LSRUse::Address, AccessTy, /*BaseGV=*/nullptr, + IncOffset, /*HaseBaseReg=*/false); } /// Generate an add or subtract for each IVInc in a chain to materialize the IV Index: lib/Transforms/Scalar/MergedLoadStoreMotion.cpp =================================================================== --- lib/Transforms/Scalar/MergedLoadStoreMotion.cpp +++ lib/Transforms/Scalar/MergedLoadStoreMotion.cpp @@ -228,9 +228,7 @@ BasicBlock *Tail = Succ0->getTerminator()->getSuccessor(0); // Ignore triangles. - if (Succ1->getTerminator()->getSuccessor(0) != Tail) - return false; - return true; + return Succ1->getTerminator()->getSuccessor(0) == Tail; } /// Index: lib/Transforms/Scalar/Reassociate.cpp =================================================================== --- lib/Transforms/Scalar/Reassociate.cpp +++ lib/Transforms/Scalar/Reassociate.cpp @@ -984,12 +984,9 @@ isReassociableOp(V1, Instruction::Sub, Instruction::FSub)) return true; Value *VB = Sub->user_back(); - if (Sub->hasOneUse() && - (isReassociableOp(VB, Instruction::Add, Instruction::FAdd) || - isReassociableOp(VB, Instruction::Sub, Instruction::FSub))) - return true; - - return false; + return Sub->hasOneUse() && + (isReassociableOp(VB, Instruction::Add, Instruction::FAdd) || + isReassociableOp(VB, Instruction::Sub, Instruction::FSub)); } /// If we have (X-Y), and if either X is an add, or if this is only used by an Index: lib/Transforms/Scalar/ScalarReplAggregates.cpp =================================================================== --- lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -1786,13 +1786,9 @@ unsigned NumElts1, NumElts2; Type *EltTy1, *EltTy2; - if (isHomogeneousAggregate(T1, NumElts1, EltTy1) && - isHomogeneousAggregate(T2, NumElts2, EltTy2) && - NumElts1 == NumElts2 && - EltTy1 == EltTy2) - return true; - - return false; + return isHomogeneousAggregate(T1, NumElts1, EltTy1) && + isHomogeneousAggregate(T2, NumElts2, EltTy2) && NumElts1 == NumElts2 && + EltTy1 == EltTy2; } /// isSafeMemAccess - Check if a load/store/memcpy operates on the entire AI