Commit 249ed6f
committed
[DAG] Extend extract_element(bitcast(scalar_to_vector(X))) -> trunc(srl(X,C))
When extracting a smaller integer from a scalar_to_vector source, we were limited to only folding away the lowest bits of the scalar.
This patch extends the fold to handle extraction of any other element, by right shifting the source before truncation.
Fixes a regression from #1178841 parent e98396f commit 249ed6f
File tree
5 files changed
+49
-63
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen
- AArch64
- PowerPC
- X86
5 files changed
+49
-63
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23055 | 23055 | | |
23056 | 23056 | | |
23057 | 23057 | | |
23058 | | - | |
| 23058 | + | |
| 23059 | + | |
23059 | 23060 | | |
23060 | 23061 | | |
23061 | 23062 | | |
23062 | | - | |
| 23063 | + | |
| 23064 | + | |
23063 | 23065 | | |
23064 | 23066 | | |
23065 | 23067 | | |
23066 | 23068 | | |
23067 | | - | |
| 23069 | + | |
23068 | 23070 | | |
23069 | 23071 | | |
| 23072 | + | |
| 23073 | + | |
| 23074 | + | |
| 23075 | + | |
| 23076 | + | |
| 23077 | + | |
| 23078 | + | |
| 23079 | + | |
| 23080 | + | |
23070 | 23081 | | |
23071 | 23082 | | |
23072 | 23083 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | | - | |
32 | | - | |
| 30 | + | |
| 31 | + | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 42 | + | |
| 43 | + | |
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
| |||
63 | 61 | | |
64 | 62 | | |
65 | 63 | | |
66 | | - | |
67 | | - | |
| 64 | + | |
| 65 | + | |
68 | 66 | | |
69 | 67 | | |
70 | 68 | | |
| |||
75 | 73 | | |
76 | 74 | | |
77 | 75 | | |
78 | | - | |
79 | | - | |
80 | | - | |
| 76 | + | |
81 | 77 | | |
82 | 78 | | |
83 | 79 | | |
| |||
96 | 92 | | |
97 | 93 | | |
98 | 94 | | |
99 | | - | |
100 | | - | |
| 95 | + | |
101 | 96 | | |
102 | 97 | | |
103 | 98 | | |
| |||
115 | 110 | | |
116 | 111 | | |
117 | 112 | | |
118 | | - | |
119 | | - | |
| 113 | + | |
| 114 | + | |
120 | 115 | | |
121 | 116 | | |
122 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
| 361 | + | |
362 | 362 | | |
363 | | - | |
364 | | - | |
365 | 363 | | |
| 364 | + | |
366 | 365 | | |
367 | 366 | | |
368 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 19 | + | |
| 20 | + | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
| |||
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 31 | + | |
37 | 32 | | |
38 | 33 | | |
39 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
392 | 391 | | |
393 | 392 | | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
417 | 403 | | |
418 | 404 | | |
419 | 405 | | |
| |||
0 commit comments