r300: Also consider ALU condition modifiers for loop DCE.

Since we typically use an ALU op to set the condition modifier for the
IF-BRK-ENDIF, we were particularly likely to remove the increment of the
loop counter!

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14117>
This commit is contained in:
Emma Anholt 2021-12-06 16:43:45 -08:00 committed by Marge Bot
parent d6fed4ab7d
commit 26b3e2f7cd

View File

@ -253,8 +253,13 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, void *user)
if(opcode->HasDstReg){
int src = 0;
unsigned int srcmasks[3];
rc_compute_sources_for_writemask(ptr,
ptr->U.I.DstReg.WriteMask, srcmasks);
unsigned int writemask = ptr->U.I.DstReg.WriteMask;
if (ptr->U.I.WriteALUResult == RC_ALURESULT_X)
writemask |= RC_MASK_X;
else if (ptr->U.I.WriteALUResult == RC_ALURESULT_W)
writemask |= RC_MASK_W;
rc_compute_sources_for_writemask(ptr, writemask, srcmasks);
for(src=0; src < opcode->NumSrcRegs; src++){
mark_used(&s,
ptr->U.I.SrcReg[src].File,