Georg Lehmann
d1dca26941
aco/ra: disallow vcc definitions for pseudo scalar trans instrs
...
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Foz-DB GFX1201:
Totals from 30 (0.04% of 79600) affected shaders:
Instrs: 58843 -> 58820 (-0.04%); split: -0.10%, +0.06%
CodeSize: 302228 -> 301944 (-0.09%); split: -0.13%, +0.04%
Latency: 204566 -> 204432 (-0.07%); split: -0.09%, +0.02%
InvThroughput: 136918 -> 136919 (+0.00%); split: -0.00%, +0.00%
SClause: 1241 -> 1249 (+0.64%); split: -0.56%, +1.21%
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34006 >
2025-03-14 13:53:55 +00:00
Natalie Vock
d5a2666ad9
aco/ra: Assert operands only clear their own id
...
This is useful for debugging register assignment, as this case would
usually result in RA silently assigning the same register to multiple
temps at the same time.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29576 >
2025-02-28 16:00:48 +00:00
Natalie Vock
b8bcc8e5c5
aco/ra: Handle temps fixed to different regs in different operands
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29576 >
2025-02-28 16:00:48 +00:00
Natalie Vock
7a4775b396
aco/ra: Add option to skip renaming for parallelcopies
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29576 >
2025-02-28 16:00:48 +00:00
Natalie Vock
b339bcfa38
aco/ra: Use struct for parallelcopies
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29576 >
2025-02-28 16:00:48 +00:00
Natalie Vock
3f182bc1fa
aco/ra: Use iterators for linear VGPR copy extraction
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29576 >
2025-02-28 16:00:48 +00:00
Daniel Schürmann
52253da783
aco: unify get_addr_sgpr_from_waves() and get_addr_vgpr_from_waves() into one function
...
which returns the limit as RegisterDemand.
Also remove the unused get_extra_sgprs() from aco_ir.h.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33644 >
2025-02-21 13:49:41 +00:00
Rhys Perry
d946a753e3
aco/ra: unconditionally call undo_renames
...
There's no real reason to not do this more.
fossil-db (navi21):
Totals from 2615 (3.29% of 79377) affected shaders:
Instrs: 4729505 -> 4729484 (-0.00%); split: -0.00%, +0.00%
CodeSize: 25210992 -> 25210036 (-0.00%); split: -0.00%, +0.00%
Latency: 31572966 -> 31572435 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 6918552 -> 6918560 (+0.00%); split: -0.00%, +0.00%
VClause: 132152 -> 132116 (-0.03%); split: -0.03%, +0.00%
SClause: 98595 -> 98575 (-0.02%); split: -0.04%, +0.02%
fossil-db (polaris10):
Totals from 1039 (1.68% of 61794) affected shaders:
Instrs: 708761 -> 708766 (+0.00%); split: -0.00%, +0.00%
CodeSize: 3588772 -> 3588792 (+0.00%); split: -0.00%, +0.00%
Latency: 7458892 -> 7459513 (+0.01%); split: -0.00%, +0.01%
InvThroughput: 3494669 -> 3494722 (+0.00%); split: -0.00%, +0.00%
VClause: 16754 -> 16737 (-0.10%)
SClause: 18190 -> 18156 (-0.19%); split: -0.49%, +0.31%
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33444 >
2025-02-11 23:10:37 +00:00
Rhys Perry
b94b4188a6
aco/ra: reverse renaming of operands outside update_renames
...
This lets us remove some special casing from update_renames and make it
simpler. Doing this in update_renames was also fragile, since the
parallelcopies vector is not final when update_renames is called, so it
might not have been safe to do so in the end.
No fossil-db changes.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33444 >
2025-02-11 23:10:37 +00:00
Georg Lehmann
65506e635b
aco/ra: don't write to scc/ttmp with s_fmac
...
Fixes: 4bd229ac50 ("aco/gfx11.5: select SOP2 float instructions")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32545 >
2024-12-11 12:51:18 +00:00
Georg Lehmann
0b9e2a5427
aco/ra: disallow s_cmpk with scc operand
...
Fixes: 2d6b0a4177 ("aco/optimizer: Optimize SOPC with literal to SOPK.")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32545 >
2024-12-11 12:51:18 +00:00
Georg Lehmann
fe0c72caec
aco/ra: don't write to exec/ttmp with mulk/addk/cmovk
...
ttmp sgprs are readonly outside of trap handlers, so the instructions were
probably skipped. RA should also never create additional exec writes.
Fixes: e06773281b ("aco/ra: Optimize some SOP2 instructions with literal to SOPK.")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32545 >
2024-12-11 12:51:18 +00:00
Daniel Schürmann
b64fff7731
aco: remove definition from Pseudo branch instructions
...
They are not needed anymore.
Totals from 7019 (8.84% of 79395) affected shaders: (Navi31)
Instrs: 14805400 -> 14824196 (+0.13%); split: -0.00%, +0.13%
CodeSize: 78079972 -> 78132932 (+0.07%); split: -0.01%, +0.08%
SpillSGPRs: 4485 -> 4515 (+0.67%); split: -0.76%, +1.43%
Latency: 165862000 -> 165836134 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 30061764 -> 30057781 (-0.01%); split: -0.01%, +0.00%
SClause: 392323 -> 392286 (-0.01%); split: -0.01%, +0.00%
Copies: 1012262 -> 1012234 (-0.00%); split: -0.04%, +0.04%
Branches: 365910 -> 365909 (-0.00%); split: -0.00%, +0.00%
PreSGPRs: 360167 -> 355363 (-1.33%)
VALU: 8837197 -> 8837276 (+0.00%); split: -0.00%, +0.00%
SALU: 1402593 -> 1402621 (+0.00%); split: -0.03%, +0.03%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32037 >
2024-12-06 14:34:03 +00:00
Daniel Schürmann
1ff9a0fe80
aco: remove Pseudo_instruction::tmp_in_scc
...
This information is redundant, now.
No fossil-changes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32217 >
2024-11-20 11:04:32 +00:00
Daniel Schürmann
a1a4a6061c
aco/ra: explicitly assign scratch SGPR for linear phis
...
We are about to remove the branch definitions which previously
served this purpose. Also remove Block::scc_live_out.
Some changes due to round-robin RA.
Totals from 939 (1.18% of 79395) affected shaders: (Navi31)
Instrs: 5038786 -> 5038611 (-0.00%); split: -0.01%, +0.00%
CodeSize: 26153412 -> 26152904 (-0.00%); split: -0.00%, +0.00%
Latency: 41649989 -> 41650120 (+0.00%); split: -0.00%, +0.00%
InvThroughput: 6447508 -> 6447536 (+0.00%); split: -0.00%, +0.00%
SClause: 131319 -> 131276 (-0.03%); split: -0.03%, +0.00%
Copies: 359362 -> 359256 (-0.03%); split: -0.05%, +0.02%
SALU: 639275 -> 639169 (-0.02%); split: -0.03%, +0.01%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32217 >
2024-11-20 11:04:32 +00:00
Daniel Schürmann
17da551133
aco/ra: use bitset for sgpr_operands_alias_defs
...
We cannot rely on SGPR Temps being fully aligned to 64 SGPRs.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32217 >
2024-11-20 11:04:32 +00:00
Daniel Schürmann
a04e096339
aco/ra: set Pseudo_instruction::scratch_sgpr to SCC if it doesn't need to be preserved
...
Also ensure that 'needs_scratch_reg' is always true if SCC might be overwritten.
Few changes, because some p_split_vector get SCC as scratch reg assigned,
and thus, can inhibit some postRA optimizations.
Totals from 3 (0.00% of 79395) affected shaders: (Navi31)
Instrs: 10501 -> 10500 (-0.01%); split: -0.02%, +0.01%
CodeSize: 51580 -> 51520 (-0.12%); split: -0.12%, +0.01%
Latency: 84166 -> 84174 (+0.01%)
InvThroughput: 13109 -> 13111 (+0.02%)
SALU: 859 -> 860 (+0.12%)
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32217 >
2024-11-20 11:04:32 +00:00
Daniel Schürmann
ef47cce51c
aco/ra: always block register file for precolored operands
...
so that they don't accidentally get renamed.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31387 >
2024-10-22 12:29:18 +00:00
Daniel Schürmann
18e7e8d8f0
aco/ra: make use of Precolored flag
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31387 >
2024-10-22 12:29:18 +00:00
Daniel Schürmann
e2705a9d85
aco: set Precolored flag before register allocation
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31387 >
2024-10-22 12:29:18 +00:00
Daniel Schürmann
19583023a2
aco/ra: remove unnecessary check for duplicate precolored operands
...
An instruction can have at most one operand precolored to the same register.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31362 >
2024-10-07 07:00:20 +00:00
Daniel Schürmann
9b2c4c4644
aco/ra: manually fill killed operands when required
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31362 >
2024-10-07 07:00:20 +00:00
Daniel Schürmann
b530b67c73
aco/ra: add RegisterFile::fill_killed_operands(Instruction*) helper
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31362 >
2024-10-07 07:00:20 +00:00
Daniel Schürmann
30e7644e5f
aco: simplify Definition constructors
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31362 >
2024-10-07 07:00:19 +00:00
Rhys Perry
96e7cd89ea
aco: fix is_vector_intact for GFX11 BVH
...
fossil-db (navi31):
Totals from 44 (0.06% of 79395) affected shaders:
Instrs: 1539111 -> 1539109 (-0.00%); split: -0.00%, +0.00%
CodeSize: 7880452 -> 7880380 (-0.00%); split: -0.00%, +0.00%
Latency: 7578794 -> 7578844 (+0.00%); split: -0.00%, +0.00%
InvThroughput: 1450872 -> 1450876 (+0.00%); split: -0.00%, +0.00%
VClause: 40014 -> 40010 (-0.01%)
Copies: 116005 -> 116001 (-0.00%); split: -0.01%, +0.01%
VALU: 854630 -> 854626 (-0.00%); split: -0.00%, +0.00%
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31346 >
2024-10-03 17:55:56 +00:00
Rhys Perry
24c60be1ad
aco: create vector affinities for phi operands
...
fossil-db (navi21):
Totals from 2934 (3.70% of 79395) affected shaders:
Instrs: 8368484 -> 8365630 (-0.03%); split: -0.05%, +0.01%
CodeSize: 46032152 -> 45998480 (-0.07%); split: -0.09%, +0.01%
VGPRs: 200360 -> 200280 (-0.04%); split: -0.12%, +0.08%
Latency: 85556147 -> 85562615 (+0.01%); split: -0.09%, +0.10%
InvThroughput: 19066462 -> 19065173 (-0.01%); split: -0.09%, +0.09%
VClause: 209834 -> 209783 (-0.02%); split: -0.14%, +0.12%
SClause: 261811 -> 261826 (+0.01%); split: -0.00%, +0.01%
Copies: 727502 -> 724394 (-0.43%); split: -0.56%, +0.13%
Branches: 291083 -> 291120 (+0.01%); split: -0.01%, +0.03%
VALU: 5564021 -> 5560975 (-0.05%); split: -0.07%, +0.02%
SALU: 1100996 -> 1100942 (-0.00%); split: -0.02%, +0.02%
fossil-db (navi31):
Totals from 34207 (43.08% of 79395) affected shaders:
MaxWaves: 1036893 -> 1036781 (-0.01%); split: +0.01%, -0.02%
Instrs: 21977229 -> 21884600 (-0.42%); split: -0.47%, +0.05%
CodeSize: 112680884 -> 112298404 (-0.34%); split: -0.38%, +0.04%
VGPRs: 1590832 -> 1615912 (+1.58%); split: -0.25%, +1.83%
Latency: 142542601 -> 142670271 (+0.09%); split: -0.12%, +0.21%
InvThroughput: 19481055 -> 19434110 (-0.24%); split: -0.44%, +0.20%
VClause: 462865 -> 462558 (-0.07%); split: -0.20%, +0.13%
SClause: 619822 -> 619685 (-0.02%); split: -0.02%, +0.00%
Copies: 1704870 -> 1610889 (-5.51%); split: -5.89%, +0.38%
Branches: 518238 -> 518241 (+0.00%); split: -0.01%, +0.01%
VALU: 12230157 -> 12136112 (-0.77%); split: -0.82%, +0.05%
SALU: 2444075 -> 2444099 (+0.00%); split: -0.01%, +0.01%
VOPD: 3443 -> 3476 (+0.96%); split: +1.80%, -0.84%
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11186
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31346 >
2024-10-03 17:55:56 +00:00
Rhys Perry
1e60509135
aco: stop using instructions in ra_ctx::vectors
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31346 >
2024-10-03 17:55:56 +00:00
Georg Lehmann
8a43b1e7da
aco/ra: do not reuse killed vcc
...
VCC should only be used if nessecary, to keep it free for instructions
that need/prefer it.
Foz-DB Navi31:
Totals from 132 (0.17% of 79395) affected shaders:
Instrs: 832538 -> 832608 (+0.01%); split: -0.03%, +0.04%
CodeSize: 4310888 -> 4301792 (-0.21%); split: -0.22%, +0.01%
Latency: 6238465 -> 6239198 (+0.01%); split: -0.04%, +0.05%
InvThroughput: 5332353 -> 5336363 (+0.08%); split: -0.03%, +0.10%
Copies: 59420 -> 59392 (-0.05%); split: -0.11%, +0.06%
VALU: 459318 -> 459187 (-0.03%); split: -0.03%, +0.00%
SALU: 109208 -> 109081 (-0.12%); split: -0.14%, +0.03%
VOPD: 6426 -> 6557 (+2.04%); split: +2.10%, -0.06%
Foz-DB Navi21:
Totals from 386 (0.49% of 79395) affected shaders:
Instrs: 3254046 -> 3252423 (-0.05%); split: -0.05%, +0.00%
CodeSize: 17839104 -> 17680580 (-0.89%); split: -0.89%, +0.00%
Latency: 24424322 -> 24426242 (+0.01%); split: -0.01%, +0.01%
InvThroughput: 10140681 -> 10143882 (+0.03%); split: -0.01%, +0.04%
SClause: 80731 -> 80738 (+0.01%); split: -0.01%, +0.02%
Copies: 293719 -> 293593 (-0.04%); split: -0.27%, +0.23%
Branches: 126625 -> 126626 (+0.00%); split: -0.00%, +0.00%
VALU: 2086026 -> 2086029 (+0.00%)
SALU: 502641 -> 501012 (-0.32%); split: -0.33%, +0.00%
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30902 >
2024-09-09 19:48:22 +00:00
Rhys Perry
999362f895
aco: have get_subdword_definition_info update DefInfo
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30761 >
2024-09-03 21:14:27 +00:00
Rhys Perry
16ff51bb37
aco/ra: use DefInfo for get_reg_specified
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30761 >
2024-09-03 21:14:27 +00:00
Rhys Perry
1e6741bf6b
aco/ra: fix sub-dword get_reg_specified in some cases
...
For example, v6b MIMG can have sdw_def_info={4, 6}. This now has similar
behaviour as the DefInfo constructor.
fossil-db (navi31):
Totals from 5 (0.01% of 79395) affected shaders:
CodeSize: 29460 -> 29408 (-0.18%); split: -0.29%, +0.11%
Latency: 22133 -> 21934 (-0.90%); split: -2.51%, +1.61%
InvThroughput: 2953 -> 2963 (+0.34%); split: -0.03%, +0.37%
Copies: 410 -> 409 (-0.24%); split: -1.95%, +1.71%
VALU: 3242 -> 3241 (-0.03%); split: -0.25%, +0.22%
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 56345b8c61 ("aco: allow reading/writing upper halves/bytes when possible")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30761 >
2024-09-03 21:14:27 +00:00
Georg Lehmann
9bb10b58f3
aco: use v_cvt_pk_u8_f32 for f2u8
...
Foz-DB Navi31:
Totals from 42 (0.05% of 79395) affected shaders:
Instrs: 3253747 -> 3248867 (-0.15%); split: -0.15%, +0.00%
CodeSize: 16690136 -> 16661772 (-0.17%); split: -0.17%, +0.00%
VGPRs: 4176 -> 4128 (-1.15%)
Latency: 18485157 -> 18479752 (-0.03%); split: -0.03%, +0.00%
InvThroughput: 3659404 -> 3658222 (-0.03%); split: -0.03%, +0.00%
Copies: 231891 -> 228145 (-1.62%)
VALU: 1785800 -> 1782054 (-0.21%)
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29532 >
2024-09-02 19:49:20 +00:00
Daniel Schürmann
6ada0170c4
aco/ra: use arena allocator for hash maps
...
Also change Key types to uint32_t instead of unsigned.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30898 >
2024-09-02 15:31:52 +00:00
Daniel Schürmann
709f60e71d
aco/ra: use auto for std container iterators
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30898 >
2024-09-02 15:31:52 +00:00
Daniel Schürmann
534031761a
aco/ra: avoid rename map lookups in most cases
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30898 >
2024-09-02 15:31:52 +00:00
Daniel Schürmann
72464e24b4
aco/ra: add add_rename() helper
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30898 >
2024-09-02 15:31:51 +00:00
Georg Lehmann
8f3bb1fb2e
aco/ra: always reuse def register for literal copy
...
Foz-DB Vega10:
Totals from 4056 (6.43% of 63053) affected shaders:
Instrs: 5540797 -> 5540760 (-0.00%); split: -0.00%, +0.00%
CodeSize: 29680912 -> 29680812 (-0.00%); split: -0.00%, +0.00%
SGPRs: 307808 -> 307680 (-0.04%)
Latency: 82483179 -> 82484437 (+0.00%); split: -0.00%, +0.00%
InvThroughput: 45546645 -> 45547091 (+0.00%); split: -0.00%, +0.00%
SClause: 185641 -> 185648 (+0.00%); split: -0.00%, +0.01%
Copies: 642229 -> 642214 (-0.00%); split: -0.01%, +0.01%
SALU: 643132 -> 643107 (-0.00%); split: -0.01%, +0.01%
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30932 >
2024-09-02 11:09:55 +00:00
Georg Lehmann
5fb54d1fde
aco/ra: fix copying 64bit literal to sgprs
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30932 >
2024-09-02 11:09:55 +00:00
Georg Lehmann
364764356c
aco/ra: use parallelcopy to copy literal instead of s_mov
...
This can result in smaller code size.
Foz-DB Vega10:
Totals from 4745 (7.53% of 63053) affected shaders:
CodeSize: 33014176 -> 33007088 (-0.02%); split: -0.02%, +0.00%
Copies: 690055 -> 704738 (+2.13%)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30932 >
2024-09-02 11:09:55 +00:00
Georg Lehmann
607cf5a8e9
aco/ra: unconditionally replace literal with sgpr when promoting to VOP3
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30932 >
2024-09-02 11:09:55 +00:00
Daniel Schürmann
162876c875
aco/ra: use live-in variables directly rather than computing them
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30120 >
2024-07-16 14:00:49 +00:00
Georg Lehmann
cd9187a1e1
aco/ra: fix affinity for s_addk
...
The first, non SCC def matters.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: 39380d475a ("aco: add affinities for possible sopk optimizations")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29943 >
2024-07-10 13:36:00 +00:00
Daniel Schürmann
fab95c78f9
aco/ra: remove special-casing of p_logical_end
...
There is always enough registers available and this code
was broken anyway and had no effect.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29962 >
2024-07-10 12:31:02 +00:00
Daniel Schürmann
dc851c0aa6
aco/ra: use live_in_demand in should_compact_linear_vgprs()
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29962 >
2024-07-10 12:31:02 +00:00
Daniel Schürmann
a497d105e3
aco: move live var information into struct Program
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29713 >
2024-06-14 14:32:35 +00:00
Daniel Schürmann
c452a4d1cc
aco/ra: use round robin register allocation
...
Totals from 74681 (94.06% of 79395) affected shaders: (GFX11)
MaxWaves: 2265668 -> 2263546 (-0.09%); split: +0.01%, -0.10%
Instrs: 44941647 -> 44412809 (-1.18%); split: -1.23%, +0.05%
CodeSize: 234173852 -> 232009132 (-0.92%); split: -0.97%, +0.05%
VGPRs: 3033208 -> 3403000 (+12.19%); split: -0.02%, +12.22%
Latency: 305575738 -> 301100302 (-1.46%); split: -1.70%, +0.23%
InvThroughput: 49366070 -> 49020000 (-0.70%); split: -0.91%, +0.21%
VClause: 875748 -> 854930 (-2.38%); split: -2.65%, +0.27%
SClause: 1369614 -> 1327212 (-3.10%); split: -3.43%, +0.33%
Copies: 2887932 -> 2883061 (-0.17%); split: -1.93%, +1.76%
Branches: 885041 -> 885101 (+0.01%); split: -0.01%, +0.02%
VALU: 25218078 -> 25215170 (-0.01%); split: -0.20%, +0.19%
SALU: 4328640 -> 4326052 (-0.06%); split: -0.20%, +0.14%
VOPD: 9129 -> 9611 (+5.28%); split: +7.48%, -2.20%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29235 >
2024-06-06 21:02:15 +00:00
Daniel Schürmann
197943ae27
aco/ra: change heuristic to first fit
...
Totals from 73175 (92.17% of 79395) affected shaders: (GFX11)
MaxWaves: 2217690 -> 2217930 (+0.01%); split: +0.02%, -0.01%
Instrs: 44780731 -> 44784895 (+0.01%); split: -0.14%, +0.15%
CodeSize: 233238960 -> 233255604 (+0.01%); split: -0.11%, +0.12%
VGPRs: 3009116 -> 3007684 (-0.05%); split: -0.29%, +0.24%
Latency: 304320163 -> 304286592 (-0.01%); split: -0.31%, +0.30%
InvThroughput: 49121992 -> 49145025 (+0.05%); split: -0.20%, +0.25%
VClause: 872566 -> 873242 (+0.08%); split: -0.25%, +0.33%
SClause: 1359666 -> 1361640 (+0.15%); split: -0.11%, +0.26%
Copies: 2879649 -> 2881646 (+0.07%); split: -1.13%, +1.20%
Branches: 887102 -> 887093 (-0.00%); split: -0.01%, +0.01%
VALU: 25128240 -> 25128572 (+0.00%); split: -0.12%, +0.12%
SALU: 4328852 -> 4330559 (+0.04%); split: -0.07%, +0.11%
VOPD: 8861 -> 8992 (+1.48%); split: +2.63%, -1.15%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29235 >
2024-06-06 21:02:15 +00:00
Daniel Schürmann
d76fc005b6
aco/ra: re-use registers from killed operands
...
Totals from 77283 (97.34% of 79395) affected shaders: (GFX11)
MaxWaves: 2348498 -> 2348250 (-0.01%); split: +0.01%, -0.02%
Instrs: 45304558 -> 45097367 (-0.46%); split: -0.57%, +0.11%
CodeSize: 235719656 -> 234957768 (-0.32%); split: -0.43%, +0.11%
VGPRs: 3065984 -> 3073244 (+0.24%); split: -0.41%, +0.65%
Latency: 308010576 -> 307008565 (-0.33%); split: -0.85%, +0.52%
InvThroughput: 49560307 -> 49464214 (-0.19%); split: -0.54%, +0.34%
VClause: 881895 -> 879739 (-0.24%); split: -0.78%, +0.53%
SClause: 1388139 -> 1374634 (-0.97%); split: -1.12%, +0.14%
Copies: 2918583 -> 2910434 (-0.28%); split: -1.92%, +1.64%
Branches: 893947 -> 893712 (-0.03%); split: -0.06%, +0.03%
VALU: 25260728 -> 25256766 (-0.02%); split: -0.20%, +0.19%
SALU: 4377750 -> 4373595 (-0.09%); split: -0.17%, +0.07%
VOPD: 8603 -> 9163 (+6.51%); split: +8.54%, -2.03%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29235 >
2024-06-06 21:02:15 +00:00
Daniel Schürmann
b054cfe704
aco/ra: move can_write_m0() check into get_reg_specified()
...
This way, affinities are also covered.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29235 >
2024-06-06 21:02:15 +00:00
Daniel Schürmann
8e817cf52b
aco/ra: refactor get_reg_simple() with increased stride.
...
This should avoid some redundant calls.
Totals from 153 (0.19% of 79395) affected shaders: (GFX11)
Instrs: 301717 -> 301687 (-0.01%); split: -0.06%, +0.05%
CodeSize: 1583080 -> 1582988 (-0.01%); split: -0.06%, +0.05%
VGPRs: 10068 -> 10348 (+2.78%)
Latency: 6685446 -> 6685475 (+0.00%); split: -0.11%, +0.11%
InvThroughput: 999241 -> 999316 (+0.01%); split: -0.01%, +0.02%
VClause: 3868 -> 3870 (+0.05%)
Copies: 23752 -> 23769 (+0.07%); split: -0.27%, +0.34%
Branches: 6479 -> 6480 (+0.02%)
VALU: 179290 -> 179307 (+0.01%); split: -0.04%, +0.04%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29235 >
2024-06-06 21:02:15 +00:00