Commit 5be66d0
authored
[NFC][AMDGPU] Let IR level callers query the FMA/FMAD predicates (#213310)
isFMADLegal and isFMAFasterThanFMulAndFAdd read the denormal mode out of
the MachineFunction, so nothing before instruction selection can ask
them whether an fmul/fadd pair will be fused. Take an explicit
DenormalFPEnv instead, and make the existing MachineFunction /
SelectionDAG / MachineInstr entry points thin wrappers over it.
Also override the IR level isFMAFasterThanFMulAndFAdd hook. The two
views agree by construction, since SIModeRegisterDefaults copies its
denormal fields out of getDenormalFPEnv.
isFMADLegal uses VT as written and does not look through vectors, so a
vector type reports false, as in the SelectionDAG overload it was
extracted from.
The patch is preparation for querying these from getArithmeticInstrCost
and a revived isProfitableToSinkOperands.
Contributes to #211092
Assisted-By: Claude Opus 51 parent a432964 commit 5be66d0
3 files changed
Lines changed: 56 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
7438 | 7442 | | |
7439 | 7443 | | |
7440 | 7444 | | |
7441 | | - | |
7442 | | - | |
| 7445 | + | |
| 7446 | + | |
7443 | 7447 | | |
| 7448 | + | |
| 7449 | + | |
7444 | 7450 | | |
7445 | 7451 | | |
7446 | 7452 | | |
| |||
7451 | 7457 | | |
7452 | 7458 | | |
7453 | 7459 | | |
7454 | | - | |
| 7460 | + | |
7455 | 7461 | | |
7456 | 7462 | | |
7457 | 7463 | | |
| |||
7461 | 7467 | | |
7462 | 7468 | | |
7463 | 7469 | | |
7464 | | - | |
| 7470 | + | |
| 7471 | + | |
7465 | 7472 | | |
7466 | 7473 | | |
7467 | 7474 | | |
7468 | 7475 | | |
7469 | 7476 | | |
7470 | 7477 | | |
7471 | 7478 | | |
| 7479 | + | |
| 7480 | + | |
| 7481 | + | |
| 7482 | + | |
| 7483 | + | |
| 7484 | + | |
| 7485 | + | |
| 7486 | + | |
| 7487 | + | |
| 7488 | + | |
| 7489 | + | |
| 7490 | + | |
7472 | 7491 | | |
7473 | 7492 | | |
7474 | 7493 | | |
| |||
7485 | 7504 | | |
7486 | 7505 | | |
7487 | 7506 | | |
| 7507 | + | |
| 7508 | + | |
| 7509 | + | |
| 7510 | + | |
| 7511 | + | |
| 7512 | + | |
| 7513 | + | |
| 7514 | + | |
| 7515 | + | |
| 7516 | + | |
| 7517 | + | |
| 7518 | + | |
| 7519 | + | |
7488 | 7520 | | |
7489 | 7521 | | |
7490 | 7522 | | |
7491 | 7523 | | |
| 7524 | + | |
7492 | 7525 | | |
7493 | | - | |
| 7526 | + | |
7494 | 7527 | | |
7495 | | - | |
7496 | | - | |
| 7528 | + | |
7497 | 7529 | | |
7498 | 7530 | | |
7499 | 7531 | | |
7500 | 7532 | | |
7501 | 7533 | | |
7502 | 7534 | | |
7503 | | - | |
7504 | | - | |
7505 | | - | |
7506 | | - | |
7507 | | - | |
7508 | | - | |
7509 | | - | |
7510 | | - | |
7511 | | - | |
7512 | | - | |
7513 | | - | |
7514 | | - | |
| 7535 | + | |
| 7536 | + | |
7515 | 7537 | | |
7516 | 7538 | | |
7517 | 7539 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
506 | 507 | | |
507 | 508 | | |
508 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
509 | 519 | | |
510 | 520 | | |
511 | 521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| |||
0 commit comments