From 11d5d20e8bd6809363291574c817b8659f6b5fb5 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 3 Nov 2025 11:11:53 -0800 Subject: [PATCH] brw: Force allow_spilling when spill_all is set This ensures that g0 is reserved for spilling since there is going to be spilling. Fixes: 8bca7e520ce ("intel/brw: Only force g0's liveness to be the whole program if spilling") Reviewed-by: Kenneth Graunke Reviewed-by: Lionel Landwerlin (cherry picked from commit 1fc2f52d36211c753bb94cd5d46ec1c4d3d0dd46) Part-of: --- .pick_status.json | 2 +- src/intel/compiler/brw/brw_reg_allocate.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index eee7ad04ad9..1c037af387a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1424,7 +1424,7 @@ "description": "brw: Force allow_spilling when spill_all is set", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "8bca7e520ce01a59292c982f3b992bd4a2b3547e", "notes": null diff --git a/src/intel/compiler/brw/brw_reg_allocate.cpp b/src/intel/compiler/brw/brw_reg_allocate.cpp index 6d3526692e8..aca02d614e0 100644 --- a/src/intel/compiler/brw/brw_reg_allocate.cpp +++ b/src/intel/compiler/brw/brw_reg_allocate.cpp @@ -1429,6 +1429,12 @@ brw_reg_alloc::assign_regs(bool allow_spilling, bool spill_all) bool brw_assign_regs(brw_shader &s, bool allow_spilling, bool spill_all) { + /* Ensure that g0 is reserved for spilling since there is going to be + * spilling. + */ + if (spill_all) + allow_spilling = true; + brw_reg_alloc alloc(&s); bool success = alloc.assign_regs(allow_spilling, spill_all); if (!success && allow_spilling) {