Add generic simplification of associative operations, generalizing
authorDuncan Sands <baldrick@free.fr>
Tue, 21 Dec 2010 08:49:00 +0000 (08:49 +0000)
committerDuncan Sands <baldrick@free.fr>
Tue, 21 Dec 2010 08:49:00 +0000 (08:49 +0000)
commit566edb04b890cebca8f2eefa37af7371a1e756c9
treef04b4d1bae2dbea7dea601353149643e6e7739c2
parent47bce43229d1ccb9bdbd9f854809d588865e9648
Add generic simplification of associative operations, generalizing
a couple of existing transforms.  This fires surprisingly often, for
example when compiling gcc "(X+(-1))+1->X" fires quite a lot as well
as various "and" simplifications (usually with a phi node operand).
Most of the time this doesn't make a real difference since the same
thing would have been done elsewhere anyway, eg: by instcombine, but
there are a few places where this results in simplifications that we
were not doing before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122326 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstSimplify/2010-12-20-Reassociate.ll [new file with mode: 0644]
test/Transforms/InstSimplify/dg.exp [new file with mode: 0644]