llvm-project/llvm/test/Analysis/Delinearization
Sanjoy Das 5cd6c5cacf [ValueTracking] Make poison propagation more aggressive
Summary:
Motivation: fix PR31181 without regression (the actual fix is still in
progress).  However, the actual content of PR31181 is not relevant
here.

This change makes poison propagation more aggressive in the following
cases:

 1. poision * Val == poison, for any Val.  In particular, this changes
    existing intentional and documented behavior in these two cases:
     a. Val is 0
     b. Val is 2^k * N
 2. poison << Val == poison, for any Val
 3. getelementptr is poison if any input is poison

I think all of these are justified (and are axiomatically true in the
new poison / undef model):

1a: we need poison * 0 to be poison to allow transforms like these:

  A * (B + C) ==> A * B + A * C

If poison * 0 were 0 then the above transform could not be allowed
since e.g. we could have A = poison, B = 1, C = -1, making the LHS

  poison * (1 + -1) = poison * 0 = 0

and the RHS

  poison * 1 + poison * -1 = poison + poison = poison

1b: we need e.g. poison * 4 to be poison since we want to allow

  A * 4 ==> A + A + A + A

If poison * 4 were a value with all of their bits poison except the
last four; then we'd not be able to do this transform since then if A
were poison the LHS would only be "partially" poison while the RHS
would be "full" poison.

2: Same reasoning as (1b), we'd like have the following kinds
transforms be legal:

  A << 1 ==> A + A

Reviewers: majnemer, efriedma

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 295809
2017-02-22 06:52:32 +00:00
..
a.ll [ValueTracking] Make poison propagation more aggressive 2017-02-22 06:52:32 +00:00
divide_by_one.ll
gcd_multiply_expr.ll
himeno_1.ll
himeno_2.ll
iv_times_constant_in_subscript.ll [ValueTracking] Make poison propagation more aggressive 2017-02-22 06:52:32 +00:00
lit.local.cfg
multidim_ivs_and_integer_offsets_3d.ll [SCEV] Mark AddExprs as nsw or nuw if legal 2015-10-22 19:57:19 +00:00
multidim_ivs_and_integer_offsets_nts_3d.ll [SCEV] Mark AddExprs as nsw or nuw if legal 2015-10-22 19:57:19 +00:00
multidim_ivs_and_parameteric_offsets_3d.ll
multidim_only_ivs_2d.ll
multidim_only_ivs_2d_nested.ll
multidim_only_ivs_3d.ll
multidim_only_ivs_3d_cast.ll
multidim_two_accesses_different_delinearization.ll
parameter_addrec_product.ll
terms_with_identity_factor.ll [SCEV] Consider delinearization pattern with extension with identity factor 2016-10-17 11:56:26 +00:00
type_mismatch.ll
undef.ll