mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-26 06:50:37 +02:00
aco/optimizer: add less agressive pattern matching option
Still a bit more aggresive than the classic is_used_once, but it should still prevent most regressions for patterns that use min/max/mul as outer instruction. Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38150>
This commit is contained in:
parent
2c05aa34aa
commit
5d02eae052
1 changed files with 8 additions and 0 deletions
|
|
@ -3288,6 +3288,11 @@ struct combine_instr_pattern {
|
|||
unsigned operand_mask;
|
||||
const char* swizzle;
|
||||
combine_instr_callback callback;
|
||||
|
||||
/* Limit to pattern matching to avoid unlike combining for instructions
|
||||
* that might be used as src_opcode for other patterns.
|
||||
*/
|
||||
bool less_aggressive;
|
||||
};
|
||||
|
||||
bool
|
||||
|
|
@ -3372,6 +3377,9 @@ match_and_apply_patterns(opt_ctx& ctx, alu_opt_info& info,
|
|||
op_instr.opcode != pattern.src_opcode)
|
||||
continue;
|
||||
|
||||
if (pattern.less_aggressive && ctx.uses[tmp.id()] > ctx.uses[info.defs[0].tempId()])
|
||||
continue;
|
||||
|
||||
alu_opt_info new_info = info;
|
||||
|
||||
unsigned rem = info.operands.size() - 1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue