Index: lib/Transforms/Scalar/EarlyCSE.cpp =================================================================== --- lib/Transforms/Scalar/EarlyCSE.cpp +++ lib/Transforms/Scalar/EarlyCSE.cpp @@ -214,9 +214,7 @@ return false; CallInst *CI = dyn_cast(Inst); - if (!CI || !CI->onlyReadsMemory()) - return false; - return true; + return CI && CI->onlyReadsMemory(); } }; } Index: lib/Transforms/Scalar/GVN.cpp =================================================================== --- lib/Transforms/Scalar/GVN.cpp +++ lib/Transforms/Scalar/GVN.cpp @@ -95,9 +95,7 @@ return true; if (type != other.type) return false; - if (varargs != other.varargs) - return false; - return true; + return varargs == other.varargs; } friend hash_code hash_value(const Expression &Value) { @@ -843,11 +841,8 @@ return false; // The store has to be at least as big as the load. - if (DL.getTypeSizeInBits(StoredVal->getType()) < - DL.getTypeSizeInBits(LoadTy)) - return false; - - return true; + return DL.getTypeSizeInBits(StoredVal->getType()) >= + DL.getTypeSizeInBits(LoadTy); } /// If we saw a store of a value to memory, and Index: lib/Transforms/Scalar/IndVarSimplify.cpp =================================================================== --- lib/Transforms/Scalar/IndVarSimplify.cpp +++ lib/Transforms/Scalar/IndVarSimplify.cpp @@ -1290,10 +1290,7 @@ if (!isa(L->getExitingBlock()->getTerminator())) return false; - if (Rewriter.isHighCostExpansion(BackedgeTakenCount, L)) - return false; - - return true; + return !Rewriter.isHighCostExpansion(BackedgeTakenCount, L); } /// getLoopPhiForCounter - Return the loop header phi IFF IncV adds a loop Index: lib/Transforms/Scalar/JumpThreading.cpp =================================================================== --- lib/Transforms/Scalar/JumpThreading.cpp +++ lib/Transforms/Scalar/JumpThreading.cpp @@ -751,9 +751,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 @@ -694,10 +694,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 @@ -304,10 +304,7 @@ // It should have a precondition block where the generated popcount instrinsic // function will be inserted. PreCondBB = LIRUtil::getPrecondBb(PreHead); - if (!PreCondBB) - return false; - - return true; + return PreCondBB; } Value *NclPopcountRecognize::matchCondition(BranchInst *Br, @@ -651,10 +648,7 @@ bool LoopIdiomRecognize::runOnNoncountableLoop() { NclPopcountRecognize Popcount(*this); - if (Popcount.recognize()) - return true; - - return false; + return Popcount.recognize(); } bool LoopIdiomRecognize::runOnLoop(Loop *L, LPPassManager &LPM) { 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 didnt 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 @@ -2852,12 +2852,8 @@ return false; int64_t IncOffset = IncConst->getValue()->getSExtValue(); - if (!isAlwaysFoldable(TTI, LSRUse::Address, - getAccessType(UserInst), /*BaseGV=*/ nullptr, - IncOffset, /*HaseBaseReg=*/ false)) - return false; - - return true; + return isAlwaysFoldable(TTI, LSRUse::Address, getAccessType(UserInst), + /*BaseGV=*/nullptr, IncOffset, /*HaseBaseReg=*/false); } /// GenerateIVChains - Generate an add or subtract for each IVInc in a chain to Index: lib/Transforms/Scalar/LoopUnrollPass.cpp =================================================================== --- lib/Transforms/Scalar/LoopUnrollPass.cpp +++ lib/Transforms/Scalar/LoopUnrollPass.cpp @@ -980,9 +980,7 @@ } // Unroll the loop. - if (!UnrollLoop(L, Count, TripCount, AllowRuntime, UP.AllowExpensiveTripCount, - TripMultiple, LI, this, &LPM, &AC)) - return false; - - return true; + return UnrollLoop(L, Count, TripCount, AllowRuntime, + UP.AllowExpensiveTripCount, TripMultiple, LI, this, &LPM, + &AC); } Index: lib/Transforms/Scalar/MergedLoadStoreMotion.cpp =================================================================== --- lib/Transforms/Scalar/MergedLoadStoreMotion.cpp +++ lib/Transforms/Scalar/MergedLoadStoreMotion.cpp @@ -225,9 +225,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/PlaceSafepoints.cpp =================================================================== --- lib/Transforms/Scalar/PlaceSafepoints.cpp +++ lib/Transforms/Scalar/PlaceSafepoints.cpp @@ -200,10 +200,7 @@ if (call->isInlineAsm()) return false; } - if (isStatepoint(CS) || isGCRelocate(CS) || isGCResult(CS)) { - return false; - } - return true; + return !(isStatepoint(CS) || isGCRelocate(CS) || isGCResult(CS)); } static Value *ReplaceWithStatepoint(const CallSite &CS, Pass *P); @@ -794,10 +791,7 @@ bool isLeaf = F && F->getFnAttribute("gc-leaf-function").getValueAsString().equals("true"); - if (isLeaf) { - return true; - } - return false; + return isLeaf; } static void Index: lib/Transforms/Scalar/Reassociate.cpp =================================================================== --- lib/Transforms/Scalar/Reassociate.cpp +++ lib/Transforms/Scalar/Reassociate.cpp @@ -1005,12 +1005,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/SROA.cpp =================================================================== --- lib/Transforms/Scalar/SROA.cpp +++ lib/Transforms/Scalar/SROA.cpp @@ -177,9 +177,7 @@ return false; if (isSplittable() != RHS.isSplittable()) return !isSplittable(); - if (endOffset() > RHS.endOffset()) - return true; - return false; + return endOffset() > RHS.endOffset(); } /// \brief Support comparison with a single offset to allow binary searches. @@ -1863,9 +1861,7 @@ if (NewTy->isPointerTy() || OldTy->isPointerTy()) { if (NewTy->isPointerTy() && OldTy->isPointerTy()) return true; - if (NewTy->isIntegerTy() || OldTy->isIntegerTy()) - return true; - return false; + return NewTy->isIntegerTy() || OldTy->isIntegerTy(); } return true; Index: lib/Transforms/Scalar/ScalarReplAggregates.cpp =================================================================== --- lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -1785,13 +1785,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 Index: lib/Transforms/Scalar/Sink.cpp =================================================================== --- lib/Transforms/Scalar/Sink.cpp +++ lib/Transforms/Scalar/Sink.cpp @@ -169,10 +169,7 @@ return false; } - if (isa(Inst) || isa(Inst)) - return false; - - return true; + return !isa(Inst) && !isa(Inst); } /// IsAcceptableTarget - Return true if it is possible to sink the instruction