Commit 9304af3
authored
[InstCombine] Fixing wrong select folding in vectors with undef elements (llvm#102244)
This PR fixes llvm#98435.
`SimplifyDemandedVectorElts` mishandles the undef by assuming that
!isNullValue() means the condition is true.
By preventing any value that we're not certain equals 1 or 0, it avoids
having to make any particular choice by not demanding bits from a
particular branch with potentially picking a wrong value.
Proof: https://alive2.llvm.org/ce/z/r8CmEu1 parent 0e12453 commit 9304af3
File tree
2 files changed
+15
-8
lines changed- llvm
- lib/Transforms/InstCombine
- test/Transforms/InstCombine
2 files changed
+15
-8
lines changedLines changed: 3 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1735 | 1735 | | |
1736 | 1736 | | |
1737 | 1737 | | |
1738 | | - | |
1739 | | - | |
1740 | 1738 | | |
1741 | | - | |
1742 | | - | |
1743 | | - | |
1744 | | - | |
1745 | | - | |
| 1739 | + | |
| 1740 | + | |
1746 | 1741 | | |
1747 | 1742 | | |
1748 | | - | |
| 1743 | + | |
1749 | 1744 | | |
1750 | 1745 | | |
1751 | 1746 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments