Commit dd8e1ad
authored
[X86] LowerShift - track the number and location of constant shift elements. (llvm#120270)
We have several vector shift lowering strategies that have to analyse
the distribution of non-uniform constant vector shift amounts, at the
moment there is very little sharing of data between these analysis.
This patch creates a SmallDenseMap of the different LEGAL constant shift
amounts used, with a mask of which elements they are used in. So far
I've only updated the shuffle(immshift(x,c1),immshift(x,c2)) lowering
pattern to use it for clarity, there's several more that can be done in
followups. Its hoped that the proposed patch llvm#117980 can be simplified
after this patch as well.
vec_shift6.ll - the existing shuffle(immshift(x,c1),immshift(x,c2))
lowering bails on out of range shift amounts, while this patch now skips
them and treats them as UNDEF - this means we manage to fold more cases
that before would have to lower to a SHL->MUL pattern, including some
legalized cases.1 parent 9826201 commit dd8e1ad
File tree
4 files changed
+85
-74
lines changed- llvm
- lib/Target/X86
- test/CodeGen/X86
4 files changed
+85
-74
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30057 | 30057 | | |
30058 | 30058 | | |
30059 | 30059 | | |
| 30060 | + | |
| 30061 | + | |
| 30062 | + | |
| 30063 | + | |
| 30064 | + | |
| 30065 | + | |
| 30066 | + | |
| 30067 | + | |
| 30068 | + | |
| 30069 | + | |
| 30070 | + | |
| 30071 | + | |
| 30072 | + | |
| 30073 | + | |
| 30074 | + | |
| 30075 | + | |
| 30076 | + | |
30060 | 30077 | | |
30061 | 30078 | | |
30062 | 30079 | | |
| |||
30067 | 30084 | | |
30068 | 30085 | | |
30069 | 30086 | | |
30070 | | - | |
30071 | | - | |
30072 | | - | |
30073 | | - | |
30074 | | - | |
30075 | | - | |
30076 | | - | |
30077 | | - | |
30078 | | - | |
30079 | | - | |
30080 | | - | |
30081 | | - | |
30082 | | - | |
30083 | | - | |
30084 | | - | |
30085 | | - | |
30086 | | - | |
30087 | | - | |
30088 | | - | |
30089 | | - | |
30090 | | - | |
| 30087 | + | |
| 30088 | + | |
| 30089 | + | |
| 30090 | + | |
| 30091 | + | |
| 30092 | + | |
| 30093 | + | |
| 30094 | + | |
| 30095 | + | |
| 30096 | + | |
| 30097 | + | |
| 30098 | + | |
| 30099 | + | |
30091 | 30100 | | |
30092 | 30101 | | |
30093 | 30102 | | |
30094 | | - | |
30095 | | - | |
| 30103 | + | |
30096 | 30104 | | |
30097 | 30105 | | |
30098 | 30106 | | |
30099 | | - | |
30100 | | - | |
30101 | | - | |
30102 | | - | |
30103 | | - | |
30104 | | - | |
30105 | | - | |
30106 | | - | |
30107 | | - | |
30108 | | - | |
| 30107 | + | |
| 30108 | + | |
| 30109 | + | |
| 30110 | + | |
| 30111 | + | |
30109 | 30112 | | |
30110 | 30113 | | |
30111 | 30114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
30 | 41 | | |
31 | 42 | | |
32 | 43 | | |
33 | | - | |
| 44 | + | |
| 45 | + | |
34 | 46 | | |
35 | 47 | | |
36 | 48 | | |
| |||
43 | 55 | | |
44 | 56 | | |
45 | 57 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
52 | 62 | | |
53 | 63 | | |
54 | 64 | | |
55 | 65 | | |
56 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
57 | 70 | | |
58 | 71 | | |
59 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | | - | |
| 340 | + | |
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
| 349 | + | |
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
392 | 387 | | |
393 | 388 | | |
394 | 389 | | |
| |||
400 | 395 | | |
401 | 396 | | |
402 | 397 | | |
403 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
404 | 402 | | |
405 | 403 | | |
406 | 404 | | |
| |||
411 | 409 | | |
412 | 410 | | |
413 | 411 | | |
414 | | - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
486 | | - | |
487 | 485 | | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
501 | 496 | | |
502 | 497 | | |
503 | 498 | | |
| |||
0 commit comments