nir: rename nir_var_shared to nir_var_mem_shared
authorKarol Herbst <kherbst@redhat.com>
Tue, 15 Jan 2019 23:12:38 +0000 (00:12 +0100)
committerKarol Herbst <kherbst@redhat.com>
Sat, 19 Jan 2019 19:01:41 +0000 (20:01 +0100)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c
src/compiler/glsl/gl_nir_lower_atomics.c
src/compiler/nir/nir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_io.c
src/compiler/nir/nir_opt_copy_prop_vars.c
src/compiler/nir/nir_opt_dead_write_vars.c
src/compiler/nir/nir_print.c
src/compiler/nir/nir_remove_dead_variables.c
src/compiler/nir/nir_validate.c
src/compiler/spirv/vtn_variables.c

index e3475e1e94f4a4ca5d153428bd85191fb82e75da..c558873bbee28dc7c013e1e2fb5ba963aee7916d 100644 (file)
@@ -1891,7 +1891,7 @@ static LLVMValueRef visit_load_var(struct ac_nir_context *ctx,
        LLVMValueRef ret;
        unsigned const_index;
        unsigned stride = 4;
-       int mode = nir_var_shared;
+       int mode = nir_var_mem_shared;
        
        if (var) {
                bool vs_in = ctx->stage == MESA_SHADER_VERTEX &&
@@ -1964,7 +1964,7 @@ static LLVMValueRef visit_load_var(struct ac_nir_context *ctx,
                        }
                }
                break;
-       case nir_var_shared: {
+       case nir_var_mem_shared: {
                LLVMValueRef address = get_src(ctx, instr->src[0]);
                LLVMValueRef val = LLVMBuildLoad(ctx->ac.builder, address, "");
                return LLVMBuildBitCast(ctx->ac.builder, val,
@@ -2103,7 +2103,7 @@ visit_store_var(struct ac_nir_context *ctx,
                        }
                }
                break;
-       case nir_var_shared: {
+       case nir_var_mem_shared: {
                int writemask = instr->const_index[0];
                LLVMValueRef address = get_src(ctx, instr->src[0]);
                LLVMValueRef val = get_src(ctx, instr->src[1]);
@@ -3792,7 +3792,7 @@ static void visit_jump(struct ac_llvm_context *ctx,
 static void visit_deref(struct ac_nir_context *ctx,
                         nir_deref_instr *instr)
 {
-       if (instr->mode != nir_var_shared)
+       if (instr->mode != nir_var_mem_shared)
                return;
 
        LLVMValueRef result = NULL;
index 8bbce00e467a6f03b918d111eaba8169109e07c4..60642e7130a670b5075634a459dabe42f5507bf3 100644 (file)
@@ -102,7 +102,7 @@ lower_deref_instr(nir_builder *b, nir_intrinsic_instr *instr,
 
    if (var->data.mode != nir_var_uniform &&
        var->data.mode != nir_var_mem_ssbo &&
-       var->data.mode != nir_var_shared)
+       var->data.mode != nir_var_mem_shared)
       return false; /* atomics passed as function arguments can't be lowered */
 
    const unsigned uniform_loc = var->data.location;
index 2b9b1f7f981ebaacfabece3adb6060852196b363..446e256ecddca27c7db256bbe58bae286e7510af 100644 (file)
@@ -147,7 +147,7 @@ nir_shader_add_variable(nir_shader *shader, nir_variable *var)
       exec_list_push_tail(&shader->uniforms, &var->node);
       break;
 
-   case nir_var_shared:
+   case nir_var_mem_shared:
       assert(shader->info.stage == MESA_SHADER_COMPUTE);
       exec_list_push_tail(&shader->shared, &var->node);
       break;
index 6d4bb4e8095e1e2010431c7f7c7dc854372b8b41..6fc4a831b5204178350adc9e1e03bc70d3919679 100644 (file)
@@ -103,7 +103,7 @@ typedef enum {
    nir_var_mem_ubo         = (1 << 5),
    nir_var_system_value    = (1 << 6),
    nir_var_mem_ssbo        = (1 << 7),
-   nir_var_shared          = (1 << 8),
+   nir_var_mem_shared      = (1 << 8),
    nir_var_all             = ~0,
 } nir_variable_mode;
 
index d3d2d95f37588ac94a24400415bbf3b620ef757c..06598e054a67284a3023c6f04133123a58b3291f 100644 (file)
@@ -189,7 +189,7 @@ lower_load(nir_intrinsic_instr *intrin, struct lower_io_state *state,
    case nir_var_uniform:
       op = nir_intrinsic_load_uniform;
       break;
-   case nir_var_shared:
+   case nir_var_mem_shared:
       op = nir_intrinsic_load_shared;
       break;
    default:
@@ -228,7 +228,7 @@ lower_store(nir_intrinsic_instr *intrin, struct lower_io_state *state,
    nir_variable_mode mode = var->data.mode;
 
    nir_intrinsic_op op;
-   if (mode == nir_var_shared) {
+   if (mode == nir_var_mem_shared) {
       op = nir_intrinsic_store_shared;
    } else {
       assert(mode == nir_var_shader_out);
@@ -261,7 +261,7 @@ static nir_intrinsic_instr *
 lower_atomic(nir_intrinsic_instr *intrin, struct lower_io_state *state,
              nir_variable *var, nir_ssa_def *offset)
 {
-   assert(var->data.mode == nir_var_shared);
+   assert(var->data.mode == nir_var_mem_shared);
 
    nir_intrinsic_op op;
    switch (intrin->intrinsic) {
@@ -407,7 +407,7 @@ nir_lower_io_block(nir_block *block,
 
       if (mode != nir_var_shader_in &&
           mode != nir_var_shader_out &&
-          mode != nir_var_shared &&
+          mode != nir_var_mem_shared &&
           mode != nir_var_uniform)
          continue;
 
index 39c3d52611ade716730fb55899c8d56667f6551f..392fef407cfd4d30bbbcd75d49d52d6a858ca98b 100644 (file)
@@ -136,7 +136,7 @@ gather_vars_written(struct copy_prop_var_state *state,
                               nir_var_shader_temp |
                               nir_var_function_temp |
                               nir_var_mem_ssbo |
-                              nir_var_shared;
+                              nir_var_mem_shared;
             continue;
          }
 
@@ -149,7 +149,7 @@ gather_vars_written(struct copy_prop_var_state *state,
          case nir_intrinsic_memory_barrier:
             written->modes |= nir_var_shader_out |
                               nir_var_mem_ssbo |
-                              nir_var_shared;
+                              nir_var_mem_shared;
             break;
 
          case nir_intrinsic_emit_vertex:
@@ -627,7 +627,7 @@ copy_prop_vars_block(struct copy_prop_var_state *state,
                                          nir_var_shader_temp |
                                          nir_var_function_temp |
                                          nir_var_mem_ssbo |
-                                         nir_var_shared);
+                                         nir_var_mem_shared);
          continue;
       }
 
@@ -640,7 +640,7 @@ copy_prop_vars_block(struct copy_prop_var_state *state,
       case nir_intrinsic_memory_barrier:
          apply_barrier_for_modes(copies, nir_var_shader_out |
                                          nir_var_mem_ssbo |
-                                         nir_var_shared);
+                                         nir_var_mem_shared);
          break;
 
       case nir_intrinsic_emit_vertex:
index 6c0539e492eac4335e81c168ca9c87c87166b2cb..d2062a01ac038e49331159b760851b325c0193b9 100644 (file)
@@ -122,7 +122,7 @@ remove_dead_write_vars_local(void *mem_ctx, nir_block *block)
                                                 nir_var_shader_temp |
                                                 nir_var_function_temp |
                                                 nir_var_mem_ssbo |
-                                                nir_var_shared);
+                                                nir_var_mem_shared);
          continue;
       }
 
@@ -135,7 +135,7 @@ remove_dead_write_vars_local(void *mem_ctx, nir_block *block)
       case nir_intrinsic_memory_barrier: {
          clear_unused_for_modes(&unused_writes, nir_var_shader_out |
                                                 nir_var_mem_ssbo |
-                                                nir_var_shared);
+                                                nir_var_mem_shared);
          break;
       }
 
index 18a0f8d019a1c01099e033c7988974a99c79e306..ab976af1c4337762caa10569d8cd3e3eeb731f6b 100644 (file)
@@ -419,7 +419,7 @@ get_variable_mode_str(nir_variable_mode mode, bool want_local_global_mode)
       return "system";
    case nir_var_mem_ssbo:
       return "ssbo";
-   case nir_var_shared:
+   case nir_var_mem_shared:
       return "shared";
    case nir_var_shader_temp:
       return want_local_global_mode ? "shader_temp" : "";
index 8b28cb28118a24561655294ca4d06b29fc8cba9e..cfdd179629949bad410f658e529080ddaba34165 100644 (file)
@@ -71,7 +71,7 @@ add_var_use_deref(nir_deref_instr *deref, struct set *live)
     * all means we need to keep it alive.
     */
    assert(deref->mode == deref->var->data.mode);
-   if (!(deref->mode & (nir_var_function_temp | nir_var_shader_temp | nir_var_shared)) ||
+   if (!(deref->mode & (nir_var_function_temp | nir_var_shader_temp | nir_var_mem_shared)) ||
        deref_used_for_not_store(deref))
       _mesa_set_add(live, deref->var);
 }
@@ -183,7 +183,7 @@ nir_remove_dead_variables(nir_shader *shader, nir_variable_mode modes)
    if (modes & nir_var_system_value)
       progress = remove_dead_vars(&shader->system_values, live) || progress;
 
-   if (modes & nir_var_shared)
+   if (modes & nir_var_mem_shared)
       progress = remove_dead_vars(&shader->shared, live) || progress;
 
    if (modes & nir_var_function_temp) {
index ef5156a70dd4834f3ecac1495204abe2921420ff..da5e5c05c1c3af2547132bb26a297aef94e008af 100644 (file)
@@ -448,7 +448,7 @@ validate_deref_instr(nir_deref_instr *instr, validate_state *state)
       case nir_deref_type_array_wildcard:
          if (instr->mode == nir_var_mem_ubo ||
              instr->mode == nir_var_mem_ssbo ||
-             instr->mode == nir_var_shared) {
+             instr->mode == nir_var_mem_shared) {
             /* Shared variables and UBO/SSBOs have a bit more relaxed rules
              * because we need to be able to handle array derefs on vectors.
              * Fortunately, nir_lower_io handles these just fine.
index d634adbd877c69c44c9f348d6c7323959b4e1179..d0c73f7530e047f7be2c7f69316a125cd83bfbe0 100644 (file)
@@ -1702,7 +1702,7 @@ vtn_storage_class_to_mode(struct vtn_builder *b,
       break;
    case SpvStorageClassWorkgroup:
       mode = vtn_variable_mode_workgroup;
-      nir_mode = nir_var_shared;
+      nir_mode = nir_var_mem_shared;
       break;
    case SpvStorageClassAtomicCounter:
       mode = vtn_variable_mode_uniform;
@@ -1974,7 +1974,7 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
           * SPIR-V.
           */
          var->var->type = glsl_get_bare_type(var->type->type);
-         var->var->data.mode = nir_var_shared;
+         var->var->data.mode = nir_var_mem_shared;
       }
       break;