mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 00:00:12 +01:00
r300: assert that every writer has a reader
Dead writes can lead to problems with regalloc, so add a safety assert to catch such cases in the vertex shaders at least in the meantime. Additionally we could think there are no readers due to some shortcoming of out dataflow analysis or some other bug which we would also like to know about. Reviewed-by: Filip Gawin <filip.gawin@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23927>
This commit is contained in:
parent
5716700bbf
commit
b392d3ac27
1 changed files with 13 additions and 1 deletions
|
|
@ -401,7 +401,19 @@ struct rc_list * rc_get_variables(struct radeon_compiler * c)
|
|||
memset(&reader_data, 0, sizeof(reader_data));
|
||||
rc_get_readers(c, inst, &reader_data, NULL, NULL, NULL);
|
||||
if (reader_data.ReaderCount == 0) {
|
||||
continue;
|
||||
/* Variable is only returned if there is both writer
|
||||
* and reader. This means dead writes will not get
|
||||
* register allocated as a result and can overwrite random
|
||||
* registers. Assert on dead writes insted so we can improve
|
||||
* the DCE.
|
||||
*/
|
||||
const struct rc_opcode_info *opcode =
|
||||
rc_get_opcode_info(inst->U.I.Opcode);
|
||||
assert(c->type == RC_FRAGMENT_PROGRAM ||
|
||||
!opcode->HasDstReg ||
|
||||
inst->U.I.DstReg.File == RC_FILE_OUTPUT ||
|
||||
inst->U.I.DstReg.File == RC_FILE_ADDRESS);
|
||||
continue;
|
||||
}
|
||||
new_var = rc_variable(c, inst->U.I.DstReg.File,
|
||||
inst->U.I.DstReg.Index,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue