From 475b40dab8c477bdb190f201e1dea8abd9e21499 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 14 Nov 2016 12:00:46 +0000 Subject: [PATCH] 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). llvm-svn: 286817 --- llvm/lib/Transforms/Scalar/Reassociate.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp index e8abb5b..40c1e37 100644 --- a/llvm/lib/Transforms/Scalar/Reassociate.cpp +++ b/llvm/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); -- 2.7.4