History log of /external/llvm/lib/Transforms/Scalar/Reassociate.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
20b2d21509b3d5a10ec5d7be6dea8afa9e92fdee 26-Jul-2012 Duncan Sands <baldrick@free.fr> Stop reassociate from looking through expressions of arbitrary complexity. This
is a temporary measure until my fix for PR13021 is ready.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
a94d6e87c4c49f2e81b01d66d8bfb591277f8f96 24-Jul-2012 Nadav Rotem <nadav.rotem@intel.com> Clean whitespaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
c1deb67d78ac987577e9caa22d60435239ad0e12 23-Jul-2012 Nadav Rotem <nadav.rotem@intel.com> Suppress a warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
2923bca2b5fe46189c4c5572047e1d95946ac549 29-Jun-2012 Duncan Sands <baldrick@free.fr> Rework this to clarify where the removal of nodes from the queue is
really happening. No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
96d2eff5c6713a2c5fd2cd61545e49637c332975 29-Jun-2012 Duncan Sands <baldrick@free.fr> Fix a reassociate crash on sozefx when compiling with dragonegg+gcc-4.7 due to
the optimizers producing a multiply expression with more multiplications than
the original (!).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
06cb8ed00696eb14d1b831921452e50ec0568ea2 29-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.h

This was always part of the VMCore library out of necessity -- it deals
entirely in the IR. The .cpp file in fact was already part of the VMCore
library. This is just a mechanical move.

I've tried to go through and re-apply the coding standard's preferred
header sort, but at 40-ish files, I may have gotten some wrong. Please
let me know if so.

I'll be committing the corresponding updates to Clang and Polly, and
Duncan has DragonEgg.

Thanks to Bill and Eric for giving the green light for this bit of cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159421 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
2d5f8ca3d180832d168e59e2bf3d85317e86287d 27-Jun-2012 Duncan Sands <baldrick@free.fr> Some reassociate optimizations create new instructions, which they insert just
before the expression root. Any existing operators that are changed to use one
of them needs to be moved between it and the expression root, and recursively
for the operators using that one. When I rewrote RewriteExprTree I accidentally
inverted the logic, resulting in the compacting going down from operators to
operands rather than up from operands to the operators using them, oops. Fix
this, resolving PR12963.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
917f99354fa558e50d17191f593f81155b4ab2c3 24-Jun-2012 Nick Lewycky <nicholas@mxc.ca> Remove a dangling reference to a deleted instruction. Fixes PR13185!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
cd117f736c47947af5c6549734549e135e626c5c 15-Jun-2012 Duncan Sands <baldrick@free.fr> Fix issues (infinite loop and/or crash) with self-referential instructions, for
example degenerate phi nodes and binops that use themselves in unreachable code.
Thanks to Charles Davis for the testcase that uncovered this can of worms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158508 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
d34491f6751ae2f8daf3e857c84bcb5b06fba889 13-Jun-2012 Duncan Sands <baldrick@free.fr> It is possible for several constants which aren't individually absorbing to
combine to the absorbing element. Thanks to nbjoerg on IRC for pointing this
out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158399 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
ee5a094ccf1f04d3fcc92ac4d2fc8a2926cbb232 13-Jun-2012 Duncan Sands <baldrick@free.fr> When linearizing a multiplication, return at once if we see a factor of zero,
since then the entire expression must equal zero (similarly for other operations
with an absorbing element). With this in place a bunch of reassociate code for
handling constants is dead since it is all taken care of when linearizing. No
intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158398 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
5f9e4c1189ab4a8ea1b0000d9337060ac3cac26e 12-Jun-2012 Duncan Sands <baldrick@free.fr> Use DenseMap as SmallMap workaround rather than std::map, at Chandler's request.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
ac071eac30953b0913c91a63c3d3d32c627abf05 12-Jun-2012 Duncan Sands <baldrick@free.fr> Use std::map rather than SmallMap because SmallMap assumes that the value has
POD type, causing memory corruption when mapping to APInts with bitwidth > 64.
Merge another crash testcase into crash.ll while there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
c038a7833565ecf92a699371d448135a097c9e2f 12-Jun-2012 Duncan Sands <baldrick@free.fr> Now that Reassociate's LinearizeExprTree can look through arbitrary expression
topologies, it is quite possible for a leaf node to have huge multiplicity, for
example: x0 = x*x, x1 = x0*x0, x2 = x1*x1, ... rapidly gives a value which is x
raised to a vast power (the multiplicity, or weight, of x). This patch fixes
the computation of weights by correctly computing them no matter how big they
are, rather than just overflowing and getting a wrong value. It turns out that
the weight for a value never needs more bits to represent than the value itself,
so it is enough to represent weights as APInts of the same bitwidth and do the
right overflow-avoiding dance steps when computing weights. As a side-effect it
reduces the number of multiplies needed in some cases of large powers. While
there, in view of external uses (eg by the vectorizer) I made LinearizeExprTree
static, pushing the rank computation out into users. This is progress towards
fixing PR13021.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158358 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
841f42617531ff947b2d957e7b0cb367a290aae4 08-Jun-2012 Duncan Sands <baldrick@free.fr> Reapply commit 158073 with a fix (the testcase was already committed). The
problem was that by moving instructions around inside the function, the pass
could accidentally move the iterator being used to advance over the function
too. Fix this by only processing the instruction equal to the iterator, and
leaving processing of instructions that might not be equal to the iterator
to later (later = after traversing the basic block; it could also wait until
after traversing the entire function, but this might make the sets quite big).
Original commit message:

