Commit addf878
committed
[SDAG] Teach FoldConstantArithmetic to match splats inserted into vectors
This teaches FoldConstantArithmetic to match `insert_subvector undef, (splat X), N2`
as a splat of X. This pattern can occur for scalable vectors when a
fixed-length splat is inserted into an undef vector.
This allows the cases in `fixed-subvector-insert-into-scalable.ll` to be
constant-folded (where previously they would all be computed at runtime).1 parent 1e605fc commit addf878
File tree
2 files changed
+34
-19
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen/AArch64
2 files changed
+34
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7338 | 7338 | | |
7339 | 7339 | | |
7340 | 7340 | | |
7341 | | - | |
| 7341 | + | |
| 7342 | + | |
| 7343 | + | |
| 7344 | + | |
| 7345 | + | |
| 7346 | + | |
| 7347 | + | |
7342 | 7348 | | |
7343 | 7349 | | |
7344 | | - | |
| 7350 | + | |
| 7351 | + | |
7345 | 7352 | | |
7346 | 7353 | | |
7347 | 7354 | | |
7348 | 7355 | | |
7349 | 7356 | | |
7350 | | - | |
| 7357 | + | |
7351 | 7358 | | |
7352 | 7359 | | |
7353 | 7360 | | |
| |||
7374 | 7381 | | |
7375 | 7382 | | |
7376 | 7383 | | |
| 7384 | + | |
| 7385 | + | |
| 7386 | + | |
| 7387 | + | |
| 7388 | + | |
| 7389 | + | |
| 7390 | + | |
| 7391 | + | |
| 7392 | + | |
| 7393 | + | |
| 7394 | + | |
| 7395 | + | |
| 7396 | + | |
7377 | 7397 | | |
7378 | 7398 | | |
7379 | 7399 | | |
7380 | 7400 | | |
7381 | | - | |
| 7401 | + | |
7382 | 7402 | | |
7383 | 7403 | | |
7384 | | - | |
| 7404 | + | |
| 7405 | + | |
7385 | 7406 | | |
7386 | 7407 | | |
7387 | 7408 | | |
7388 | 7409 | | |
7389 | 7410 | | |
7390 | 7411 | | |
7391 | 7412 | | |
7392 | | - | |
| 7413 | + | |
| 7414 | + | |
| 7415 | + | |
| 7416 | + | |
7393 | 7417 | | |
7394 | 7418 | | |
7395 | 7419 | | |
| |||
Lines changed: 4 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 7 | + | |
14 | 8 | | |
15 | 9 | | |
16 | 10 | | |
| |||
21 | 15 | | |
22 | 16 | | |
23 | 17 | | |
24 | | - | |
25 | | - | |
| 18 | + | |
26 | 19 | | |
27 | 20 | | |
28 | 21 | | |
| |||
33 | 26 | | |
34 | 27 | | |
35 | 28 | | |
36 | | - | |
37 | | - | |
| 29 | + | |
38 | 30 | | |
39 | 31 | | |
40 | 32 | | |
| |||
45 | 37 | | |
46 | 38 | | |
47 | 39 | | |
48 | | - | |
49 | | - | |
| 40 | + | |
50 | 41 | | |
51 | 42 | | |
52 | 43 | | |
| |||
0 commit comments