Commit df5bcbf
committed
[RISCV] Add combine for shadd family of instructions.
For example for the following situation:
%6:gpr = SLLI %2:gpr, 2
%7:gpr = ADDI killed %6:gpr, 24
%8:gpr = ADD %0:gpr, %7:gpr
If we swap the two add instrucions we can merge the shift and add.
The final code will look something like this:
%7 = SH2ADD %0, %2
%8 = ADDI %7, 241 parent f3e5594 commit df5bcbf
File tree
2 files changed
+204
-1
lines changed- llvm
- lib/Target/RISCV
- test/CodeGen/RISCV
2 files changed
+204
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
| |||
14306 | 14312 | | |
14307 | 14313 | | |
14308 | 14314 | | |
| 14315 | + | |
| 14316 | + | |
| 14317 | + | |
| 14318 | + | |
| 14319 | + | |
| 14320 | + | |
| 14321 | + | |
| 14322 | + | |
| 14323 | + | |
| 14324 | + | |
| 14325 | + | |
| 14326 | + | |
| 14327 | + | |
| 14328 | + | |
| 14329 | + | |
| 14330 | + | |
| 14331 | + | |
| 14332 | + | |
| 14333 | + | |
| 14334 | + | |
| 14335 | + | |
| 14336 | + | |
| 14337 | + | |
| 14338 | + | |
| 14339 | + | |
| 14340 | + | |
| 14341 | + | |
| 14342 | + | |
| 14343 | + | |
| 14344 | + | |
| 14345 | + | |
| 14346 | + | |
| 14347 | + | |
| 14348 | + | |
| 14349 | + | |
| 14350 | + | |
| 14351 | + | |
| 14352 | + | |
| 14353 | + | |
| 14354 | + | |
| 14355 | + | |
| 14356 | + | |
| 14357 | + | |
| 14358 | + | |
| 14359 | + | |
| 14360 | + | |
| 14361 | + | |
| 14362 | + | |
| 14363 | + | |
| 14364 | + | |
| 14365 | + | |
| 14366 | + | |
| 14367 | + | |
| 14368 | + | |
| 14369 | + | |
| 14370 | + | |
| 14371 | + | |
| 14372 | + | |
| 14373 | + | |
| 14374 | + | |
| 14375 | + | |
| 14376 | + | |
| 14377 | + | |
| 14378 | + | |
| 14379 | + | |
| 14380 | + | |
| 14381 | + | |
| 14382 | + | |
| 14383 | + | |
| 14384 | + | |
| 14385 | + | |
| 14386 | + | |
| 14387 | + | |
| 14388 | + | |
| 14389 | + | |
| 14390 | + | |
| 14391 | + | |
| 14392 | + | |
| 14393 | + | |
| 14394 | + | |
| 14395 | + | |
14309 | 14396 | | |
14310 | 14397 | | |
14311 | 14398 | | |
| |||
14547 | 14634 | | |
14548 | 14635 | | |
14549 | 14636 | | |
14550 | | - | |
| 14637 | + | |
14551 | 14638 | | |
14552 | 14639 | | |
| 14640 | + | |
| 14641 | + | |
| 14642 | + | |
14553 | 14643 | | |
14554 | 14644 | | |
14555 | 14645 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
0 commit comments