summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp
diff options
context:
space:
mode:
authorAlejandro Piñeiro <apinheiro@igalia.com>2015-10-14 20:26:43 +0200
committerAlejandro Piñeiro <apinheiro@igalia.com>2015-10-22 21:58:03 +0200
commita59359ecd22154cc2b3f88bb8c599f21af8a3934 (patch)
treed62b6ae7088a1edeca6ec4df924136c200543dc5 /src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp
parent8ac3b525c77cb5aae9e61bd984b78f6cbbffdc1c (diff)
downloadexternal_mesa3d-a59359ecd22154cc2b3f88bb8c599f21af8a3934.zip
external_mesa3d-a59359ecd22154cc2b3f88bb8c599f21af8a3934.tar.gz
external_mesa3d-a59359ecd22154cc2b3f88bb8c599f21af8a3934.tar.bz2
i965/vec4: track and use independently each flag channel
vec4_live_variables tracks now each flag channel independently, so vec4_dead_code_eliminate can update the writemask of null registers, based on which component are alive at the moment. This would allow vec4_cmod_propagation to optimize out several movs involving null registers. v2: added support to track each flag channel independently at vec4 live_variables, as v1 assumed that it was already doing it, as pointed by Francisco Jerez v3: general cleaningn after Matt Turner's review Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp b/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp
index 6782379..aa9a657 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp
@@ -86,9 +86,10 @@ vec4_live_variables::setup_def_use()
}
}
}
- if (inst->reads_flag()) {
- if (!BITSET_TEST(bd->flag_def, 0)) {
- BITSET_SET(bd->flag_use, 0);
+ for (unsigned c = 0; c < 4; c++) {
+ if (inst->reads_flag(c) &&
+ !BITSET_TEST(bd->flag_def, c)) {
+ BITSET_SET(bd->flag_use, c);
}
}
@@ -110,8 +111,11 @@ vec4_live_variables::setup_def_use()
}
}
if (inst->writes_flag()) {
- if (!BITSET_TEST(bd->flag_use, 0)) {
- BITSET_SET(bd->flag_def, 0);
+ for (unsigned c = 0; c < 4; c++) {
+ if ((inst->dst.writemask & (1 << c)) &&
+ !BITSET_TEST(bd->flag_use, c)) {
+ BITSET_SET(bd->flag_def, c);
+ }
}
}