Go to file
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
clang [OpenMP] Generate better diagnostics for cancel and cancellation point 2017-02-22 06:49:10 +00:00
clang-tools-extra [clang-tidy] Reword the "code outside header guard" warning. 2017-02-21 11:25:45 +00:00
compiler-rt Re-commit of r295318, which was reverted due to AArch64 flakiness. Moving the test to Darwin only. 2017-02-22 01:13:34 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Move BufferPtr into the block where it it being used 2017-02-12 21:33:49 +00:00
libcxx Revert "threading_support: make __thread_sleep_for be alertable" 2017-02-18 19:28:43 +00:00
libcxxabi [CMake][libcxxabi] Update the libc++ test module path 2017-02-18 04:37:59 +00:00
libunwind [libunwind][CMake] Use libc++ headers when available 2017-02-16 05:18:08 +00:00
lld Attempt to placate MSVC buildbot. 2017-02-22 00:32:56 +00:00
lldb Mark TestDarwinLogBasic.py as an xfail because the logging is 2017-02-22 02:10:00 +00:00
llgo [llgo] Remove support for LLVM attributes 2016-12-06 19:22:04 +00:00
llvm [ValueTracking] Make poison propagation more aggressive 2017-02-22 06:52:32 +00:00
openmp [stats] add stats-gathering for static_steal scheduling method 2017-02-17 17:06:16 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly [DependenceInfo] Simplify creation and subsequent use of AccessSchedule [NFC] 2017-02-21 15:38:31 +00:00