Index: lib/Transforms/InstCombine/InstCombineAddSub.cpp =================================================================== --- lib/Transforms/InstCombine/InstCombineAddSub.cpp +++ lib/Transforms/InstCombine/InstCombineAddSub.cpp @@ -931,10 +931,7 @@ // Check if carry bit of addition will not cause overflow. if (checkRippleForAdd(LHSKnownZero, RHSKnownZero)) return true; - if (checkRippleForAdd(RHSKnownZero, LHSKnownZero)) - return true; - - return false; + return checkRippleForAdd(RHSKnownZero, LHSKnownZero); } /// \brief Return true if we can prove that: @@ -980,10 +977,7 @@ &CxtI); ComputeSignBit(RHS, RHSKnownNonNegative, RHSKnownNegative, /*Depth=*/0, &CxtI); - if (LHSKnownNegative && RHSKnownNonNegative) - return true; - - return false; + return LHSKnownNegative && RHSKnownNonNegative; } // Checks if any operand is negative and we can convert add to sub. Index: lib/Transforms/InstCombine/InstCombineCalls.cpp =================================================================== --- lib/Transforms/InstCombine/InstCombineCalls.cpp +++ lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -1288,9 +1288,7 @@ Type* DstTy = cast(CI->getType())->getElementType(); if (!SrcTy->isSized() || !DstTy->isSized()) return false; - if (DL.getTypeAllocSize(SrcTy) != DL.getTypeAllocSize(DstTy)) - return false; - return true; + return DL.getTypeAllocSize(SrcTy) == DL.getTypeAllocSize(DstTy); } // Try to fold some different type of calls here. Index: lib/Transforms/InstCombine/InstCombineCasts.cpp =================================================================== --- lib/Transforms/InstCombine/InstCombineCasts.cpp +++ lib/Transforms/InstCombine/InstCombineCasts.cpp @@ -278,10 +278,7 @@ // If this is a vector sext from a compare, then we don't want to break the // idiom where each element of the extended vector is either zero or all ones. - if (opc == Instruction::SExt && isa(V) && Ty->isVectorTy()) - return false; - - return true; + return opc != Instruction::SExt || !isa(V) || !Ty->isVectorTy(); } Index: lib/Transforms/InstCombine/InstCombineCompares.cpp =================================================================== --- lib/Transforms/InstCombine/InstCombineCompares.cpp +++ lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -2556,9 +2556,7 @@ if (!BI || BI->getNumSuccessors() != 2) return false; auto *IC = dyn_cast(BI->getCondition()); - if (!IC || (IC->getOperand(0) != SI && IC->getOperand(1) != SI)) - return false; - return true; + return IC && (IC->getOperand(0) == SI || IC->getOperand(1) == SI); } /// Index: lib/Transforms/InstCombine/InstructionCombining.cpp =================================================================== --- lib/Transforms/InstCombine/InstructionCombining.cpp +++ lib/Transforms/InstCombine/InstructionCombining.cpp @@ -97,10 +97,7 @@ // Otherwise, if both are illegal, do not increase the size of the result. We // do allow things like i160 -> i64, but not i64 -> i160. - if (!FromLegal && !ToLegal && ToWidth > FromWidth) - return false; - - return true; + return FromLegal || ToLegal || ToWidth <= FromWidth; } // Return true, if No Signed Wrap should be maintained for I. @@ -959,10 +956,7 @@ // If this GEP has only 0 indices, it is the same pointer as // Src. If Src is not a trivial GEP too, don't combine // the indices. - if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() && - !Src.hasOneUse()) - return false; - return true; + return !GEP.hasAllZeroIndices() || Src.hasAllZeroIndices() || Src.hasOneUse(); } /// Descale - Return a value X such that Val = X * Scale, or null if none. If