intel/nir: Call nir_metadata_preserve on !progress
[mesa.git] / src / intel / compiler / brw_vec4_copy_propagation.cpp
index c1ae32a2936c3d07c132ce95da8db0a5cf1f7f0f..8fb5d1c245101c36281dfd5009bc89d36d226406 100644 (file)
@@ -190,6 +190,13 @@ try_constant_propagate(const struct gen_device_info *devinfo,
       inst->src[arg] = value;
       return true;
 
+   case VEC4_OPCODE_UNTYPED_ATOMIC:
+      if (arg == 1) {
+         inst->src[arg] = value;
+         return true;
+      }
+      break;
+
    case SHADER_OPCODE_POW:
    case SHADER_OPCODE_INT_QUOTIENT:
    case SHADER_OPCODE_INT_REMAINDER:
@@ -374,7 +381,8 @@ try_copy_propagate(const struct gen_device_info *devinfo,
       return false;
 
    if (has_source_modifiers &&
-       inst->opcode == SHADER_OPCODE_GEN4_SCRATCH_WRITE)
+       (inst->opcode == SHADER_OPCODE_GEN4_SCRATCH_WRITE ||
+        inst->opcode == VEC4_OPCODE_PICK_HIGH_32BIT))
       return false;
 
    unsigned composed_swizzle = brw_compose_swizzle(inst->src[arg].swizzle,
@@ -552,7 +560,8 @@ vec4_visitor::opt_copy_propagation(bool do_constant_prop)
    }
 
    if (progress)
-      invalidate_live_intervals();
+      invalidate_analysis(DEPENDENCY_INSTRUCTION_DATA_FLOW |
+                          DEPENDENCY_INSTRUCTION_DETAIL);
 
    return progress;
 }