mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 00:30:11 +01:00
Do simple constant folding while processing function call parameters
This commit is contained in:
parent
253dedeb6c
commit
1a872b1af3
1 changed files with 5 additions and 1 deletions
|
|
@ -36,7 +36,11 @@ process_parameters(exec_list *instructions, exec_list *actual_parameters,
|
|||
|
||||
foreach_list (n, parameters) {
|
||||
ast_node *const ast = exec_node_data(ast_node, n, link);
|
||||
ir_rvalue *const result = ast->hir(instructions, state);
|
||||
ir_rvalue *result = ast->hir(instructions, state);
|
||||
|
||||
ir_constant *const constant = result->constant_expression_value();
|
||||
if (constant != NULL)
|
||||
result = constant;
|
||||
|
||||
actual_parameters->push_tail(result);
|
||||
count++;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue