llvm/lib
Sanjoy Das 7e76879901 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 06:52:32 +00:00
..
Analysis [ValueTracking] Make poison propagation more aggressive 2017-02-22 06:52:32 +00:00
AsmParser Change debug-info-for-profiling from a TargetOption to a function attribute. 2017-02-01 22:45:09 +00:00
Bitcode Move symbols from the global namespace into (anonymous) namespaces. NFC. 2017-02-11 11:06:55 +00:00
CodeGen [WebAssembly] Add skeleton MC support for the Wasm container format 2017-02-22 01:23:18 +00:00
DebugInfo Don't assume little endian in StreamReader / StreamWriter. 2017-02-18 01:35:33 +00:00
Demangle Add support for demangling C++11 thread_local variables. 2017-01-31 15:56:36 +00:00
ExecutionEngine [Orc] Rename ObjectLinkingLayer -> RTDyldObjectLinkingLayer. 2017-02-20 05:45:14 +00:00
Fuzzer [libFuzzer] increase the size of FixedWord from 27 to 64, see PR31950 2017-02-14 23:02:37 +00:00
IR Use const-ref in range-loop for to avoid copying pairs of std::string 2017-02-22 06:34:04 +00:00
IRReader Timer: Track name and description. 2016-11-18 19:43:18 +00:00
LibDriver LibDriver: Allow resource files to be archive members. 2016-12-15 19:37:46 +00:00
LineEditor Fix Clang-tidy modernize-deprecated-headers warnings in some files; other minor fixes. 2016-03-28 17:40:08 +00:00
Linker IRMover: Merge flags LinkModuleInlineAsm and IsPerformingImport. 2017-02-03 17:01:14 +00:00
LTO [LTO] Add ability to emit assembly to new LTO API 2017-02-15 20:36:36 +00:00
MC [WebAssembly] Add skeleton MC support for the Wasm container format 2017-02-22 01:23:18 +00:00
Object Fix -Wcovered-switch-default. 2017-02-22 01:01:45 +00:00
ObjectYAML Move symbols from the global namespace into (anonymous) namespaces. NFC. 2017-02-11 11:06:55 +00:00
Option Cleanup dump() functions. 2017-01-28 02:02:38 +00:00
Passes Increases full-unroll threshold. 2017-02-18 03:46:51 +00:00
ProfileData Cleanup dump() functions. 2017-01-28 02:02:38 +00:00
Support Try to fix the buildbot on OSX. 2017-02-21 21:31:28 +00:00
TableGen Use print() instead of dump() in code 2017-01-28 02:47:46 +00:00
Target [WebAssembly] Add skeleton MC support for the Wasm container format 2017-02-22 01:23:18 +00:00
Transforms Use const-ref in range-loop for to avoid copying pairs of std::string 2017-02-22 06:34:04 +00:00
XRay [XRAY] [x86_64] Adding a Flight Data filetype reader to the llvm-xray Trace implementation. 2017-02-17 01:47:16 +00:00
CMakeLists.txt [XRay] Define the library for XRay trace logs 2017-01-11 06:39:09 +00:00
LLVMBuild.txt Add an c++ itanium demangler to llvm. 2016-09-06 19:16:48 +00:00