Commit 0064565
[DAGCombiner] Don't ignore N2's undef elements in
Since N2 will be reused in the fold, we cannot skip N2's undef elements
if the corresponding element in N1 is well-defined.
For example:
```
t2: v4i32 = BUILD_VECTOR Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>
t24: v4i32 = BUILD_VECTOR undef:i32, undef:i32, Constant:i32<1>, undef:i32
t11: v4i32 = vselect t8, t2, t10
```
Before this patch, we fold t11 into:
```
t26: v4i32 = sign_extend t8
t27: v4i32 = add t26, t24
```
The last element of t27 is incorrect.
Closes #129181.
(cherry picked from commit 2709366)foldVSelectOfConstants (#129272)1 parent 54c90e4 commit 0064565
File tree
2 files changed
+21
-2
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen/X86
2 files changed
+21
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12547 | 12547 | | |
12548 | 12548 | | |
12549 | 12549 | | |
12550 | | - | |
| 12550 | + | |
12551 | 12551 | | |
12552 | | - | |
| 12552 | + | |
| 12553 | + | |
12553 | 12554 | | |
12554 | 12555 | | |
12555 | 12556 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
0 commit comments