From eb1ec9cf8e6f62f0664bb9886ac6c35b35cebc6b Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 9 Apr 2025 16:19:18 -0700 Subject: [PATCH] brw: Don't assert about MAX_VGRF_SIZE in brw_opt_split_virtual_grfs() This allows us to create temporary VGRFs that are larger than MAX_VGRF_SIZE(devinfo), which will be split eventually. They may not be split on the initial pass, because we may need LOAD_PAYLOAD lowering, copy propagation, and so on to occur first. So we allow registers to exceed that size initially. The "Register allocation relies on split_virtual_grfs()" assertion in brw_reg_allocate.cpp still asserts that all VGRFs which reach the register allocator have been properly split. One case where this is useful is for vectorizing convergent block loads. We create temporaries to splat the SIMD1 values out to SIMD(N), which can lead to some very large temporaries. However, copy propagation and so on ultimately eliminate these and they'll get split down to proper sizes or elided entirely in the end. (Note: both this and the prior commits from this merge request are needed to close the linked issue.) Cc: mesa-stable Reviewed-by: Matt Turner Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12324 Part-of: --- src/intel/compiler/brw_opt_virtual_grfs.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/intel/compiler/brw_opt_virtual_grfs.cpp b/src/intel/compiler/brw_opt_virtual_grfs.cpp index 942afc78232..05fbcb575c6 100644 --- a/src/intel/compiler/brw_opt_virtual_grfs.cpp +++ b/src/intel/compiler/brw_opt_virtual_grfs.cpp @@ -114,7 +114,6 @@ brw_opt_split_virtual_grfs(brw_shader &s) if (split_points[reg]) { has_splits = true; vgrf_has_split[i] = true; - assert(offset <= MAX_VGRF_SIZE(s.devinfo)); unsigned grf = brw_allocate_vgrf_units(s, offset).nr; for (unsigned k = reg - offset; k < reg; k++) new_virtual_grf[k] = grf; @@ -126,7 +125,6 @@ brw_opt_split_virtual_grfs(brw_shader &s) } /* The last one gets the original register number */ - assert(offset <= MAX_VGRF_SIZE(s.devinfo)); s.alloc.sizes[i] = offset; for (unsigned k = reg - offset; k < reg; k++) new_virtual_grf[k] = i;