HomePhabricator

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

Authored by spatel on Sep 14 2017, 7:59 AM.

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

llvm-svn: 313264

Details

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