[NaryReassociate] avoid running forever
authorJingyue Wu <jingyue@google.com>
Wed, 13 May 2015 18:12:24 +0000 (18:12 +0000)
committerJingyue Wu <jingyue@google.com>
Wed, 13 May 2015 18:12:24 +0000 (18:12 +0000)
commit12b5fa5f6e42eb8849d8b3bc7b1dbe676a6d8326
tree1017d2a6f0cdb17ed5a915f695807f43f9445775
parenta036cd4093db1ee19b9ab51cb1e6b26bfe69ac3c
[NaryReassociate] avoid running forever

Avoid running forever by checking we are not reassociating an expression into
the same form.

Tested with @avoid_infinite_loops in nary-add.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237269 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/NaryReassociate.cpp
test/Transforms/NaryReassociate/nary-add.ll