HomePhabricator

[InstSimplify] fold sdiv/srem based on compare of dividend and divisor

Description

[InstSimplify] fold sdiv/srem based on compare of dividend and divisor

This should bring signed div/rem analysis up to the same level as unsigned.
We use icmp simplification to determine when the divisor is known greater than the dividend.

Each positive test is followed by a negative test to show that we're not overstepping the boundaries of the known bits.
There are extra tests for the signed-min-value special cases.

Alive proofs:
http://rise4fun.com/Alive/WI5

Differential Revision: https://reviews.llvm.org/D37713

Details

Committed
spatelSep 14 2017, 7:59 AM
Differential Revision
D37713: [InstSimplify] fold sdiv/srem based on compare of dividend and divisor
Parents
rL313263: Add newline to end of test file. NFC.
Branches
Unknown
Tags
Unknown