freedreno/ir3: Use get_once() for one-time init

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7644>
This commit is contained in:
Rob Clark 2020-11-23 14:28:52 -08:00 committed by Marge Bot
parent c9062df1d5
commit b4ad27a986

View file

@ -204,9 +204,8 @@ ir3_optimize_loop(nir_shader *s)
progress |= OPT(s, nir_copy_prop);
progress |= OPT(s, nir_opt_dce);
progress |= OPT(s, nir_opt_cse);
static int gcm = -1;
if (gcm == -1)
gcm = env_var_as_unsigned("GCM", 0);
int gcm = get_once(env_var_as_unsigned("GCM", 0));
if (gcm == 1)
progress |= OPT(s, nir_opt_gcm, true);
else if (gcm == 2)