Since commit 157467, if reassociate isn't actually going to change an expression
authorDuncan Sands <baldrick@free.fr>
Sat, 26 May 2012 16:42:52 +0000 (16:42 +0000)
committerDuncan Sands <baldrick@free.fr>
Sat, 26 May 2012 16:42:52 +0000 (16:42 +0000)
commiteacc31acf515c79338e8c94ce8c7c26dd7b2d32a
tree55e93a14399d5b9a7755b274d6dfa63c17d0b83a
parent3e933ecb74d4d622ae574ad1cb60a5b8ec126774
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
lib/Transforms/Scalar/Reassociate.cpp
test/Transforms/Reassociate/no-op.ll [new file with mode: 0644]