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
Daniel Schürmann
1b0edf3f33
aco/ra: Fix array access when finding register for subdword variables
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29235 >
2024-06-06 21:02:15 +00:00
Daniel Schürmann
5326e033ff
aco/ra: fix handling of killed operands in compact_relocate_vars()
...
Found by inspection.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29235 >
2024-06-06 21:02:14 +00:00
Georg Lehmann
3fb1a64918
aco: move s_add_u32 -> s_addk_i32 optimization fully to ra
...
Having this in one place is better.
When I wrote the old I wasn't aware that checking the kill flag on definitions
is the same as checking zero uses.
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29512 >
2024-06-06 16:28:23 +00:00
Georg Lehmann
60f3f0fdbb
aco/ra: use a switch to check vop2acc instruction support
...
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29512 >
2024-06-06 16:28:23 +00:00
Georg Lehmann
fdc2fb6835
aco: move literal unswizzle opt to RA
...
Much simpler.
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29512 >
2024-06-06 16:28:23 +00:00
Georg Lehmann
c63c750380
aco/gfx11+: fix inline constants for v_pk_fmac_f16
...
On newer hardware, the hi operation reads the lo half of the inline constant.
On older hardware, it reads the hi half (zero).
I tested this on Navi31 for gfx11 and Raphael for gfx10.
Foz-DB Navi31:
Totals from 4 (0.01% of 79395) affected shaders:
CodeSize: 36832 -> 36448 (-1.04%)
Latency: 20362 -> 20334 (-0.14%)
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29512 >
2024-06-06 16:28:23 +00:00
Georg Lehmann
39380d475a
aco: add affinities for possible sopk optimizations
...
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29512 >
2024-06-06 16:28:23 +00:00
Georg Lehmann
fac475bc25
aco: rework how affinities for acc operands are determined
...
Improve accuracy by adding a helper that's also used by
the optimization function.
Foz-DB Navi31:
Totals from 50 (0.06% of 79206) affected shaders:
CodeSize: 126148 -> 126128 (-0.02%); split: -0.05%, +0.04%
Latency: 334049 -> 334060 (+0.00%); split: -0.00%, +0.00%
InvThroughput: 59203 -> 59205 (+0.00%)
Copies: 2011 -> 1998 (-0.65%); split: -0.75%, +0.10%
VALU: 14221 -> 14208 (-0.09%); split: -0.11%, +0.01%
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29512 >
2024-06-06 16:28:23 +00:00
Rhys Perry
de07fd384d
aco/gfx12: disallow SCC and most constants for BUF SOFFSET
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29330 >
2024-05-28 10:52:11 +00:00
Rhys Perry
b1b3237590
aco/gfx12: remove MIMG vector affinity
...
Since GFX12 uses NSA unconditionally, there is no code size advantage to
avoiding it.
fossil-db (gfx1200):
Totals from 41700 (52.52% of 79395) affected shaders:
MaxWaves: 1063633 -> 1063623 (-0.00%); split: +0.00%, -0.00%
Instrs: 32745913 -> 32736332 (-0.03%); split: -0.10%, +0.07%
CodeSize: 177664256 -> 177623280 (-0.02%); split: -0.08%, +0.06%
VGPRs: 1668640 -> 1665280 (-0.20%); split: -0.26%, +0.06%
Latency: 248630176 -> 248803989 (+0.07%); split: -0.23%, +0.30%
InvThroughput: 51923793 -> 51958560 (+0.07%); split: -0.15%, +0.22%
VClause: 633381 -> 633594 (+0.03%); split: -0.31%, +0.34%
SClause: 1090207 -> 1090206 (-0.00%); split: -0.02%, +0.02%
Copies: 2042437 -> 2040188 (-0.11%); split: -0.53%, +0.42%
Branches: 680437 -> 680416 (-0.00%); split: -0.01%, +0.01%
VALU: 19387160 -> 19384917 (-0.01%); split: -0.06%, +0.04%
SALU: 3112590 -> 3112540 (-0.00%); split: -0.01%, +0.00%
VOPD: 5474 -> 5527 (+0.97%); split: +2.87%, -1.90%
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29330 >
2024-05-28 10:52:11 +00:00
Rhys Perry
c8123b67e0
aco/gfx12: don't create v_fmac_legacy_f32
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29330 >
2024-05-28 10:52:11 +00:00