aco: Remove lower_linear_bool_phi, it is not needed anymore.
authorTimur Kristóf <timur.kristof@gmail.com>
Thu, 21 Nov 2019 11:31:14 +0000 (12:31 +0100)
committerDaniel Schürmann <daniel@schuermann.dev>
Wed, 4 Dec 2019 10:36:01 +0000 (10:36 +0000)
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
src/amd/compiler/aco_lower_bool_phis.cpp

index 9e5374fe6a025a93cf587b00f6903e9d622166f4..dc64f0133b535fb7e7464a9e3d72a5d3339562f3 100644 (file)
@@ -187,25 +187,6 @@ void lower_divergent_bool_phi(Program *program, Block *block, aco_ptr<Instructio
    return;
 }
 
-void lower_linear_bool_phi(Program *program, Block *block, aco_ptr<Instruction>& phi)
-{
-   Builder bld(program);
-
-   for (unsigned i = 0; i < phi->operands.size(); i++) {
-      if (!phi->operands[i].isTemp())
-         continue;
-
-      Temp phi_src = phi->operands[i].getTemp();
-      if (phi_src.regClass() == s2) {
-         Temp new_phi_src = bld.tmp(s1);
-         insert_before_logical_end(&program->blocks[block->linear_preds[i]],
-            bld.sopc(aco_opcode::s_cmp_lg_u64, bld.scc(Definition(new_phi_src)),
-                     Operand(0u), phi_src).get_ptr());
-         phi->operands[i].setTemp(new_phi_src);
-      }
-   }
-}
-
 void lower_bool_phis(Program* program)
 {
    for (Block& block : program->blocks) {
@@ -214,11 +195,7 @@ void lower_bool_phis(Program* program)
             assert(phi->definitions[0].regClass() != s1);
             if (phi->definitions[0].regClass() == s2)
                lower_divergent_bool_phi(program, &block, phi);
-         } else if (phi->opcode == aco_opcode::p_linear_phi) {
-            /* if it's a valid non-boolean phi, this should be a no-op */
-            if (phi->definitions[0].regClass() == s1)
-               lower_linear_bool_phi(program, &block, phi);
-         } else {
+         } else if (!is_phi(phi)) {
             break;
          }
       }