broadcom/compiler: ldvary pipelining tracking and documentation clean-ups
Now that we can pipeline all varyings we should not be referring specifically to smooth varyings anywhere. Also, rename the instruction field 'ldvary_pipelining' to 'is_ldvary_sequence', which is more appropriate, since we always set this for any instruction involved with varying setups, independently of whether they end up being pipelined or not. This also does some other minor edits which intend to slightly simplify the code and make it a bit more compact. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9363>
This commit is contained in:
@@ -927,7 +927,7 @@ ldvary_sequence_inst(struct v3d_compile *c, struct qreg result)
|
||||
struct qinst *producer =
|
||||
(struct qinst *) c->cur_block->instructions.prev;
|
||||
assert(producer);
|
||||
producer->ldvary_pipelining = true;
|
||||
producer->is_ldvary_sequence = true;
|
||||
c->ldvary_sequence_end_inst = producer;
|
||||
return result;
|
||||
}
|
||||
@@ -936,8 +936,8 @@ static void
|
||||
track_ldvary_pipelining(struct v3d_compile *c, struct qinst *ldvary)
|
||||
{
|
||||
if (ldvary) {
|
||||
ldvary->is_ldvary_sequence = true;
|
||||
c->ldvary_sequence_length++;
|
||||
ldvary->ldvary_pipelining = true;
|
||||
if (c->ldvary_sequence_length == 1) {
|
||||
ldvary->ldvary_pipelining_start = true;
|
||||
c->ldvary_sequence_start_inst = ldvary;
|
||||
@@ -976,7 +976,7 @@ emit_flat_varying(struct v3d_compile *c,
|
||||
}
|
||||
|
||||
static void
|
||||
break_smooth_varying_sequence(struct v3d_compile *c)
|
||||
varying_sequence_end(struct v3d_compile *c)
|
||||
{
|
||||
if (!c->ldvary_sequence_start_inst) {
|
||||
assert(!c->ldvary_sequence_end_inst);
|
||||
@@ -988,7 +988,7 @@ break_smooth_varying_sequence(struct v3d_compile *c)
|
||||
assert(c->ldvary_sequence_end_inst);
|
||||
assert(c->ldvary_sequence_start_inst != c->ldvary_sequence_end_inst);
|
||||
|
||||
/* We need at least two smooth ldvary sequences to do some pipelining */
|
||||
/* We need at least two ldvary sequences to do some pipelining */
|
||||
if (c->ldvary_sequence_length == 1)
|
||||
c->ldvary_sequence_start_inst->ldvary_pipelining_start = false;
|
||||
|
||||
@@ -2100,7 +2100,7 @@ ntq_setup_fs_inputs(struct v3d_compile *c)
|
||||
}
|
||||
}
|
||||
|
||||
break_smooth_varying_sequence(c);
|
||||
varying_sequence_end(c);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -892,11 +892,11 @@ choose_instruction_to_schedule(const struct v3d_device_info *devinfo,
|
||||
|
||||
list_for_each_entry(struct schedule_node, n, &scoreboard->dag->heads,
|
||||
dag.link) {
|
||||
/* If we are scheduling a pipelined smooth varying sequence then
|
||||
/* If we are scheduling a pipelined varying sequence then
|
||||
* we want to pick up the next instruction in the sequence.
|
||||
*/
|
||||
if (scoreboard->ldvary_pipelining &&
|
||||
!n->inst->ldvary_pipelining) {
|
||||
!n->inst->is_ldvary_sequence) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1001,7 +1001,7 @@ choose_instruction_to_schedule(const struct v3d_device_info *devinfo,
|
||||
* pipelining the new sequence into the previous one.
|
||||
*/
|
||||
if (scoreboard->ldvary_pipelining && inst->sig.ldvary) {
|
||||
assert(n->inst->ldvary_pipelining);
|
||||
assert(n->inst->is_ldvary_sequence);
|
||||
scoreboard->fixup_ldvary = true;
|
||||
return n;
|
||||
}
|
||||
@@ -1066,16 +1066,15 @@ choose_instruction_to_schedule(const struct v3d_device_info *devinfo,
|
||||
* continue the sequence.
|
||||
*/
|
||||
if (scoreboard->ldvary_pipelining && !prev_inst && !chosen) {
|
||||
bool prev_ldvary_pipelining = scoreboard->ldvary_pipelining;
|
||||
scoreboard->ldvary_pipelining = false;
|
||||
chosen = choose_instruction_to_schedule(devinfo, scoreboard, prev_inst);
|
||||
if (!chosen)
|
||||
scoreboard->ldvary_pipelining = prev_ldvary_pipelining;
|
||||
chosen = choose_instruction_to_schedule(devinfo, scoreboard,
|
||||
prev_inst);
|
||||
scoreboard->ldvary_pipelining = !chosen;
|
||||
} else if (chosen) {
|
||||
if (scoreboard->ldvary_pipelining) {
|
||||
assert(chosen->inst->ldvary_pipelining);
|
||||
if (chosen->inst->ldvary_pipelining_end)
|
||||
scoreboard->ldvary_pipelining = false;
|
||||
assert(chosen->inst->is_ldvary_sequence);
|
||||
scoreboard->ldvary_pipelining =
|
||||
!chosen->inst->ldvary_pipelining_end;
|
||||
} else if (chosen->inst->ldvary_pipelining_start) {
|
||||
assert(chosen->inst->qpu.sig.ldvary);
|
||||
scoreboard->ldvary_pipelining = true;
|
||||
@@ -1732,8 +1731,9 @@ schedule_instructions(struct v3d_compile *c,
|
||||
if (fixup_pipelined_ldvary(c, scoreboard, block, inst)) {
|
||||
/* Flag the ldvary as scheduled
|
||||
* now so we can try to merge the
|
||||
* follow-up fmul into the current
|
||||
* instruction.
|
||||
* follow-up instruction in the
|
||||
* the ldvary sequence into the
|
||||
* current instruction.
|
||||
*/
|
||||
mark_instruction_scheduled(
|
||||
devinfo, scoreboard->dag,
|
||||
|
@@ -163,16 +163,14 @@ struct qinst {
|
||||
*/
|
||||
int uniform;
|
||||
|
||||
/* Set if this instruction participates in a pipelinable sequence of
|
||||
* smooth varyings.
|
||||
*/
|
||||
bool ldvary_pipelining;
|
||||
/* Set if this is the ldvary instruction starting a pipelinable
|
||||
* sequence of smooth varyings.
|
||||
/* Set if this instruction participates in a varying setup. */
|
||||
bool is_ldvary_sequence;
|
||||
/* Set if this is the ldvary instruction starting a sequence of
|
||||
* varyings we want to pipeline.
|
||||
*/
|
||||
bool ldvary_pipelining_start;
|
||||
/* Set if this is the fadd instruction ending a pipelinable
|
||||
* sequence of smooth varyings.
|
||||
/* Set if this is the last instruction involved with a pipelineable
|
||||
* varying sequence.
|
||||
*/
|
||||
bool ldvary_pipelining_end;
|
||||
};
|
||||
@@ -782,7 +780,7 @@ struct v3d_compile {
|
||||
uint32_t program_id;
|
||||
uint32_t variant_id;
|
||||
|
||||
/* Used to track pipelinable sequences of smooth varyings */
|
||||
/* Used to track pipelinable sequences of varyings */
|
||||
struct qinst *ldvary_sequence_start_inst;
|
||||
struct qinst *ldvary_sequence_end_inst;
|
||||
uint32_t ldvary_sequence_length;
|
||||
|
Reference in New Issue
Block a user