r300: Move the instruction filter for r500_transform_IF() to the top.

rc_get_variables() is slow, don't call it if we're going to just exit
immediately anyway.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14117>
(cherry picked from commit 42e8f48be7)
This commit is contained in:
Emma Anholt 2021-12-07 10:56:42 -08:00 committed by Eric Engestrom
parent d4bbc1261f
commit 94449816ab
2 changed files with 4 additions and 5 deletions

View file

@ -4567,7 +4567,7 @@
"description": "r300: Move the instruction filter for r500_transform_IF() to the top.",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -44,16 +44,15 @@ int r500_transform_IF(
struct rc_instruction * inst_if,
void *data)
{
if (inst_if->U.I.Opcode != RC_OPCODE_IF)
return 0;
struct rc_variable * writer;
struct rc_list * writer_list, * list_ptr;
struct rc_list * var_list = rc_get_variables(c);
unsigned int generic_if = 0;
unsigned int alu_chan;
if (inst_if->U.I.Opcode != RC_OPCODE_IF) {
return 0;
}
writer_list = rc_variable_list_get_writers(
var_list, inst_if->Type, &inst_if->U.I.SrcReg[0]);
if (!writer_list) {