[llvm] r286817 - Remove redundant condition (PR28352) NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 14 04:00:47 PST 2016


Author: rksimon
Date: Mon Nov 14 06:00:46 2016
New Revision: 286817

URL: http://llvm.org/viewvc/llvm-project?rev=286817&view=rev
Log:
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).

Modified:
    llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=286817&r1=286816&r2=286817&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Mon Nov 14 06:00:46 2016
@@ -508,9 +508,10 @@ static bool LinearizeExprTree(BinaryOper
           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);




More information about the llvm-commits mailing list