broadcom/compiler: add V3D_DEBUG_RA option
To ask to debug a registr allocation failure (V3D_DEBUG_REGISTER_ALLOCATION seemed too long to me). When a fallback register allocation algorithm was added, if the register allocation fails, it only dumpg the current vir with the register pressure info with the failed fallback. But if we want do debug the problem, we would be interested on both. Additionally, it was strange that we got the full vir dump with the failure even if no debug option was set. Additionally we add shaderdb like stats for those failures, to make easier to compare one and the other. v2: keep a small warning message in case both register allocation algorithms fails (Neil) Reviewed-by: Neil Roberts <nroberts@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6999>
This commit is contained in:

committed by
Marge Bot

parent
bcb8dd7432
commit
8de380d26a
@@ -3046,13 +3046,29 @@ v3d_nir_to_vir(struct v3d_compile *c)
|
||||
if (temp_registers)
|
||||
break;
|
||||
|
||||
if (c->threads == min_threads &&
|
||||
(V3D_DEBUG & V3D_DEBUG_RA)) {
|
||||
fprintf(stderr,
|
||||
"Failed to register allocate using %s\n",
|
||||
c->fallback_scheduler ? "the fallback scheduler:" :
|
||||
"the normal scheduler: \n");
|
||||
|
||||
vir_dump(c);
|
||||
|
||||
char *shaderdb;
|
||||
int ret = v3d_shaderdb_dump(c, &shaderdb);
|
||||
if (ret > 0) {
|
||||
fprintf(stderr, "%s\n", shaderdb);
|
||||
free(shaderdb);
|
||||
}
|
||||
}
|
||||
|
||||
if (c->threads == min_threads) {
|
||||
if (c->fallback_scheduler) {
|
||||
fprintf(stderr,
|
||||
"Failed to register allocate at %d "
|
||||
"threads:\n",
|
||||
"threads with any strategy.\n",
|
||||
c->threads);
|
||||
vir_dump(c);
|
||||
}
|
||||
c->compilation_result =
|
||||
V3D_COMPILATION_FAILED_REGISTER_ALLOCATION;
|
||||
|
Reference in New Issue
Block a user