intel/compiler: Remove is_tex()
The current name doesn't cover all the tex related instructions and in all usages, we already have a switch statement to dispatch per instruction type, so is more natural to list the instructions we care there. In fs::is_send_from_grf() we can simply ignore them since the instructions are either lowered directly to SEND (Gfx7+) or use MRF (Gfx6-). With this change, the fs_inst::size_read() generated code gets simplified (the "tex" entries get added to the switch jump table in gcc) and the default case loses the conditional handling tex. This reduces shader compilation time, as illustrated by replaying fossils (tested on my TGL laptop): ``` // Rise of the Tomb Raider (N=13) Difference at 95.0% confidence -1.32231 +/- 0.0170138 -4.37605% +/- 0.0563054% (Student's t, pooled s = 0.0210159) // Cyberpunk 2077 (N=7) Difference at 95.0% confidence -3.64 +/- 0.114993 -2.95188% +/- 0.0932544% (Student's t, pooled s = 0.09873) ``` Suggested-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25721>
This commit is contained in:
@@ -243,9 +243,6 @@ fs_inst::is_send_from_grf() const
|
||||
case FS_OPCODE_FB_READ:
|
||||
return src[0].file == VGRF;
|
||||
default:
|
||||
if (is_tex())
|
||||
return src[0].file == VGRF;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -309,16 +306,29 @@ fs_inst::is_payload(unsigned arg) const
|
||||
case SHADER_OPCODE_INTERLOCK:
|
||||
case SHADER_OPCODE_MEMORY_FENCE:
|
||||
case SHADER_OPCODE_BARRIER:
|
||||
case SHADER_OPCODE_TEX:
|
||||
case FS_OPCODE_TXB:
|
||||
case SHADER_OPCODE_TXD:
|
||||
case SHADER_OPCODE_TXF:
|
||||
case SHADER_OPCODE_TXF_LZ:
|
||||
case SHADER_OPCODE_TXF_CMS:
|
||||
case SHADER_OPCODE_TXF_CMS_W:
|
||||
case SHADER_OPCODE_TXF_UMS:
|
||||
case SHADER_OPCODE_TXF_MCS:
|
||||
case SHADER_OPCODE_TXL:
|
||||
case SHADER_OPCODE_TXL_LZ:
|
||||
case SHADER_OPCODE_TXS:
|
||||
case SHADER_OPCODE_LOD:
|
||||
case SHADER_OPCODE_TG4:
|
||||
case SHADER_OPCODE_TG4_OFFSET:
|
||||
case SHADER_OPCODE_SAMPLEINFO:
|
||||
return arg == 0;
|
||||
|
||||
case SHADER_OPCODE_SEND:
|
||||
return arg == 2 || arg == 3;
|
||||
|
||||
default:
|
||||
if (is_tex())
|
||||
return arg == 0;
|
||||
else
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -910,10 +920,28 @@ fs_inst::size_read(int arg) const
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (arg == 0 && src[0].file == VGRF && is_tex())
|
||||
case SHADER_OPCODE_TEX:
|
||||
case FS_OPCODE_TXB:
|
||||
case SHADER_OPCODE_TXD:
|
||||
case SHADER_OPCODE_TXF:
|
||||
case SHADER_OPCODE_TXF_LZ:
|
||||
case SHADER_OPCODE_TXF_CMS:
|
||||
case SHADER_OPCODE_TXF_CMS_W:
|
||||
case SHADER_OPCODE_TXF_UMS:
|
||||
case SHADER_OPCODE_TXF_MCS:
|
||||
case SHADER_OPCODE_TXL:
|
||||
case SHADER_OPCODE_TXL_LZ:
|
||||
case SHADER_OPCODE_TXS:
|
||||
case SHADER_OPCODE_LOD:
|
||||
case SHADER_OPCODE_TG4:
|
||||
case SHADER_OPCODE_TG4_OFFSET:
|
||||
case SHADER_OPCODE_SAMPLEINFO:
|
||||
if (arg == 0 && src[0].file == VGRF)
|
||||
return mlen * REG_SIZE;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (src[arg].file) {
|
||||
|
||||
Reference in New Issue
Block a user