mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
nir: turn ssa check into an assert
Everthing should be in ssa form when this is called. Checking for it here is expensive so turn this into an assert instead. Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
This commit is contained in:
parent
0a89c9779a
commit
46a4d2c867
1 changed files with 11 additions and 3 deletions
|
|
@ -498,6 +498,16 @@ dest_is_ssa(nir_dest *dest, void *data)
|
|||
return dest->is_ssa;
|
||||
}
|
||||
|
||||
static bool
|
||||
instr_each_src_and_dest_is_ssa(nir_instr *instr)
|
||||
{
|
||||
if (!nir_foreach_dest(instr, dest_is_ssa, NULL) ||
|
||||
!nir_foreach_src(instr, src_is_ssa, NULL))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* This function determines if uses of an instruction can safely be rewritten
|
||||
* to use another identical instruction instead. Note that this function must
|
||||
* be kept in sync with hash_instr() and nir_instrs_equal() -- only
|
||||
|
|
@ -509,9 +519,7 @@ static bool
|
|||
instr_can_rewrite(nir_instr *instr)
|
||||
{
|
||||
/* We only handle SSA. */
|
||||
if (!nir_foreach_dest(instr, dest_is_ssa, NULL) ||
|
||||
!nir_foreach_src(instr, src_is_ssa, NULL))
|
||||
return false;
|
||||
assert(instr_each_src_and_dest_is_ssa(instr));
|
||||
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_alu:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue