summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/lower_int64.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-08-09 13:34:02 +1000
committerTimothy Arceri <[email protected]>2017-08-11 10:43:12 +1000
commite2e2c5abd279df1b3aa99c52b81c9cb48fea35fb (patch)
tree814dcc8cf5c292ebaead53f75580c93b7f95f1ce /src/compiler/glsl/lower_int64.cpp
parent5563872dbfbf733ed56e1b367bc8944ca59b1c3e (diff)
glsl: calculate number of operands in an expression once
Extra validation is added to ir_validate to make sure this is always updated to the correct numer of operands, as passes like lower_instructions modify the instructions directly rather then generating a new one. The reduction in time is so small that it is not really measurable. However callgrind was reporting this function as being called just under 34 million times while compiling the Deus Ex shaders (just pre-linking was profiled) with 0.20% spent in this function. v2: - make num_operands a unit8_t - fix unsigned/signed mismatches Reviewed-by: Thomas Helland <[email protected]>
Diffstat (limited to 'src/compiler/glsl/lower_int64.cpp')
-rw-r--r--src/compiler/glsl/lower_int64.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/glsl/lower_int64.cpp b/src/compiler/glsl/lower_int64.cpp
index 9770d314af6..b6bf9cee7d3 100644
--- a/src/compiler/glsl/lower_int64.cpp
+++ b/src/compiler/glsl/lower_int64.cpp
@@ -258,7 +258,7 @@ lower_64bit::lower_op_to_function_call(ir_instruction *base_ir,
ir_expression *ir,
ir_function_signature *callee)
{
- const unsigned num_operands = ir->get_num_operands();
+ const unsigned num_operands = ir->num_operands;
ir_variable *src[4][4];
ir_variable *dst[4];
void *const mem_ctx = ralloc_parent(ir);
@@ -319,7 +319,7 @@ lower_64bit_visitor::handle_op(ir_expression *ir,
const char *function_name,
function_generator generator)
{
- for (unsigned i = 0; i < ir->get_num_operands(); i++)
+ for (unsigned i = 0; i < ir->num_operands; i++)
if (!ir->operands[i]->type->is_integer_64())
return ir;