[llvm-commits] [llvm] r92364 - /llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp
sabre at nondot.org
Thu Dec 31 10:18:46 PST 2009
Date: Thu Dec 31 12:18:46 2009
New Revision: 92364
change an if to an assert, fix comment.
--- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Thu Dec 31 12:18:46 2009
@@ -700,17 +700,17 @@
// Now that we have inserted V and its sole use, optimize it. This allows
// us to handle cases that require multiple factoring steps, such as this:
// A*A*B + A*A*C --> A*(A*B+A*C) --> A*(A*(B+C))
- if (NumAddedValues > 1)
+ assert(NumAddedValues > 1 && "Each occurrence should contribute a value");
// If every add operand included the factor (e.g. "A*B + A*C"), then the
// entire result expression is just the multiply "A*(B+C)".
- // Otherwise, we had some input that didn't have the fact, such as
+ // Otherwise, we had some input that didn't have the factor, such as
// "A*B + A*C + D" -> "A*(B+C) + D". Add the new multiply to the list of
- // things being added.
+ // things being added by this operation.
Ops.insert(Ops.begin(), ValueEntry(getRank(V2), V2));
More information about the llvm-commits