Grab-bag of reassociate tweaks. Unify handling of dead instructions and
instructions to reoptimize. Exploit this to more systematically eliminate
dead instructions (this isn't very useful in practice but is convenient for
analysing some testcase I am working on). No need for WeakVH any more: use
an AssertingVH instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158226 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
69938a85bdbeef1c5b60aa778e361586bec36fb7 08-Jun-2012 Duncan Sands <baldrick@free.fr> Revert commit 158073 while waiting for a fix. The issue is that reassociate
can move instructions within the instruction list. If the instruction just
happens to be the one the basic block iterator is pointing to, and it is
moved to a different basic block, then we get into an infinite loop due to
the iterator running off the end of the basic block (for some reason this
doesn't fire any assertions). Original commit message:

Grab-bag of reassociate tweaks. Unify handling of dead instructions and
instructions to reoptimize. Exploit this to more systematically eliminate
dead instructions (this isn't very useful in practice but is convenient for
analysing some testcase I am working on). No need for WeakVH any more: use
an AssertingVH instead.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
b933586592afa9596edd466e127401bffeba3d4a 06-Jun-2012 Duncan Sands <baldrick@free.fr> Grab-bag of reassociate tweaks. Unify handling of dead instructions and
instructions to reoptimize. Exploit this to more systematically eliminate
dead instructions (this isn't very useful in practice but is convenient for
analysing some testcase I am working on). No need for WeakVH any more: use
an AssertingVH instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
d9b0b025612992a0b724eeca8bdf10b1d7a5c355 02-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> Fix typos found by http://github.com/lyda/misspell-check

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
eacc31acf515c79338e8c94ce8c7c26dd7b2d32a 26-May-2012 Duncan Sands <baldrick@free.fr> Since commit 157467, if reassociate isn't actually going to change an expression
then it doesn't alter the instructions composing it, however it would continue
to move the instructions to just before the expression root. Ensure it doesn't
move them either, so now it really does nothing if there is nothing to do. That
commit also ensured that nsw etc flags weren't cleared if the expression was not
being changed. Tweak this a bit so that it doesn't clear flags on the initial
part of a computation either if that part didn't change but later bits did.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157518 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
24dfa52fa20eee39440e5dec4d23359e5a6773c7 26-May-2012 Duncan Sands <baldrick@free.fr> Move this debug statement earlier so it is easy to see the order in
which operands come flying out of the linearization stage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
0fd120b970fe9a036ae664ad1bfbf04e55b3b8a7 25-May-2012 Duncan Sands <baldrick@free.fr> Make the reassociation pass more powerful so that it can handle expressions
with arbitrary topologies (previously it would give up when hitting a diamond
in the use graph for example). The testcase from PR12764 is now reduced from
a pile of additions to the optimal 1617*%x0+208. In doing this I changed the
previous strategy of dropping all uses for expression leaves to one of dropping
all but one use. This works out more neatly (but required a bunch of tweaks)
and is also safer: some recently fixed bugs during recursive linearization were
because the linearization code thinks it completely owns a node if it has no uses
outside the expression it is linearizing. But if the node was also in another
expression that had been linearized (and thus all uses of the node from that
expression dropped) then the conclusion that it is completely owned by the
expression currently being linearized is wrong. Keeping one use from within each
linearized expression avoids this kind of mistake.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
a33701098936ffba12326d96e98d388357f3e098 08-May-2012 Duncan Sands <baldrick@free.fr> Calling ReassociateExpression recursively is extremely dangerous since it will
replace the operands of expressions with only one use with undef and generate
a new expression for the original without using RAUW to update the original.
Thus any copies of the original expression held in a vector may end up
referring to some bogus value - and using a ValueHandle won't help since there
is no RAUW. There is already a mechanism for getting the effect of recursion
non-recursively: adding the value to be recursed on to RedoInsts. But it wasn't
being used systematically. Have various places where recursion had snuck in at
some point use the RedoInsts mechanism instead. Fixes PR12169.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
423f19f2dadee9325766008b63c1faf3c644043b 07-May-2012 Owen Anderson <resistor@mac.com> Teach reassociate to commute FMul's and FAdd's in order to canonicalize the order of their operands across instructions. This allows for greater CSE opportunities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
98bda3dfefcb08e6ce81fa9545b05eb433cd5b87 04-May-2012 Bill Wendling <isanbard@gmail.com> Add 'landingpad' instructions to the list of instructions to ignore.
Also combine the code in the 'assert' statement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
e8cd3f249133406c9b2a8dc6b6dbd2752fc605b4 03-May-2012 Bill Wendling <isanbard@gmail.com> Whitespace cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
55e7098bbc363473c01229517097d2a04e04e9b0 02-May-2012 Bill Wendling <isanbard@gmail.com> The value held in the vector may be RAUW'ed by some of the canonicalization
methods. Use a weak value handle to keep up with this.
PR12245


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
464bda3a167bb761eb3c9c178db3fa8ed26fe825 26-Apr-2012 Chandler Carruth <chandlerc@gmail.com> Teach the reassociate pass to fold chains of multiplies with repeated
elements to minimize the number of multiplies required to compute the
final result. This uses a heuristic to attempt to form near-optimal
binary exponentiation-style multiply chains. While there are some cases
it misses, it seems to at least a decent job on a very diverse range of
inputs.

Initial benchmarks show no interesting regressions, and an 8%
improvement on SPASS. Let me know if any other interesting results (in
either direction) crop up!

Credit to Richard Smith for the core algorithm, and helping code the
patch itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
f1d0f7781e766df878bec4e7977fa3204374f394 26-Mar-2012 Craig Topper <craig.topper@gmail.com> Prune some includes and forward declarations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153429 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
1f6a329f79b3568d379142f921f59c4143ddaa14 12-Aug-2011 Duncan Sands <baldrick@free.fr> Silence a bunch (but not all) "variable written but not read" warnings
when building with assertions disabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
9b7fdc7e8af26b65c9afdee45d4ec0b22c8a17c8 02-Aug-2011 Owen Anderson <resistor@mac.com> Revert r136503 and r136480 in an effort to fix non-determinism in the llvm-gcc buildbots on i386. Devang is looking into the root cause.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
6e8bb8a0cb08a26e92fd1c60a64f357a41698bae 29-Jul-2011 Devang Patel <dpatel@apple.com> Clear DbgValues in the end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
1619560521c46ecee0ef2d0c651ed18feb57df97 29-Jul-2011 Devang Patel <dpatel@apple.com> Clean up debug info after reassociation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136480 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
c73b24db5f6226ed44ebc44ce1c25bb357206623 15-Jul-2011 Chris Lattner <sabre@nondot.org> start using the new helper methods a bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
5367b23f76e75ebb680956575346fa8c3d56780f 29-Apr-2011 Devang Patel <dpatel@apple.com> Preserve line number information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
dac5dbadeb840ddded4665d144f31c5f88494d6e 12-Apr-2011 Dan Gohman <gohman@apple.com> Fix reassociate to use a worklist instead of recursing when new
reassociation opportunities are exposed. This fixes a bug where
the nested reassociation expects to be the IR to be consistent,
but it isn't, because the outer reassociation has disconnected
some of the operands. rdar://9167457


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129324 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
c9f2f61d3426d30605b22ccbd112272d1d36cd28 10-Mar-2011 Dan Gohman <gohman@apple.com> RecursivelyDeleteTriviallyDeadInstructions only needs a
Value, not an Instruction, so casting is not necessary. Also,
it's theoretically possible that the Value is not an
Instruction, since WeakVH follows RAUWs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127427 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
fa0e6facc793d0a67e89f873e18cd35a9d7c02e0 10-Mar-2011 Dan Gohman <gohman@apple.com> Fix reassociate to postpone certain instruction deletions until
after it has finished all of its reassociations, because its
habit of unlinking operands and holding them in a datastructure
while working means that it's not easy to determine when an
instruction is really dead until after all its regular work is
done. rdar://9096268.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127424 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
de1d8a544c1398cc34d4c865c5afa8b91f96316c 17-Feb-2011 Chris Lattner <sabre@nondot.org> fix PR9215, preventing -reassociate from clearing nsw/nuw when
it swaps the LHS/RHS of a single binop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
46985a14409486293b689ca07dd07d7482734795 02-Feb-2011 Dan Gohman <gohman@apple.com> Fix reassociate to clear optional flags, such as nsw.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124712 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
37f87c7aa914fba1362bb187ce5a386abfe94e39 26-Jan-2011 Duncan Sands <baldrick@free.fr> Fix PR9039, a use-after-free in reassociate. The issue was that the
operand being factorized (and erased) could occur several times in Ops,
resulting in freed memory being used when the next occurrence in Ops was
analyzed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
081c34b725980f995be9080eaec24cd3dfaaf065 19-Oct-2010 Owen Anderson <resistor@mac.com> Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems
with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass
registration/creation, please send the testcase to me directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
ce665bd2e2b581ab0858d1afe359192bac96b868 08-Oct-2010 Owen Anderson <resistor@mac.com> Now with fewer extraneous semicolons!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
90c579de5a383cee278acc3f7e7b9d0a656e6a35 06-Aug-2010 Owen Anderson <resistor@mac.com> Reapply r110396, with fixes to appease the Linux buildbot gods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
1f74590e9d1b9cf0f1f81a156efea73f76546e05 06-Aug-2010 Owen Anderson <resistor@mac.com> Revert r110396 to fix buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
9ccaf53ada99c63737547c0235baeb8454b04e80 06-Aug-2010 Owen Anderson <resistor@mac.com> Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier. Clean up APIs related to this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
d13db2c59cc94162d6cf0a04187d408bfef6d4a7 22-Jul-2010 Owen Anderson <resistor@mac.com> Fix batch of converting RegisterPass<> to INTIALIZE_PASS().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
110b75aa7572d3b59b308da7ec1d759e86788f97 12-Jul-2010 Gabor Greif <ggreif@gmail.com> cache dereferenced iterators

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
893075f46e9d07e3fe94e2b0e0f3ff8ae4061549 05-Mar-2010 Chris Lattner <sabre@nondot.org> fix a nice subtle reassociate bug which would only occur
in a very specific use pattern embodied in the carefully
reduced testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97794 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
1df9859c40492511b8aa4321eb76496005d3b75b 16-Feb-2010 Duncan Sands <baldrick@free.fr> There are two ways of checking for a given type, for example isa<PointerType>(T)
and T->isPointerTy(). Convert most instances of the first form to the second form.
Requested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
b0bc6c361da9009e8414efde317d9bbff755f6c0 15-Feb-2010 Duncan Sands <baldrick@free.fr> Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
f451cb870efcf9e0302d25ed05f4cac6bb494e42 10-Feb-2010 Dan Gohman <gohman@apple.com> Fix "the the" and similar typos.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
fc375d22001d27ba6d22db67821da057e36f7f89 05-Feb-2010 Bob Wilson <bob.wilson@apple.com> Do not reassociate expressions with i1 type. SimplifyCFG converts some
short-circuited conditions to AND/OR expressions, and those expressions
are often converted back to a short-circuited form in code gen. The
original source order may have been optimized to take advantage of the
expected values, and if we reassociate them, we change the order and
subvert that optimization. Radar 7497329.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95333 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
c2d1b6949c5141d21827cc94daea6ae4b1a9c750 09-Jan-2010 Chris Lattner <sabre@nondot.org> only factor from expressions whose uses are empty and whose
base is the right expression type. This fixes PR5981.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
54a57045ebcf8e31b1542098d1cd2bda9a718725 08-Jan-2010 Duncan Sands <baldrick@free.fr> Suppress an unused variable warning when assertions are off;
remove some trailing whitespace while there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93008 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
5f94af0f725690a75b18909da2ff8cee0f93bebb 05-Jan-2010 Chris Lattner <sabre@nondot.org> fix an infinite loop in reassociate building emacs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92679 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
a1fa76cb5443e7b0fe7d36ee1118f80050e746f9 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92617 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
1c91fae649734abe6f8271862fe3ba917e191279 02-Jan-2010 Chris Lattner <sabre@nondot.org> theoretically the negate we find could be in a different function, check
for this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
9506c930aa1f7c5fbf1e0e1e6bfae71f4a61ee15 01-Jan-2010 Chris Lattner <sabre@nondot.org> When factoring multiply expressions across adds, factor both
positive and negative forms of constants together. This
allows us to compile:

int foo(int x, int y) {
return (x-y) + (x-y) + (x-y);
}

into:

_foo: ## @foo
subl %esi, %edi
leal (%rdi,%rdi,2), %eax
ret

instead of (where the 3 and -3 were not factored):

_foo:
imull $-3, 8(%esp), %ecx
imull $3, 4(%esp), %eax
addl %ecx, %eax
ret

this started out as:
movl 12(%ebp), %ecx
imull $3, 8(%ebp), %eax
subl %ecx, %eax
subl %ecx, %eax
subl %ecx, %eax
ret

This comes from PR5359.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
9046193e557d559f45dc50df5e20b1fccc90b2ac 01-Jan-2010 Chris Lattner <sabre@nondot.org> clean up some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
f55e7f54b1877aa6a58b368084cc25acbaa30967 01-Jan-2010 Chris Lattner <sabre@nondot.org> switch from std::map to DenseMap for rank data structures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
35239934517c6fcd52e3e965f40e03f74aa4d11d 31-Dec-2009 Chris Lattner <sabre@nondot.org> reuse negates where possible instead of always creating them from scratch.
This allows us to optimize test12 into:

define i32 @test12(i32 %X) {
%factor = mul i32 %X, -3 ; <i32> [#uses=1]
%Z = add i32 %factor, 6 ; <i32> [#uses=1]
ret i32 %Z
}

instead of:

define i32 @test12(i32 %X) {
%Y = sub i32 6, %X ; <i32> [#uses=1]
%C = sub i32 %Y, %X ; <i32> [#uses=1]
%Z = sub i32 %C, %X ; <i32> [#uses=1]
ret i32 %Z
}



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
f31e2e92a801c5053dc9b3b484cdec73ad89e567 31-Dec-2009 Chris Lattner <sabre@nondot.org> we don't need a smallptrset to detect duplicates, the values are
sorted, so we can just do a linear scan.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
1e7558b65689999089f53ce40ff07564cf498c68 31-Dec-2009 Chris Lattner <sabre@nondot.org> make reassociate more careful about not leaving around dead mul's


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
f8a447de162a2896a8a044931fb63de713dbc6b9 31-Dec-2009 Chris Lattner <sabre@nondot.org> remove debug


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
69e98e2c0f7a1a1a8e3547b57e3e78e1142b8a64 31-Dec-2009 Chris Lattner <sabre@nondot.org> teach reassociate to factor x+x+x -> x*3. While I'm at it,
fix RemoveDeadBinaryOp to actually do something.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
9f7b7089be854c323f8d9a4627d80e47adf496e6 31-Dec-2009 Chris Lattner <sabre@nondot.org> change reassociate to use SmallVector for its key datastructures
instead of std::vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
9cd1bc4f8b3e98892a2b9856eccd2a2ec9afdf7f 31-Dec-2009 Chris Lattner <sabre@nondot.org> change an if to an assert, fix comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
94285e620b845e09b18939e8d6448e01e692f3ce 31-Dec-2009 Chris Lattner <sabre@nondot.org> move the rest of the add optimization code out to OptimizeAdd,
improve some comments, simplify a bit of code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
9fdaefad580194353f34b6d72669591f8f9d811a 31-Dec-2009 Chris Lattner <sabre@nondot.org> factor statistic updating better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
13a754ce92ece15cf6b90d9fbc37a5c8a1cca06a 31-Dec-2009 Chris Lattner <sabre@nondot.org> simple fix for an incorrect factoring which causes a
miscompilation, PR5458.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
f3f55a9bc1ce62fad7faecff7bd83565d569dee8 31-Dec-2009 Chris Lattner <sabre@nondot.org> factor code out into helper functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
8d93b259f6d6ece634df86d5df453efc0c918546 31-Dec-2009 Chris Lattner <sabre@nondot.org> switch some std::vector's to smallvector. Reduce nesting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
ec531233a16605756a84d175178e1ee0fac4791c 31-Dec-2009 Chris Lattner <sabre@nondot.org> use more modern datastructures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
1befe643b2a030f5e2433ce0034a27fb65b5f26b 31-Dec-2009 Chris Lattner <sabre@nondot.org> clean up -debug output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92343 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
e79fddedcae1ee8fe7d8571db58447bc722f75dc 14-Nov-2009 Nick Lewycky <nicholas@mxc.ca> Remove LLVMContext from reassociate. It was threaded through every function but
ultimately never used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
68afa54033eccda0f55e920cb548588e71a45418 21-Oct-2009 Victor Hernandez <vhernandez@apple.com> Make changes to rev 84292 as requested by Chris Lattner.

Most changes are cleanup, but there is 1 correctness fix:
I fixed InstCombine so that the icmp is removed only if the malloc call is removed (which requires explicit removal because the Worklist won't DCE any calls since they can have side-effects).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
a276c603b82a11b0bf0b59f0517a69e4b63adeab 17-Oct-2009 Victor Hernandez <vhernandez@apple.com> Remove MallocInst from LLVM Instructions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84299 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
13ad5aaaff8a446758b402fd5e9aea22f5bc5682 17-Oct-2009 Victor Hernandez <vhernandez@apple.com> Autoupgrade malloc insts to malloc calls.
Update testcases that rely on malloc insts being present.

Also prematurely remove MallocInst handling from IndMemRemoval and RaiseAllocations to help pass tests in this incremental step.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
06e4052699c481fda1df8d96a26e42733c36eb66 27-Sep-2009 Chris Lattner <sabre@nondot.org> calls are already unmovable, malloc doesn't need a special case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
83d63919bd990ce00f62e18114504b9e4a5cb35e 19-Sep-2009 Victor Hernandez <vhernandez@apple.com> Enhance transform passes so that they apply the same tranforms to malloc calls as to MallocInst.

Reviewed by Dan Gohman.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
3e8b6631e67e01e4960a7ba4668a50c596607473 02-Sep-2009 Chris Lattner <sabre@nondot.org> eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
79c5d3f9717756dc3ff56cfcaa3ae1a5930c457a 23-Aug-2009 Chris Lattner <sabre@nondot.org> remove the std::ostream version of module and type printing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
bdff548e4dd577a72094d57b282de4e765643b96 23-Aug-2009 Chris Lattner <sabre@nondot.org> eliminate the "Value" printing methods that print to a std::ostream.
This required converting a bunch of stuff off DOUT and other cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79819 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
873257723084bad749c1cc13a2d35b35c229942e 17-Aug-2009 Dan Gohman <gohman@apple.com> Fix debug output to include a newline after printing a Value, now
that Value's operator<< doesn't include one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
4ae5126d041768ab9665cf2f11c024becd76c41f 12-Aug-2009 Dan Gohman <gohman@apple.com> Remove a bunch more now-unnecessary Context arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
a7235ea7245028a0723e8ab7fd011386b3900777 31-Jul-2009 Owen Anderson <resistor@mac.com> Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
9e9a0d5fc26878e51a58a8b57900fcbf952c2691 31-Jul-2009 Owen Anderson <resistor@mac.com> Move more code back to 2.5 APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
baf3c404409d5e47b13984a7f95bfbd6d1f2e79e 29-Jul-2009 Owen Anderson <resistor@mac.com> Move ConstantExpr to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
eed707b1e6097aac2bb6b3d47271f6300ace7f2e 25-Jul-2009 Owen Anderson <resistor@mac.com> Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
e922c0201916e0b980ab3cfe91e1413e68d55647 22-Jul-2009 Owen Anderson <resistor@mac.com> Get rid of the Pass+Context magic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
fa82b6eba4e1584d7dba291c28fe908272e1e002 14-Jul-2009 Owen Anderson <resistor@mac.com> These don't really need contexts either.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75528 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
73c6b7127aff4499e4d6a2edb219685aee178ee1 13-Jul-2009 Owen Anderson <resistor@mac.com> Move more functionality over to LLVMContext.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
0a5372ed3e8cda10d724feda3c1a1c998db05ca0 13-Jul-2009 Owen Anderson <resistor@mac.com> Begin the painful process of tearing apart the rat'ss nest that is Constants.cpp and ConstantFold.cpp.
This involves temporarily hard wiring some parts to use the global context. This isn't ideal, but it's
the only way I could figure out to make this process vaguely incremental.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
07cf79ef537caff6d39145f190a28a336e629b6f 07-Jul-2009 Owen Anderson <resistor@mac.com> "LLVMContext* " --> "LLVMContext *"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
fa5cbd6d0fbda23fd669c8718e07b19001b2d21a 03-Jul-2009 Owen Anderson <resistor@mac.com> Even more passes being LLVMContext'd.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
d3c7b7359d4992b9ab9f8e12ccd0a9b7d2446566 01-Apr-2009 Chris Lattner <sabre@nondot.org> Make the key of ValueRankMap an AssertingVH, so that we die violently
if it dangles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
f4978e2094a08760d4fa8a07052091cb7276eec7 19-Mar-2009 Dale Johannesen <dalej@apple.com> This pass keeps a map of Instructions to Rank numbers,
and was deleting Instructions without clearing the
corresponding map entry. This led to nondeterministic
behavior if the same address got allocated to another
Instruction within a short time.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67306 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
03afd02ca2486aebb3b29edd2f77920d4e5020fd 06-Mar-2009 Dale Johannesen <dalej@apple.com> Don't assign rank numbers to debug intrinsic "calls".
This is needed so debug info doesn't change codegen.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66235 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
50cacb2a520b93530e79220a307c907163b9e370 21-Nov-2008 Devang Patel <dpatel@apple.com> Fix build failure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59844 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
59500c8f9a76b3386329b6f837255c16f4e8b61b 21-Nov-2008 Devang Patel <dpatel@apple.com> Silence unused variable warnings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
ae73dc1448d25b02cabc7c64c86c64371453dda8 04-Sep-2008 Dan Gohman <gohman@apple.com> Tidy up several unbeseeming casts from pointer to intptr_t.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
7de3b5db26bb3c8dcca5348fb7c0be4f9bd1bcb7 19-Aug-2008 Chris Lattner <sabre@nondot.org> don't use the result of WriteAsOperand



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
7cbd8a3e92221437048b484d5ef9c0a22d0f8c58 16-May-2008 Gabor Greif <ggreif@gmail.com> API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time. (Merge from use-diet branch.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51200 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
844731a7f1909f55935e3514c9e713a62d67662e 13-May-2008 Dan Gohman <gohman@apple.com> Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
c9235d2e855c56e9aa157969f8132a05f9ba89d8 22-Mar-2008 Dan Gohman <gohman@apple.com> Don't include <map> in Pass.h, which doesn't need it. This requires
adding <map> to many files that actually do need it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
d5b8d92b9f4dfb216e4f2a52b4e801d7559574ba 18-Feb-2008 Chris Lattner <sabre@nondot.org> simplify some code, BreakUpSubtract always returns nonnull now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
5329bb22e9b6374d62919981c1ef8775b42945eb 17-Feb-2008 Chris Lattner <sabre@nondot.org> fix pasto


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
0b0803ae1508ff514dd7b471a2a3bcd1e83cb0ef 17-Feb-2008 Chris Lattner <sabre@nondot.org> Split up subtracts into add+negate if they have a reassociable use or operand
that is also a subtract. This implements PR2047 and Transforms/Reassociate/subtest2.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47241 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
9bc5ed78c860694ccb4ea63c96c2c9212a8b245b 17-Feb-2008 Chris Lattner <sabre@nondot.org> make the logic for breaking up subtracts more explicit, no
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
303595942502f17c087fa28874c2b89117148c45 29-Jan-2008 Dan Gohman <gohman@apple.com> Use empty() instead of comparing size() with zero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
4ee451de366474b9c228b4e5fa573795a715216d 29-Dec-2007 Chris Lattner <sabre@nondot.org> Remove attribution from file headers, per discussion on llvmdev.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
ecd94c804a563f2a86572dcf1d2e81f397e19daa 06-May-2007 Nick Lewycky <nicholas@mxc.ca> Fix typo in comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
1997473cf72957d0e70322e2fe6fe2ab141c58a6 03-May-2007 Devang Patel <dpatel@apple.com> Drop 'const'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
3e15bf33e024b9df9e89351a165acfdb1dde51ed 02-May-2007 Devang Patel <dpatel@apple.com> Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
794fd75c67a2cdc128d67342c6d88a504d186896 01-May-2007 Devang Patel <dpatel@apple.com> Do not use typeinfo to identify pass in pass manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
cae5754619433aed7be74abbf1c0551a82d369cb 02-Mar-2007 Reid Spencer <rspencer@reidspencer.com> Prefer non-virtual calls to ConstantInt::isZero over virtual calls to
Constant::isNullValue() in situations where it is possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
4da0451821732e20d132e612ba8852a1c6498fab 01-Mar-2007 Reid Spencer <rspencer@reidspencer.com> Use isUnitValue() instead of getZExtValue() == 1 which will prevent an
assert if the ConstantInt's value is large.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34814 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
9d6565a5b1fbc4286d6ee638d8f47a3171a9ed7e 15-Feb-2007 Reid Spencer <rspencer@reidspencer.com> For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34293 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
6934a04a8c15e9971cd1ea4d5c8df2d7afdd5be5 11-Feb-2007 Chris Lattner <sabre@nondot.org> Simplify code by using value::takename


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
9133fe28954d498fc4de13064c7d65bd811de02c 06-Feb-2007 Reid Spencer <rspencer@reidspencer.com> Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes in
the Transforms library. This reduces debug library size by 132 KB, debug
binary size by 376 KB, and reduces link time for llvm tools slightly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
24d6da5fedcf39891f7d8c5b031c01324b3db545 21-Jan-2007 Reid Spencer <rspencer@reidspencer.com> For PR970:
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33415 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
42a75517250017a52afb03a0ade03cbd49559fe5 15-Jan-2007 Chris Lattner <sabre@nondot.org> rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent. For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33225 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
6b6b6ef1677fa71b1072c2911b4c1f9524a558c9 11-Jan-2007 Zhou Sheng <zhousheng00@gmail.com> For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
e4d87aa2de6e52952dca73716386db09aad5a8fd 23-Dec-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32751 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
0e5f499638c8d277b9dc4a4385712177c53b5681 19-Dec-2006 Chris Lattner <sabre@nondot.org> Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic
converted, we lose a static initializer. This also allows GCC to emit warnings
about unused statistics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32690 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
832171cb9724d2d31c8dfb73172e2be8f6dd13ee 07-Dec-2006 Bill Wendling <isanbard@gmail.com> Removing even more <iostream> includes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32320 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
ac0b6ae358944ae8b2b5a11dc08f52c3ed89f2da 06-Dec-2006 Chris Lattner <sabre@nondot.org> Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
3749c9cae41d2e682f67a41b07e0c50b46dbb000 06-Dec-2006 Chris Lattner <sabre@nondot.org> Remove the 'printname' argument to WriteAsOperand. It is always true, and
passing false would make the asmprinter fail anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32264 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
0a783f783ca05c961234385f5b269d4cf03dbbdb 02-Nov-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
Replace the REM instruction with UREM, SREM and FREM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
1628cec4d7fce310d9cde0bcc73997e5a71692c4 26-Oct-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31195 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
b83eb6447ba155342598f0fabe1f08f5baa9164a 20-Oct-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
7f8897f22e88271cfa114998a4d6088e7c8e8e11 28-Aug-2006 Chris Lattner <sabre@nondot.org> eliminate RegisterOpt. It does the same thing as RegisterPass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
ae74f555522298bef3be8a173163bf778d59adf9 28-Apr-2006 Chris Lattner <sabre@nondot.org> Fix Transforms/Reassociate/2006-04-27-ReassociateVector.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
e9efecbf470100696355f32ea8b6ab942183ac6c 14-Mar-2006 Chris Lattner <sabre@nondot.org> Implement a FIXME, recusively reassociating
A*A*B + A*A*C --> A*(A*B+A*C) --> A*(A*(B+C))

This implements Reassociate/mul-factor3.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26757 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
895b392269cad07c34d59110d68dc86708c53adb 14-Mar-2006 Chris Lattner <sabre@nondot.org> extract some code into a method, no functionality change


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26755 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
22a66c41f3ab42c15437033851395b0b8288681b 14-Mar-2006 Chris Lattner <sabre@nondot.org> Promote shifts by a constant to multiplies so that we can reassociate
(x<<1)+(y<<1) -> (X+Y)<<1. This implements
Transforms/Reassociate/shift-factor.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
e5022fe4cd83eef91f5c3a21c943ca9b65507ab8 04-Mar-2006 Chris Lattner <sabre@nondot.org> Add factoring of multiplications, e.g. turning A*A+A*B into A*(A+B).
Testcase here: Transforms/Reassociate/mulfactor.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
dac58ad983c62b49629e1f2969f4e0a621167d63 23-Jan-2006 Chris Lattner <sabre@nondot.org> Make iostream #inclusion explicit


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
7b4ad94282b94e1827be29b4db73fdf6e241f748 02-Sep-2005 Chris Lattner <sabre@nondot.org> Fix a problem that Dan Berlin noticed, where reassociation would not succeed
in building maximal expressions before simplifying them. In particular, i
cases like this:

X-(A+B+X)

the code would consider A+B+X to be a maximal expression (not understanding
that the single use '-' would be turned into a + later), simplify it (a noop)
then later get simplified again.

Each of these simplify steps is where the cost of reassociation comes from,
so this patch should speed up the already fast pass a bit.

Thanks to Dan for noticing this!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23214 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
2cd85da3ed8e703729fb5adfe8cc2f9b1dd2f6a8 02-Sep-2005 Chris Lattner <sabre@nondot.org> Avoid creating garbage instructions, just move the old add instruction
to where we need it when converting -(A+B+C) -> -A + -B + -C.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
368a3aabb2b48ad6e39d23d1c6cbdfe0c5857483 02-Sep-2005 Chris Lattner <sabre@nondot.org> add some assertions and fix problems where reassociate could access the
Ops vector out of range


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
ac83b0301ea5ce0e1092fad8f294fe7f046832ff 24-Aug-2005 Chris Lattner <sabre@nondot.org> Fix Regression/Transforms/Reassociate/2005-08-24-Crash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23019 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
4bc5f8071a28b6fc4f4c2207dd03a5f747d0d84b 08-Aug-2005 Chris Lattner <sabre@nondot.org> Use the new 'moveBefore' method to simplify some code. Really, which is
easier to understand? :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
00b16889ab461b7ecef1c91ade101186b7f1fce2 27-Jul-2005 Jeff Cohen <jeffc@jolt-lang.org> Eliminate all remaining tabs and trailing spaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
641f02f10f08c9a9add651c6f0169f5441eaeb49 10-May-2005 Chris Lattner <sabre@nondot.org> Fix Reassociate/shifttest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21839 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
44b8c7d5d36561d1a685f8b5a95b71f939cce26e 08-May-2005 Chris Lattner <sabre@nondot.org> Implement Reassociate/mul-neg-add.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
6f156856ca23394122f39d92fe74eec40a1f7c27 08-May-2005 Chris Lattner <sabre@nondot.org> Bail out earlier


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
f33151aff008c40eec6435ddb7a5c9017b6acef9 08-May-2005 Chris Lattner <sabre@nondot.org> Teach reassociate that 0-X === X*-1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21785 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
9c723199384b16899831937e2800d52f4f953569 08-May-2005 Chris Lattner <sabre@nondot.org> Fix PR557 and basictest[34].ll.

This makes reassociate realize that loads should be treated as unmovable, and
gives distinct ranks to distinct values defined in the same basic block, allowing
reassociate to do its thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
c9fd097a01383323f166c14c17d3984620cad766 08-May-2005 Chris Lattner <sabre@nondot.org> Add debugging information


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
989f6229bcef6e7a0ec8f5c8b0013051c0b56b59 08-May-2005 Chris Lattner <sabre@nondot.org> eliminate gotos


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
109d34d6ff51a0fdd39d7b3b373a83fcca6c67a3 08-May-2005 Chris Lattner <sabre@nondot.org> Improve reassociation handling of inverses, implementing inverses.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
469001000620df176decd093a300db84a06cc78b 08-May-2005 Chris Lattner <sabre@nondot.org> Refactor some code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
cc8a2b98f28c10d93f45489b8c6f0c8b8205bb3b 08-May-2005 Chris Lattner <sabre@nondot.org> Handle some simple cases where we can see that values get annihilated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
c0649ac931d22b7118c1db292b887cd4eb52cd32 07-May-2005 Chris Lattner <sabre@nondot.org> Rewrite the guts of the reassociate pass to be more efficient and logical. Instead
of trying to do local reassociation tweaks at each level, only process an expression
tree once (at its root). This does not improve the reassociation pass in any real way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
0975ed5f4ef7264b45995241717055f8a116bb27 07-May-2005 Chris Lattner <sabre@nondot.org> Convert shifts to muls to assist reassociation. This implements
Reassociate/shifttest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21761 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
08b43921e18f314c4fd38049291d323830934c36 07-May-2005 Chris Lattner <sabre@nondot.org> Simplify the code and rearrange it. No major functionality changes here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
fd93908ae8b9684fe71c239e3c6cfe13ff6a2663 22-Apr-2005 Misha Brukman <brukman+llvm@gmail.com> Remove trailing whitespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
e4d5c441e04bdc00ccf1804744af670655123b07 15-Mar-2005 Chris Lattner <sabre@nondot.org> This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
551ccae044b0ff658fe629dd67edd5ffe75d10e8 02-Sep-2004 Reid Spencer <rspencer@reidspencer.com> Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
d8e1eea678833cc2b15e4ea69a5a403ba9c3b013 29-Jul-2004 Misha Brukman <brukman+llvm@gmail.com> Fix #includes of i*.h => Instructions.h as per PR403.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
2fc1230dd68e3f67d36b295adc5168733c412009 15-Jul-2004 Chris Lattner <sabre@nondot.org> Fixes working towards PR341


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14839 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
a9160a064fcbe7e389d4d8a502b45fe5e63019d9 01-Jul-2004 Brian Gaeke <gaeke@uiuc.edu> Make this pass use a more specific debug message than "Processing:".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
d7456026629fc1760a45e6e955e9834246493147 09-Jan-2004 Chris Lattner <sabre@nondot.org> Finegrainify namespacification


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
d0fde30ce850b78371fd1386338350591f9ff494 11-Nov-2003 Brian Gaeke <gaeke@uiuc.edu> Put all LLVM code into the llvm namespace, as per bug 109.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
ed1f7c81aa24fd8126496a75c13c01db111b43ad 07-Nov-2003 Misha Brukman <brukman+llvm@gmail.com> Declare FunctionPasses as such so that they can be used in FunctionPassManager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
b576c94c15af9a440f69d9d03c2afead7971118c 20-Oct-2003 John Criswell <criswell@uiuc.edu> Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
3b237fcd385a734b49bb54893ce256ba181e36f9 19-Oct-2003 Chris Lattner <sabre@nondot.org> Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
fd05924946ebfcfb3409b21996cfd0836e4ddb31 15-Oct-2003 Chris Lattner <sabre@nondot.org> Decrease usage of use_size()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
22b9aab760fbb9191674b73e228b99d246ad3665 22-Sep-2003 Misha Brukman <brukman+llvm@gmail.com> Credits now go into the top-level CREDITS.TXT


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
5560c9d49ccae132cabf1155f18aa0480dce3eda 18-Aug-2003 Misha Brukman <brukman+llvm@gmail.com> Spell `necessary' correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7944 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
fb5be090f59997deb7a2e89c92bac19528ba6755 13-Aug-2003 Chris Lattner <sabre@nondot.org> Assign arguments different ranks so they get grouped together


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
e9608e37fcf78a3a63e2d8ec900520651486ff1d 12-Aug-2003 Chris Lattner <sabre@nondot.org> Fix bug: Reassociate/2003-08-12-InfiniteLoop.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
6007cb6c4d923e2dee4a1133fb6d1bb00a37062d 12-Aug-2003 Chris Lattner <sabre@nondot.org> Assign finer grained ranks, make sure to reassociate top-level after reassociating bottom level


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7787 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
6806f5614d2ec260fda954c951d33f58e77ed610 02-Aug-2003 Chris Lattner <sabre@nondot.org> DEBUG got moved to Support/Debug.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
e96fda3002dd0769d3dd758ac5008ba8cda92349 02-May-2003 Chris Lattner <sabre@nondot.org> Fix spelling


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
e408e25132b8de8c757db1e3ddcd70432dfeb24d 23-Apr-2003 Chris Lattner <sabre@nondot.org> Remove unnecesary &*'s


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
f0a93ed9c59d706494496c6fe4e8354864d24aa7 24-Feb-2003 Chris Lattner <sabre@nondot.org> Rename Instruction::hasSideEffects() -> mayWriteToMemory()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5620 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
4d0a82da2daab7bd4eb3b3cd7ea28ba15d0db144 15-Dec-2002 Chris Lattner <sabre@nondot.org> Fix a huge performance problem in reassociate by introducing a
rank map cache for instruction ranks


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
680f0c283d6faf15113687a6eb68482d231d1d91 15-Dec-2002 Chris Lattner <sabre@nondot.org> Minor changes:
* Reword comment to make more clear
* Don't print out BB's after modification made
* Don't delete and new an instruction when we need to move something, just move it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
e4b730441dab4aff9a69aeddbdea98990e7703c4 31-Oct-2002 Chris Lattner <sabre@nondot.org> Fixes to the reassociate pass to make it respect dominance properties

Huge thanks go to Casey Carter for writing this fix, reassociate is now
reoperational!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
cb2610ea037a17115ef3a01a6bdaab4e3cfdca27 21-Oct-2002 Chris Lattner <sabre@nondot.org> - Rename AnalysisUsage::preservesAll to getPreservesAll & preservesCFG to
setPreservesCFG to be less confusing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4255 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
a92f696b74a99325026ebbdbffd2a44317e0c10b 02-Oct-2002 Chris Lattner <sabre@nondot.org> Updates to work with recent Statistic's changes:

* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
* Broke constructor to take two const char * arguments instead of one, so
that indendation can be taken care of automatically.
* Sort the list by pass name when printing
* Make sure to print all statistics as a group, instead of randomly when
the statistics dtors are called.
* Updated ProgrammersManual with new semantics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
2a7c23ef9156a97f426a3fe8d1f5935b75d076d1 10-Sep-2002 Chris Lattner <sabre@nondot.org> Simplify code (somtimes dramatically), by using the new "auto-insert" feature
of instruction constructors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
a6275ccdf5e1aa208afde56c498e2b13e16442f0 26-Jul-2002 Chris Lattner <sabre@nondot.org> * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
0c0edf8afc35a42b15a24ebb5fa5f3fc674290ae 25-Jul-2002 Chris Lattner <sabre@nondot.org> *** empty log message ***


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
f629309f74cf1a64aa7fd1cd5784fd7db9a8f59e 23-Jul-2002 Chris Lattner <sabre@nondot.org> *** empty log message ***


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
7e70829632f82de15db187845666aaca6e04b792 25-Jun-2002 Chris Lattner <sabre@nondot.org> MEGAPATCH checkin.

For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
f016ea4ff80c56c467247a90567dd07bddb590f3 22-May-2002 Chris Lattner <sabre@nondot.org> Use the new DEBUG(x) macro to allow debugging code to be enabled on the commandline


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2713 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
a36e6c8cd58c2876decd2d0402064ac349bbec71 16-May-2002 Chris Lattner <sabre@nondot.org> * Make debug output conditional on #define
* Add optimization to rank computation to not recursively search when
unneccesary.
* More agressively negate expressions to open reassociation opportunities.
* Linearize (A+B)+(C+D) into ((A+B)+C)+D


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2637 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
3dec1f272219ee1f8e1499929cdf53f5bc3c2272 10-May-2002 Chris Lattner <sabre@nondot.org> Add support for printing out statistics information when -stats is added to
the command line


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
0aa7cd605df9faa57f192c0bbd04af54e7d5461d 09-May-2002 Chris Lattner <sabre@nondot.org> Give the longer name to the instruction that will probably be eliminated later


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp
4fd56003ab29e3662c909bb10e47daa97ceb55ab 09-May-2002 Chris Lattner <sabre@nondot.org> Initial checkin of expression reassociation pass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/Reassociate.cpp