Add the missing sub identity "A-(A-B) -> B" to DAGCombine.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 29 Jan 2011 12:34:05 +0000 (12:34 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 29 Jan 2011 12:34:05 +0000 (12:34 +0000)
commit2c94b4201beccbd061fd679ea7e9db1381fe8357
treec9e4e2e881b416c3a3292e02e138ca76fb48185b
parent60f5ad46c2147af79035a43e5745e46376124780
Add the missing sub identity "A-(A-B) -> B" to DAGCombine.

This happens e.g. for code like "X - X%10" where we lower the modulo operation
to a series of multiplies and shifts that are then subtracted from X, leading to
this missed optimization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124532 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp