Index: lib/Transforms/InstCombine/InstCombineAddSub.cpp =================================================================== --- lib/Transforms/InstCombine/InstCombineAddSub.cpp +++ lib/Transforms/InstCombine/InstCombineAddSub.cpp @@ -980,10 +980,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/InstCombineCompares.cpp =================================================================== --- lib/Transforms/InstCombine/InstCombineCompares.cpp +++ lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -2670,9 +2670,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 @@ -991,10 +991,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(); } /// Return a value X such that Val = X * Scale, or null if none.