aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_search.h
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-09-23 15:40:46 -0700
committerEric Anholt <[email protected]>2019-10-04 19:15:01 +0000
commitc23db0df1893ee755d7c4ed182ba734a019afe43 (patch)
tree592cea258d9ba7363ba843d16a4310722ff78d8d /src/compiler/nir/nir_search.h
parent7025dbe794b53b030ae0a3cb55217ea831a810d9 (diff)
nir: Keep the range analysis HT around intra-pass until we make a change.
This lets us memoize range analysis work across instructions. Reduces runtime of shader-db on Intel by -30.0288% +/- 2.1693% (n=3). Fixes: 405de7ccb6cb ("nir/range-analysis: Rudimentary value range analysis pass") Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_search.h')
-rw-r--r--src/compiler/nir/nir_search.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_search.h b/src/compiler/nir/nir_search.h
index ac37f1ac653..c86efc5ba3f 100644
--- a/src/compiler/nir/nir_search.h
+++ b/src/compiler/nir/nir_search.h
@@ -93,7 +93,7 @@ typedef struct {
* variables to require, for example, power-of-two in order for the search
* to match.
*/
- bool (*cond)(nir_alu_instr *instr, unsigned src,
+ bool (*cond)(struct hash_table *range_ht, nir_alu_instr *instr, unsigned src,
unsigned num_components, const uint8_t *swizzle);
/** Swizzle (for replace only) */
@@ -175,6 +175,7 @@ NIR_DEFINE_CAST(nir_search_value_as_expression, nir_search_value,
nir_ssa_def *
nir_replace_instr(struct nir_builder *b, nir_alu_instr *instr,
+ struct hash_table *range_ht,
const nir_search_expression *search,
const nir_search_value *replace);