nir/opt_vectorize: Add a callback for filtering of vectorizing.
[mesa.git] / src / gallium / drivers / r600 / sfn / sfn_liverange.cpp
index 1c95c3bc4d16cb24cab5c111ede08f619422eccd..55159233a14afe7781f87c3aa09338e441d9b0b0 100644 (file)
@@ -754,14 +754,16 @@ void LiverangeEvaluator::run(const Shader& shader,
 
    sfn_log << SfnLog::merge << "have " << temp_acc.size() << " temps\n";
 
-   for (const auto& ir: shader.m_ir) {
-      switch (ir->type()) {
-      case Instruction::cond_if:
-      case Instruction::cond_else:
-      case Instruction::loop_begin:
-         ++n_scopes;
-      default:
-         ;
+   for (const auto& block: shader.m_ir) {
+      for (const auto& ir: block) {
+         switch (ir->type()) {
+         case Instruction::cond_if:
+         case Instruction::cond_else:
+         case Instruction::loop_begin:
+            ++n_scopes;
+         default:
+            ;
+         }
       }
    }
 
@@ -783,12 +785,13 @@ void LiverangeEvaluator::run(const Shader& shader,
       }
    }
 
-   for (const auto& ir: shader.m_ir) {
-      ir->evalue_liveness(*this);
-      if (ir->type() != Instruction::alu ||
-          static_cast<const AluInstruction&>(*ir).flag(alu_last_instr))
-         ++line;
-   }
+   for (const auto& block: shader.m_ir)
+      for (const auto& ir: block)  {
+         ir->evalue_liveness(*this);
+         if (ir->type() != Instruction::alu ||
+             static_cast<const AluInstruction&>(*ir).flag(alu_last_instr))
+            ++line;
+      }
 
    assert(cur_scope->type() == outer_scope);
    cur_scope->set_end(line);