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)
commit3c05cd3ea8d9073fcf6fab35755c2ef9343c63a6
tree906980e919cc095c599fd102e9b5a015577fc87b
parentf3b7681f2bc72c64837abffab67b9d53110002ac
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.

llvm-svn: 157518
llvm/lib/Transforms/Scalar/Reassociate.cpp
llvm/test/Transforms/Reassociate/no-op.ll [new file with mode: 0644]