[llvm] r297527 - Fix redundant condition (PR32138)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 10 14:44:47 PST 2017
Author: rksimon
Date: Fri Mar 10 16:44:47 2017
New Revision: 297527
URL: http://llvm.org/viewvc/llvm-project?rev=297527&view=rev
Log:
Fix redundant condition (PR32138)
'!A || (A && B)' is equivalent to '!A || B'
Modified:
llvm/trunk/lib/CodeGen/BranchCoalescing.cpp
Modified: llvm/trunk/lib/CodeGen/BranchCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchCoalescing.cpp?rev=297527&r1=297526&r2=297527&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/BranchCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/BranchCoalescing.cpp Fri Mar 10 16:44:47 2017
@@ -260,8 +260,8 @@ bool BranchCoalescing::canCoalesceBranch
// 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;
}
More information about the llvm-commits
mailing list