summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-05-14 22:51:20 -0500
committerJason Ekstrand <[email protected]>2019-05-16 02:13:09 +0000
commitb2d274c6775003e8b6b4aa015a2d8c336fed6fdc (patch)
tree7d6784092f8d75d31daa8743d516d0d0526daaae /src
parentc19acf321c6ac1d356add78a01c56edb7c22f5f0 (diff)
intel/fs/ra: Choose a spill reg before throwing away the graph
Otherwise, we get an effectively random spill reg because we no longer have the information from RA to guide us. Also, a completely clean graph has undefined data in in_stack which is used for choosing the spill reg so it really is non-deterministic. Fixes: e99081e76d4 "intel/fs/ra: Spill without destroying the..." Tested-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/compiler/brw_fs_reg_allocate.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/intel/compiler/brw_fs_reg_allocate.cpp b/src/intel/compiler/brw_fs_reg_allocate.cpp
index b7425ea6d58..33631ddcd0c 100644
--- a/src/intel/compiler/brw_fs_reg_allocate.cpp
+++ b/src/intel/compiler/brw_fs_reg_allocate.cpp
@@ -1157,6 +1157,13 @@ fs_reg_alloc::assign_regs(bool allow_spilling, bool spill_all)
if (!allow_spilling)
return false;
+ /* Failed to allocate registers. Spill a reg, and the caller will
+ * loop back into here to try again.
+ */
+ int reg = choose_spill_reg();
+ if (reg == -1)
+ return false;
+
/* If we're going to spill but we've never spilled before, we need to
* re-build the interference graph with MRFs enabled to allow spilling.
*/
@@ -1167,13 +1174,6 @@ fs_reg_alloc::assign_regs(bool allow_spilling, bool spill_all)
spilled = true;
- /* Failed to allocate registers. Spill a reg, and the caller will
- * loop back into here to try again.
- */
- int reg = choose_spill_reg();
- if (reg == -1)
- return false;
-
spill_reg(reg);
}