Commit Graph

10 Commits

Author SHA1 Message Date
David Majnemer 65c52ae8ca InstSimplify: shl nsw/nuw undef, %V -> undef
We can always choose an value for undef which might cause %V to shift
out an important bit except for one case, when %V is zero.

However, shl behaves like an identity function when the right hand side
is zero.

llvm-svn: 224405
2014-12-17 01:54:33 +00:00
David Majnemer f532fcb889 InstSimplify: Remove usesless %a parameter from tests
No functional change intended.

llvm-svn: 224016
2014-12-11 12:56:17 +00:00
David Majnemer 89cf6d79eb ConstantFold: an undef shift amount results in undef
X shifted by undef results in undef because the undef value can
represent values greater than the width of the operands.

llvm-svn: 223968
2014-12-10 21:38:05 +00:00
David Majnemer 7b86b77248 ConstantFold: div undef, 0 should fold to undef, not zero
Dividing by zero yields an undefined value.

llvm-svn: 223924
2014-12-10 09:14:55 +00:00
David Majnemer ae707582c0 InstSimplify: [al]shr exact undef, %X -> undef
Exact shifts always keep the non-zero bits of their input.  This means
it keeps it's undef bits.

llvm-svn: 223923
2014-12-10 09:14:52 +00:00
David Majnemer 71dc8fb867 InstSimplify: div %X, 0 -> undef
We already optimized rem %X, 0 to undef, we should do the same for div.

llvm-svn: 223919
2014-12-10 07:52:18 +00:00
Benjamin Kramer 5e1794eedb InstSimplify: Make shift, select and GEP simplifications vector-aware.
llvm-svn: 200016
2014-01-24 17:09:53 +00:00
Dan Gohman ce3d6248b2 Add tests for existing InstSimplify features.
llvm-svn: 143721
2011-11-04 18:39:16 +00:00
Dan Gohman 85977e6ab4 Teach instsimplify to simplify calls to undef.
llvm-svn: 143719
2011-11-04 18:32:42 +00:00
Dan Gohman 54664ed714 Improve constant folding of undef for cmp and select operators.
llvm-svn: 134223
2011-07-01 01:03:43 +00:00