Give the Reassociate pass a bit more flexibility and autonomy when optimizing express...
authorOwen Anderson <resistor@mac.com>
Sun, 5 Oct 2014 23:41:26 +0000 (23:41 +0000)
committerOwen Anderson <resistor@mac.com>
Sun, 5 Oct 2014 23:41:26 +0000 (23:41 +0000)
commiteb2be340947ec1acf325710d1e7297345f56ff35
tree8da4864056e161d6d0c79e732c2c602c16b1c3dd
parent1d02acb7a0330ad68bce53e80e5538bedfcb6c2f
Give the Reassociate pass a bit more flexibility and autonomy when optimizing expressions.
Particularly, it addresses cases where Reassociate breaks Subtracts but then fails to optimize combinations like I1 + -I2 where I1 and I2 have the same rank and are identical.

Patch by Dmitri Shtilman.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219092 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/Reassociate.cpp
test/Transforms/Reassociate/negation1.ll [new file with mode: 0644]