It is illegal to transform (sdiv (ashr X c1) c2) -> (sdiv x (2^c1 * c2)),
authorNadav Rotem <nrotem@apple.com>
Thu, 30 Aug 2012 11:23:20 +0000 (11:23 +0000)
committerNadav Rotem <nrotem@apple.com>
Thu, 30 Aug 2012 11:23:20 +0000 (11:23 +0000)
commit639570c3117aaabb0c97b34a9bf05d09f8903ef4
treea844659e4411dc7c722bc16c130f349d5d0667b4
parentc4a32e6596f3974a6c00322db1f5f31ea448bd58
It is illegal to transform (sdiv (ashr X c1) c2)  -> (sdiv x (2^c1 * c2)),
because C always rounds towards zero.

Thanks Dirk and Ben.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162899 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
test/Transforms/InstCombine/2012-08-28-udiv_ashl.ll