mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
pan/mdg: Fix 2-const CSEL at block beginning
mir_prev_op will point to the last instruction of the block in that case because the block instruction list is circular. That would cause an invald write-after-read relationship between the move we insert with the constants and the CSEL reading them, which DCE "helpfully" optimizes out, leaving a read from an undefined def. That ends up getting RA'd to an invalid register. All in all, pretty bad. Identified due to a new assert fail after the proper temp_count fix. Affects dEQP-GLES31.functional.separate_shader.random.12. No shader-db changes. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Italo Nicola <italonicola@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23769>
This commit is contained in:
parent
b66b122e03
commit
7da1e4c326
1 changed files with 11 additions and 2 deletions
|
|
@ -2471,8 +2471,17 @@ inline_alu_constants(compiler_context *ctx, midgard_block *block)
|
|||
/* Set the source */
|
||||
alu->src[1] = scratch;
|
||||
|
||||
/* Inject us -before- the last instruction which set r31 */
|
||||
mir_insert_instruction_before(ctx, mir_prev_op(alu), ins);
|
||||
/* Inject us -before- the last instruction which set r31, if
|
||||
* possible.
|
||||
*/
|
||||
midgard_instruction *first = list_first_entry(
|
||||
&block->base.instructions, midgard_instruction, link);
|
||||
|
||||
if (alu == first) {
|
||||
mir_insert_instruction_before(ctx, alu, ins);
|
||||
} else {
|
||||
mir_insert_instruction_before(ctx, mir_prev_op(alu), ins);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue