When handling function inputs the optimisation pass incorrectly
assumes the inputs are undefined. Here we simply change things to
assume inputs have always been assigned a value. Any further
optimisations will be taken care of once function inlining takes
place.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2984
Fixes: 65122e9e8038 ("ir_constant_variable: New pass to mark constant-assigned variables constant.")
Reviewed-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5413>
entry = get_assignment_entry(var, this->ht);
entry->assignment_count++;
}
+
+ /* We don't know if the variable passed to this function has been
+ * assigned a value or if it is undefined, so for now we always assume
+ * it has been assigned a value. Once functions have been inlined any
+ * further potential optimisations will be taken care of.
+ */
+ struct assignment_entry *entry;
+ entry = get_assignment_entry(param, this->ht);
+ entry->assignment_count++;
}
/* Mark the return storage as having been assigned to */