Commit graph

13 commits

Author SHA1 Message Date
Ian Romanick
1d485cc84f brw/copy: Allow constant propagation of some 64-bit integers
ADD, ASR, SHL, and SHR can mix D or UD sources with Q or UQ sources on
Gfx20. If the constant will fit in 32-bits, the type is changed so the
propagation can occur.

No shader-db changes on any Intel platform. No fossil-db changes on
any Intel platform other than Lunar Lake.

Lunar Lake
Totals:
Instrs: 210778940 -> 209472782 (-0.62%); split: -0.63%, +0.01%
Subgroup size: 14226752 -> 14227232 (+0.00%)
Cycle count: 30614834794 -> 30573250444 (-0.14%); split: -0.26%, +0.12%
Spill count: 507788 -> 504153 (-0.72%); split: -1.17%, +0.45%
Fill count: 622824 -> 613848 (-1.44%); split: -1.96%, +0.52%
Scratch Memory Size: 35826688 -> 35309568 (-1.44%); split: -1.67%, +0.23%
Max live registers: 65506213 -> 65434861 (-0.11%)

Totals from 126699 (17.93% of 706470) affected shaders:
Instrs: 63615321 -> 62309163 (-2.05%); split: -2.09%, +0.04%
Subgroup size: 2618160 -> 2618640 (+0.02%)
Cycle count: 3141888676 -> 3100304326 (-1.32%); split: -2.52%, +1.19%
Spill count: 454315 -> 450680 (-0.80%); split: -1.31%, +0.51%
Fill count: 533584 -> 524608 (-1.68%); split: -2.29%, +0.61%
Scratch Memory Size: 32182272 -> 31665152 (-1.61%); split: -1.86%, +0.26%
Max live registers: 14773917 -> 14702565 (-0.48%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33049>
2025-02-11 08:44:33 +00:00
Ian Romanick
6d594196a6 brw/copy: Use extract_imm in try_constant_propagate_value
This is just a small refactor.

Originally there was an extra commit on top of this. That commit didn't
help generated code quality, so it was dropped.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33049>
2025-02-11 08:44:33 +00:00
Ian Romanick
ac4b93571c brw/copy: Fix handling of offset in extract_imm
The offset is measured in bytes. Some of the code here acted as though
it were measured in src.type units. Also modify the assertion to check
that all extracted bits come from data in the immediate value.

Fixes: 580e1c592d ("intel/brw: Introduce a new SSA-based copy propagation pass")
Fixes: da395e6985 ("intel/brw: Fix extract_imm for subregion reads of 64-bit immediates")

Yes, I missed this error *twice* in code review.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33049>
2025-02-11 08:44:33 +00:00
Caio Oliveira
5c717e68ce intel/brw: Pass fs_visitor around instead of the simple_allocator
In preparation for getting rid of the simple_allocator.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33334>
2025-02-06 08:33:03 -08:00
Caio Oliveira
ea87bab4ce intel/brw: Remove 'using namespace brw' directives
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33418>
2025-02-06 07:58:55 -08:00
Caio Oliveira
1ade9a05d8 intel/brw: Use brw prefix instead of namespace for analysis implementations
Also drop the 'fs' prefix when applicable.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33048>
2025-02-05 21:47:07 +00:00
Caio Oliveira
2b92eb0b2c intel/brw: Use brw prefix instead of namespace for dep analysis enum
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33048>
2025-02-05 21:47:07 +00:00
Caio Oliveira
e0614e8ea1 intel/brw: Use brw_analysis prefix for liveness analysis files
Move declaration to the common header and rename definition file.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33048>
2025-02-05 21:47:06 +00:00
Caio Oliveira
d59bd421a2 intel/brw: Rename fs_inst to brw_inst
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33114>
2025-01-31 00:57:21 +00:00
Caio Oliveira
0b310ae4d8 intel/brw: Rename fs_generator to brw_generator
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32844>
2025-01-17 00:04:41 +00:00
Caio Oliveira
faf4c35b74 intel/compiler: Use linear allocator for ACP trees in copy-prop
Replace usage of variable length array.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Antonio Ospite <None>
Reviewed-by: Kenneth Graunke <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32916>
2025-01-10 07:05:35 +00:00
Caio Oliveira
e1aebf8a0c intel/brw: Remove 'fs' prefix from passes and related functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32813>
2025-01-02 18:11:05 +00:00
Caio Oliveira
25384dccc0 intel/brw: Remove 'fs' prefix from passes filenames
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32813>
2025-01-02 18:11:05 +00:00
Renamed from src/intel/compiler/brw_fs_copy_propagation.cpp (Browse further)