v3d: Stop treating exec masking specially.
In our backend, the successor edges from the blocks only point to where QPU control flow goes, not where the notional control flow goes from a "break" or "continue" modifying the execution mask to resume writing to some channels later. As a result, this attempt at restricting live ranges ended up missing the live range of a value where a conditional break/continue was present in a loop before the later def of a variable. The previous commit ended up fixing the problem that the flag tried to solve. Fixes glsl-vs-loop-continue.shader_test and/or glsl-vs-loop-redundant-condition.shader_test based on register allocation results.
This commit is contained in:
@@ -405,7 +405,6 @@ ntq_store_dest(struct v3d_compile *c, nir_dest *dest, int chan,
|
||||
c->cursor = vir_after_inst(last_inst);
|
||||
|
||||
vir_set_cond(last_inst, V3D_QPU_COND_IFA);
|
||||
last_inst->cond_is_exec_mask = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,6 @@ struct qinst {
|
||||
/* Pre-register-allocation references to src/dst registers */
|
||||
struct qreg dst;
|
||||
struct qreg src[3];
|
||||
bool cond_is_exec_mask;
|
||||
bool has_implicit_uniform;
|
||||
bool is_last_thrsw;
|
||||
|
||||
|
||||
@@ -118,18 +118,9 @@ vir_setup_def(struct v3d_compile *c, struct qblock *block, int ip,
|
||||
if (BITSET_TEST(block->use, var) || BITSET_TEST(block->def, var))
|
||||
return;
|
||||
|
||||
/* Easy, common case: unconditional full register update.
|
||||
*
|
||||
* We treat conditioning on the exec mask as the same as not being
|
||||
* conditional. This makes sure that if the register gets set on
|
||||
* either side of an if, it is treated as being screened off before
|
||||
* the if. Otherwise, if there was no intervening def, its live
|
||||
* interval doesn't extend back to the start of he program, and if too
|
||||
* many registers did that we'd fail to register allocate.
|
||||
*/
|
||||
if (((inst->qpu.flags.ac == V3D_QPU_COND_NONE &&
|
||||
inst->qpu.flags.mc == V3D_QPU_COND_NONE) ||
|
||||
inst->cond_is_exec_mask) &&
|
||||
/* Easy, common case: unconditional full register update.*/
|
||||
if ((inst->qpu.flags.ac == V3D_QPU_COND_NONE &&
|
||||
inst->qpu.flags.mc == V3D_QPU_COND_NONE) &&
|
||||
inst->qpu.alu.add.output_pack == V3D_QPU_PACK_NONE &&
|
||||
inst->qpu.alu.mul.output_pack == V3D_QPU_PACK_NONE) {
|
||||
BITSET_SET(block->def, var);
|
||||
|
||||
Reference in New Issue
Block a user