Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
1 parent
56d87ef
commit b2781fb
Showing
1 changed file
with
15 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters