summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vec4_live_variables.h
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-10-21 10:57:29 -0700
committerEric Anholt <eric@anholt.net>2013-10-29 00:27:35 -0700
commit415d6dc5bd6915b0c17a1df0f9bd0ef4ca534a81 (patch)
tree7bbe735da9c6ae336d97f7f49864737a618a44fe /src/mesa/drivers/dri/i965/brw_vec4_live_variables.h
parent8bd4476010444642cff71e64146c91a484238dc2 (diff)
downloadexternal_mesa3d-415d6dc5bd6915b0c17a1df0f9bd0ef4ca534a81.zip
external_mesa3d-415d6dc5bd6915b0c17a1df0f9bd0ef4ca534a81.tar.gz
external_mesa3d-415d6dc5bd6915b0c17a1df0f9bd0ef4ca534a81.tar.bz2
i965/vec4: Reduce working set size of live variables computation.
Orbital Explorer was generating a 4000 instruction geometry shader, which was taking 275 trips through dead code elimination and register coalescing, each of which updated live variables to get its work done, and invalidated those live variables afterwards. By using bitfields instead of bools (reducing the working set size by a factor of 8) in live variables analysis, it drops from 88% of the profile to 57%, and reduces overall runtime from I-got-bored-and-killed-it (Paul says 3+ minutes) to 10.5 seconds. Compare to f179f419d1d0a03fad36c2b0a58e8b853bae6118 on the FS side. Reviewed-by: Paul Berry <stereotype441@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4_live_variables.h')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_live_variables.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_live_variables.h b/src/mesa/drivers/dri/i965/brw_vec4_live_variables.h
index 296468a..b2d8b33 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_live_variables.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4_live_variables.h
@@ -25,6 +25,7 @@
*
*/
+#include "main/bitset.h"
#include "brw_vec4.h"
namespace brw {
@@ -36,18 +37,18 @@ struct block_data {
* Note that for our purposes, "defined" means unconditionally, completely
* defined.
*/
- bool *def;
+ BITSET_WORD *def;
/**
* Which variables are used before being defined in the block.
*/
- bool *use;
+ BITSET_WORD *use;
/** Which defs reach the entry point of the block. */
- bool *livein;
+ BITSET_WORD *livein;
/** Which defs reach the exit point of the block. */
- bool *liveout;
+ BITSET_WORD *liveout;
};
class vec4_live_variables {
@@ -65,6 +66,7 @@ public:
void *mem_ctx;
int num_vars;
+ int bitset_words;
/** Per-basic-block information on live variables */
struct block_data *bd;