mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 17:10:11 +01:00
intel/fs: Always do opt_algebraic after opt_copy_propagation makes progress
opt_copy_propagation can create invalid instructions like
shl(8) vgrf96:UD, 2d, 8u
These instructions will be cleaned up by opt_algebraic. The irony is
opt_algebraic converts these to simple mov instructions that
opt_copy_propagation should clean up. I don't think we want a loop like
do {
progress = false;
if (OPT(opt_copy_propagation)) {
OPT(opt_algebraic);
OPT(dead_code_eliminate);
}
} while (progress);
But maybe we do?
Maybe this would be sufficient:
while (OPT(opt_copy_propagation))
OPT(opt_algebraic);
OPT(dead_code_eliminate);
No shader-db or fossil-db changes (yet) on any Intel platform. This is
expected.
v2: Do opt_algebraic immediately after every call to
opt_copy_propagation instead of being clever. Suggested by Lionel.
Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 56e6186dcf)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25377>
This commit is contained in:
parent
6395f22216
commit
201782d0fa
1 changed files with 10 additions and 5 deletions
|
|
@ -6150,12 +6150,15 @@ fs_visitor::optimize()
|
|||
OPT(fixup_nomask_control_flow);
|
||||
|
||||
if (progress) {
|
||||
OPT(opt_copy_propagation);
|
||||
if (OPT(opt_copy_propagation))
|
||||
OPT(opt_algebraic);
|
||||
|
||||
/* Only run after logical send lowering because it's easier to implement
|
||||
* in terms of physical sends.
|
||||
*/
|
||||
if (OPT(opt_zero_samples))
|
||||
OPT(opt_copy_propagation);
|
||||
if (OPT(opt_zero_samples) && OPT(opt_copy_propagation))
|
||||
OPT(opt_algebraic);
|
||||
|
||||
/* Run after logical send lowering to give it a chance to CSE the
|
||||
* LOAD_PAYLOAD instructions created to construct the payloads of
|
||||
* e.g. texturing messages in cases where it wasn't possible to CSE the
|
||||
|
|
@ -6197,7 +6200,8 @@ fs_visitor::optimize()
|
|||
if (devinfo->ver <= 5 && OPT(lower_minmax)) {
|
||||
OPT(opt_cmod_propagation);
|
||||
OPT(opt_cse);
|
||||
OPT(opt_copy_propagation);
|
||||
if (OPT(opt_copy_propagation))
|
||||
OPT(opt_algebraic);
|
||||
OPT(dead_code_eliminate);
|
||||
}
|
||||
|
||||
|
|
@ -6205,7 +6209,8 @@ fs_visitor::optimize()
|
|||
OPT(lower_derivatives);
|
||||
OPT(lower_regioning);
|
||||
if (progress) {
|
||||
OPT(opt_copy_propagation);
|
||||
if (OPT(opt_copy_propagation))
|
||||
OPT(opt_algebraic);
|
||||
OPT(dead_code_eliminate);
|
||||
OPT(lower_simd_width);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue