From 65c0ef859f9010a78b355feae84a09942e90a57c Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Wed, 3 Jul 2024 08:38:42 +0200 Subject: [PATCH] intel/brw: allocate large table in the heap instead of the stack When having a large number of virtual register this table can be too large to be allocated on the stack. Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/compiler/brw_fs_opt_virtual_grfs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_fs_opt_virtual_grfs.cpp b/src/intel/compiler/brw_fs_opt_virtual_grfs.cpp index bebc308f512..e8c89704517 100644 --- a/src/intel/compiler/brw_fs_opt_virtual_grfs.cpp +++ b/src/intel/compiler/brw_fs_opt_virtual_grfs.cpp @@ -34,7 +34,7 @@ brw_fs_opt_split_virtual_grfs(fs_visitor &s) /* Count the total number of registers */ unsigned reg_count = 0; - unsigned vgrf_to_reg[num_vars]; + unsigned *vgrf_to_reg = new unsigned[num_vars]; for (unsigned i = 0; i < num_vars; i++) { vgrf_to_reg[i] = reg_count; reg_count += s.alloc.sizes[i]; @@ -203,6 +203,7 @@ cleanup: delete[] vgrf_has_split; delete[] new_virtual_grf; delete[] new_reg_offset; + delete[] vgrf_to_reg; return progress; }