From 308f56ef82242154e80f984cc5bcee71bbf29c02 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Mon, 10 Mar 2025 16:08:31 -0700 Subject: [PATCH] brw: Add missing dependency classes to various passes - brw_lower_3src_null_dest: Allocating a new destination, so include INSTRUCTION_DATA_FLOW class. - brw_lower_alu_restriction: Removing instruction, so include INSTRUCTION_IDENTITY. No details are changed so remove INSTRUCTION_DETAIL. - brw_lower_vgrfs_to_fixed_grfs: Changing source and destination numbers, so include INSTRUCTION_DETAIL. - brw_lower_send_gather: Insert new instructions (scalar register) and change sources and other information on existing ones. So include INSTRUCTION_DETAIL and INSTRUCTION_IDENTITY. Promote to INSTRUCTIONS. - brw_opt_eliminate_find_live_channel: Can change source, so include INSTRUCTION_DATA_FLOW. - brw_opt_copy_propagation_defs and brw_opt_cse_defs: Both can remove instructions, so include INSTRUCTION_IDENTITY. Promote to INSTRUCTIONS. - brw_opt_saturate_propagation: Instruction can have `sat` modified, and operands can have type modified, so include INSTRUCTION_DETAIL. Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_lower.cpp | 8 +++++--- src/intel/compiler/brw_opt.cpp | 3 ++- src/intel/compiler/brw_opt_copy_propagation.cpp | 3 +-- src/intel/compiler/brw_opt_cse.cpp | 3 +-- src/intel/compiler/brw_opt_saturate_propagation.cpp | 3 ++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/intel/compiler/brw_lower.cpp b/src/intel/compiler/brw_lower.cpp index 6af97b44e5d..ee29dc14b10 100644 --- a/src/intel/compiler/brw_lower.cpp +++ b/src/intel/compiler/brw_lower.cpp @@ -575,7 +575,8 @@ brw_lower_3src_null_dest(brw_shader &s) } if (progress) - s.invalidate_analysis(BRW_DEPENDENCY_INSTRUCTION_DETAIL | + s.invalidate_analysis(BRW_DEPENDENCY_INSTRUCTION_DATA_FLOW | + BRW_DEPENDENCY_INSTRUCTION_DETAIL | BRW_DEPENDENCY_VARIABLES); return progress; @@ -662,7 +663,7 @@ brw_lower_alu_restrictions(brw_shader &s) if (progress) { s.invalidate_analysis(BRW_DEPENDENCY_INSTRUCTION_DATA_FLOW | - BRW_DEPENDENCY_INSTRUCTION_DETAIL); + BRW_DEPENDENCY_INSTRUCTION_IDENTITY); } return progress; @@ -758,6 +759,7 @@ brw_lower_vgrfs_to_fixed_grfs(brw_shader &s) } s.invalidate_analysis(BRW_DEPENDENCY_INSTRUCTION_DATA_FLOW | + BRW_DEPENDENCY_INSTRUCTION_DETAIL | BRW_DEPENDENCY_VARIABLES); } @@ -841,7 +843,7 @@ brw_lower_send_gather(brw_shader &s) } if (progress) - s.invalidate_analysis(BRW_DEPENDENCY_INSTRUCTION_DATA_FLOW | + s.invalidate_analysis(BRW_DEPENDENCY_INSTRUCTIONS | BRW_DEPENDENCY_VARIABLES); return progress; diff --git a/src/intel/compiler/brw_opt.cpp b/src/intel/compiler/brw_opt.cpp index a09c4b2cc6a..dca507cdc89 100644 --- a/src/intel/compiler/brw_opt.cpp +++ b/src/intel/compiler/brw_opt.cpp @@ -515,7 +515,8 @@ brw_opt_eliminate_find_live_channel(brw_shader &s) out: if (progress) - s.invalidate_analysis(BRW_DEPENDENCY_INSTRUCTION_DETAIL); + s.invalidate_analysis(BRW_DEPENDENCY_INSTRUCTION_DATA_FLOW | + BRW_DEPENDENCY_INSTRUCTION_DETAIL); return progress; } diff --git a/src/intel/compiler/brw_opt_copy_propagation.cpp b/src/intel/compiler/brw_opt_copy_propagation.cpp index 49961a76753..d8cdeb30b88 100644 --- a/src/intel/compiler/brw_opt_copy_propagation.cpp +++ b/src/intel/compiler/brw_opt_copy_propagation.cpp @@ -1926,8 +1926,7 @@ brw_opt_copy_propagation_defs(brw_shader &s) if (progress) { s.cfg->adjust_block_ips(); - s.invalidate_analysis(BRW_DEPENDENCY_INSTRUCTION_DATA_FLOW | - BRW_DEPENDENCY_INSTRUCTION_DETAIL); + s.invalidate_analysis(BRW_DEPENDENCY_INSTRUCTIONS); } delete [] uses_deleted; diff --git a/src/intel/compiler/brw_opt_cse.cpp b/src/intel/compiler/brw_opt_cse.cpp index b5a123946e9..8c167c1a3e6 100644 --- a/src/intel/compiler/brw_opt_cse.cpp +++ b/src/intel/compiler/brw_opt_cse.cpp @@ -508,8 +508,7 @@ out: if (progress) { s.cfg->adjust_block_ips(); - s.invalidate_analysis(BRW_DEPENDENCY_INSTRUCTION_DATA_FLOW | - BRW_DEPENDENCY_INSTRUCTION_DETAIL); + s.invalidate_analysis(BRW_DEPENDENCY_INSTRUCTIONS); } return progress; diff --git a/src/intel/compiler/brw_opt_saturate_propagation.cpp b/src/intel/compiler/brw_opt_saturate_propagation.cpp index 0ad9a031535..ed8175ddfb0 100644 --- a/src/intel/compiler/brw_opt_saturate_propagation.cpp +++ b/src/intel/compiler/brw_opt_saturate_propagation.cpp @@ -196,7 +196,8 @@ brw_opt_saturate_propagation(brw_shader &s) progress = opt_saturate_propagation_local(s, block) || progress; } - /* Live intervals are still valid. */ + if (progress) + s.invalidate_analysis(BRW_DEPENDENCY_INSTRUCTION_DETAIL); return progress; }