Index: lib/CodeGen/SelectionDAG/DAGCombiner.cpp =================================================================== --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -691,9 +691,7 @@ /// it is profitable to do so. bool DAGCombiner::isOneUseSetCC(SDValue N) const { SDValue N0, N1, N2; - if (isSetCCEquivalent(N, N0, N1, N2) && N.getNode()->hasOneUse()) - return true; - return false; + return isSetCCEquivalent(N, N0, N1, N2) && N.getNode()->hasOneUse(); } /// Returns true if N is a BUILD_VECTOR node whose @@ -9805,11 +9803,8 @@ // Check that the zext is legal if it needs one. EVT TruncateType = Inst->getValueType(0); - if (TruncateType != SliceType && - !TLI.isOperationLegal(ISD::ZERO_EXTEND, TruncateType)) - return false; - - return true; + return TruncateType == SliceType || + TLI.isOperationLegal(ISD::ZERO_EXTEND, TruncateType); } /// \brief Get the offset in bytes of this slice in the original chunk of @@ -9912,10 +9907,7 @@ return false; // 3. Check that we do not have a zext in the way. - if (Inst->getValueType(0) != getLoadedType()) - return false; - - return true; + return Inst->getValueType(0) == getLoadedType(); } }; } Index: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp =================================================================== --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -2314,9 +2314,7 @@ // GNU sin/cos functions set errno while sincos does not. Therefore // combining sin and cos is only safe if unsafe-fpmath is enabled. bool isGNU = Triple(TM.getTargetTriple()).getEnvironment() == Triple::GNU; - if (isGNU && !TM.Options.UnsafeFPMath) - return false; - return true; + return !isGNU || TM.Options.UnsafeFPMath; } /// Only issue sincos libcall if both sin and cos are needed. Index: lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp =================================================================== --- lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -2332,11 +2332,10 @@ // // Note: The ScheduleHazardRecognizer interface requires a non-const SU. static bool BUHasStall(SUnit *SU, int Height, RegReductionPQBase *SPQ) { - if ((int)SPQ->getCurCycle() < Height) return true; - if (SPQ->getHazardRec()->getHazardType(SU, 0) - != ScheduleHazardRecognizer::NoHazard) + if ((int)SPQ->getCurCycle() < Height) return true; - return false; + return SPQ->getHazardRec()->getHazardType(SU, 0) != + ScheduleHazardRecognizer::NoHazard; } // Return -1 if left has higher priority, 1 if right has higher priority. @@ -2530,11 +2529,8 @@ if (SU->getHeight() > (CurCycle + ReadyDelay)) return false; - if (SPQ->getHazardRec()->getHazardType(SU, -ReadyDelay) - != ScheduleHazardRecognizer::NoHazard) - return false; - - return true; + return SPQ->getHazardRec()->getHazardType(SU, -ReadyDelay) == + ScheduleHazardRecognizer::NoHazard; } // Return true if right should be scheduled with higher priority than left. @@ -2573,11 +2569,8 @@ bool ilp_ls_rr_sort::isReady(SUnit *SU, unsigned CurCycle) const { if (SU->getHeight() > CurCycle) return false; - if (SPQ->getHazardRec()->getHazardType(SU, 0) - != ScheduleHazardRecognizer::NoHazard) - return false; - - return true; + return SPQ->getHazardRec()->getHazardType(SU, 0) == + ScheduleHazardRecognizer::NoHazard; } static bool canEnableCoalescing(SUnit *SU) { Index: lib/CodeGen/SelectionDAG/SelectionDAG.cpp =================================================================== --- lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -176,9 +176,7 @@ } // Do not accept an all-undef vector. - if (IsAllUndef) - return false; - return true; + return !IsAllUndef; } /// \brief Return true if the specified node is a BUILD_VECTOR node of @@ -2701,15 +2699,12 @@ !isa(Op.getOperand(1))) return false; - if (Op.getOpcode() == ISD::OR && - !MaskedValueIsZero(Op.getOperand(0), - cast(Op.getOperand(1))->getAPIntValue())) - return false; - - return true; + return Op.getOpcode() != ISD::OR || + MaskedValueIsZero( + Op.getOperand(0), + cast(Op.getOperand(1))->getAPIntValue()); } - bool SelectionDAG::isKnownNeverNaN(SDValue Op) const { // If we're told that NaNs won't happen, assume they won't. if (getTarget().Options.NoNaNsFPMath) Index: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp =================================================================== --- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1362,12 +1362,9 @@ // Make sure that the copy dest is not a vreg when the copy source is a // physical register. - if (!OPI2->isReg() || - (!TargetRegisterInfo::isPhysicalRegister(OPI->getReg()) && - TargetRegisterInfo::isPhysicalRegister(OPI2->getReg()))) - return false; - - return true; + return OPI2->isReg() && + (TargetRegisterInfo::isPhysicalRegister(OPI->getReg()) || + !TargetRegisterInfo::isPhysicalRegister(OPI2->getReg())); } /// Find the split point at which to splice the end of BB into its success stack Index: lib/CodeGen/SelectionDAG/TargetLowering.cpp =================================================================== --- lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -264,14 +264,9 @@ return true; // In dynamic-no-pic mode, assume that known defined values are safe. - if (getTargetMachine().getRelocationModel() == Reloc::DynamicNoPIC && - GA && - !GA->getGlobal()->isDeclaration() && - !GA->getGlobal()->isWeakForLinker()) - return true; - - // Otherwise assume nothing is safe. - return false; + return getTargetMachine().getRelocationModel() == Reloc::DynamicNoPIC && GA && + !GA->getGlobal()->isDeclaration() && + !GA->getGlobal()->isWeakForLinker(); } //===----------------------------------------------------------------------===//