From: Simon Pilgrim Date: Mon, 14 Nov 2016 12:00:46 +0000 (+0000) Subject: Remove redundant condition (PR28352) NFCI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ff5cb157f8667290a51b3f4e16368b67b696f0e;p=llvm Remove redundant condition (PR28352) NFCI. We were already testing is the op was not a leaf, so need to then test if it was a leaf (added it to the assert instead). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286817 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index e8abb5b03fb..40c1e3717a2 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -508,9 +508,10 @@ static bool LinearizeExprTree(BinaryOperator *I, continue; } // No uses outside the expression, try morphing it. - } else if (It != Leaves.end()) { + } else { // Already in the leaf map. - assert(Visited.count(Op) && "In leaf map but not visited!"); + assert(It != Leaves.end() && Visited.count(Op) && + "In leaf map but not visited!"); // Update the number of paths to the leaf. IncorporateWeight(It->second, Weight, Opcode);