Commit 65ffa2b
committed
[AMDGPU][SDAG] DAGCombine PTRADD -> disjoint OR
If we can't fold a PTRADD's offset into its users, lowering them to
disjoint ORs is preferable: Often, a 32-bit OR instruction suffices
where we'd otherwise use a pair of 32-bit additions with carry.
This needs to be a DAGCombine (and not a selection rule) because its
main purpose is to enable subsequent DAGCombines for bitwise operations.
We don't want to just turn PTRADDs into disjoint ORs whenever that's
sound because this transform loses the information that the operation
implements pointer arithmetic, which we will soon need to fold offsets
into FLAT instructions. Currently, disjoint ORs can still be used for
offset folding, so that part of the logic can't be tested.
The PR contains a hacky workaround for a situation where an AssertAlign
operand of a PTRADD is not DAGCombined before the PTRADD, causing the
PTRADD to be turned into a disjoint OR although reassociating it with
the operand of the AssertAlign would be better. This wouldn't be a
problem if the DAGCombiner ensured that a node is only processed after
all its operands have been processed.
For SWDEV-516125.1 parent a8fdd2e commit 65ffa2b
File tree
2 files changed
+90
-1
lines changed- llvm
- lib/Target/AMDGPU
- test/CodeGen/AMDGPU
2 files changed
+90
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15370 | 15370 | | |
15371 | 15371 | | |
15372 | 15372 | | |
| 15373 | + | |
| 15374 | + | |
| 15375 | + | |
| 15376 | + | |
| 15377 | + | |
| 15378 | + | |
| 15379 | + | |
| 15380 | + | |
| 15381 | + | |
| 15382 | + | |
| 15383 | + | |
| 15384 | + | |
| 15385 | + | |
| 15386 | + | |
| 15387 | + | |
| 15388 | + | |
| 15389 | + | |
| 15390 | + | |
| 15391 | + | |
| 15392 | + | |
| 15393 | + | |
| 15394 | + | |
| 15395 | + | |
| 15396 | + | |
| 15397 | + | |
| 15398 | + | |
| 15399 | + | |
| 15400 | + | |
| 15401 | + | |
| 15402 | + | |
| 15403 | + | |
| 15404 | + | |
| 15405 | + | |
| 15406 | + | |
| 15407 | + | |
15373 | 15408 | | |
15374 | 15409 | | |
15375 | 15410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
419 | 471 | | |
420 | 472 | | |
421 | 473 | | |
| 474 | + | |
| 475 | + | |
0 commit comments