Mesa (master): i965/fs: don't make unused payload registers interfere
Connor Abbott
cwabbott0 at kemper.freedesktop.org
Fri Jul 17 18:16:20 UTC 2015
Module: Mesa
Branch: master
Commit: bde4c8ec1fd69e312fe21e36c8ce07139916811a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bde4c8ec1fd69e312fe21e36c8ce07139916811a
Author: Connor Abbott <cwabbott0 at gmail.com>
Date: Tue Jun 30 13:42:15 2015 -0700
i965/fs: don't make unused payload registers interfere
Before, we were setting payload_last_use_ip for unused payload
registers to 0, which made them interfere with whatever the first
instruction wrote to due to the workaround for SIMD16 uniform arguments.
Just use -1 to mean "unused" instead, and then skip setting any
interferences for unused payload registers.
instructions in affected programs: 0 -> 0
helped: 0
HURT: 0
GAINED: 1
LOST: 0
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Signed-off-by: Connor Abbott <connor.w.abbott at intel.com>
---
src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
index 1ee19e4..f25f2ec 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
@@ -341,7 +341,9 @@ fs_visitor::setup_payload_interference(struct ra_graph *g,
int loop_end_ip = 0;
int payload_last_use_ip[payload_node_count];
- memset(payload_last_use_ip, 0, sizeof(payload_last_use_ip));
+ for (int i = 0; i < payload_node_count; i++)
+ payload_last_use_ip[i] = -1;
+
int ip = 0;
foreach_block_and_inst(block, fs_inst, inst, cfg) {
switch (inst->opcode) {
@@ -411,6 +413,9 @@ fs_visitor::setup_payload_interference(struct ra_graph *g,
}
for (int i = 0; i < payload_node_count; i++) {
+ if (payload_last_use_ip[i] == -1)
+ continue;
+
/* Mark the payload node as interfering with any virtual grf that is
* live between the start of the program and our last use of the payload
* node.
More information about the mesa-commit
mailing list