diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2017-06-06 08:28:17 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2017-06-06 08:28:17 +0000 |
commit | b2781fb1865dc23fcbbf3aed0983bf79d3b6ad63 (patch) | |
tree | 4167d1412293c9825b74d11c8a7a73fe2ba46d01 /llvm/lib/Object/SymbolicFile.cpp | |
parent | 56d87ef5d7c3b3f53cafd2a360b949b39bc88733 (diff) | |
download | bcm5719-llvm-b2781fb1865dc23fcbbf3aed0983bf79d3b6ad63.tar.gz bcm5719-llvm-b2781fb1865dc23fcbbf3aed0983bf79d3b6ad63.zip |
[docs] Make it clear shifts yield poison when shift amount >= bitwidth
Some InstCombine optimizations already rely on the result being poison
rather than undef.
For example, the following rewrite is wrong if undef is used:
; (1 << Y) * X -> X << Y
%Op0 = shl 1, %Y
%r = mul %Op0, %Op1
=>
%r = shl %Op1, %Y
ERROR: Mismatch in values for i4 %r
Example:
i4 %Y = 0x8 (8, -8)
i4 %Op0 = 0x0 (0)
i4 %Op1 = 0x0 (0)
source: 0x0 (0)
target: 0x1 (1)
The optimization is correct if poison is returned instead:
http://rise4fun.com/Alive/ygX
Differential Revision: https://reviews.llvm.org/D33654
llvm-svn: 304780
Diffstat (limited to 'llvm/lib/Object/SymbolicFile.cpp')
0 files changed, 0 insertions, 0 deletions