From 6cbddefc9343d289ed020b0b6e9eeecae9a90a15 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 10 Mar 2017 22:44:47 +0000 Subject: [PATCH] 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 --- lib/CodeGen/BranchCoalescing.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.50.1