From: Simon Pilgrim Date: Fri, 10 Mar 2017 22:44:47 +0000 (+0000) Subject: Fix redundant condition (PR32138) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6cbddefc9343d289ed020b0b6e9eeecae9a90a15;p=llvm Fix redundant condition (PR32138) '!A || (A && B)' is equivalent to '!A || B' git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297527 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/BranchCoalescing.cpp b/lib/CodeGen/BranchCoalescing.cpp index efc5d535f52..f2785be4f71 100644 --- a/lib/CodeGen/BranchCoalescing.cpp +++ b/lib/CodeGen/BranchCoalescing.cpp @@ -260,8 +260,8 @@ bool BranchCoalescing::canCoalesceBranch(CoalescingCandidateInfo &Cand) { // For now only consider triangles (i.e, BranchTargetBlock is set, // FalseMBB is null, and BranchTargetBlock is a successor to BranchBlock) - if (!Cand.BranchTargetBlock || (Cand.BranchTargetBlock && FalseMBB) - || !Cand.BranchBlock->isSuccessor(Cand.BranchTargetBlock)) { + if (!Cand.BranchTargetBlock || FalseMBB || + !Cand.BranchBlock->isSuccessor(Cand.BranchTargetBlock)) { DEBUG(dbgs() << "Does not form a triangle - skip\n"); return false; }