aco: don't consider a phi trivial if same's register doesn't match the def

For example:
 s2: %688:s[32-33] = p_linear_phi %3:s[10-11], %688:s[32-33]
would have been considered trivial.

This might happen due to parallelcopies when assigning phi registers.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 69b6069dd2 ("aco: refactor try_remove_trivial_phi() in RA")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8645>
(cherry picked from commit 824eba2148)
This commit is contained in:
Rhys Perry 2021-01-22 10:47:19 +00:00 committed by Dylan Baker
parent 127e9ef456
commit 613251e851
2 changed files with 2 additions and 2 deletions

View file

@ -202,7 +202,7 @@
"description": "aco: don't consider a phi trivial if same's register doesn't match the def",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "69b6069dd288455cdb2655284c592a85d17df273"
},

View file

@ -1675,7 +1675,7 @@ void try_remove_trivial_phi(ra_ctx& ctx, Temp temp)
assert(t == same || op.physReg() == def.physReg());
continue;
}
if (same != Temp())
if (same != Temp() || op.physReg() != def.physReg())
return;
same = t;