Mesa (master): aco: optimize v_pk_fma_f16 -> v_pk_fmac_f16 on GFX10

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 13 18:03:29 UTC 2021


Module: Mesa
Branch: master
Commit: 6ecbccfb2374c4074ab49d3cd31d9aa48a950ab2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6ecbccfb2374c4074ab49d3cd31d9aa48a950ab2

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Wed Sep 16 10:32:29 2020 +0100

aco: optimize v_pk_fma_f16 -> v_pk_fmac_f16 on GFX10

Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6680>

---

 src/amd/compiler/aco_register_allocation.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp
index d617ecb84ad..2557559b5c0 100644
--- a/src/amd/compiler/aco_register_allocation.cpp
+++ b/src/amd/compiler/aco_register_allocation.cpp
@@ -2083,7 +2083,8 @@ void register_allocation(Program *program, std::vector<IDSet>& live_out_per_bloc
               (instr->opcode == aco_opcode::v_fma_f32 && program->chip_class >= GFX10) ||
               instr->opcode == aco_opcode::v_mad_f16 ||
               instr->opcode == aco_opcode::v_mad_legacy_f16 ||
-              (instr->opcode == aco_opcode::v_fma_f16 && program->chip_class >= GFX10)) &&
+              (instr->opcode == aco_opcode::v_fma_f16 && program->chip_class >= GFX10) ||
+              (instr->opcode == aco_opcode::v_pk_fma_f16 && program->chip_class >= GFX10)) &&
              instr->operands[2].isTemp() &&
              instr->operands[2].isKillBeforeDef() &&
              instr->operands[2].getTemp().type() == RegType::vgpr &&
@@ -2113,6 +2114,9 @@ void register_allocation(Program *program, std::vector<IDSet>& live_out_per_bloc
                case aco_opcode::v_fma_f16:
                   instr->opcode = aco_opcode::v_fmac_f16;
                   break;
+               case aco_opcode::v_pk_fma_f16:
+                  instr->opcode = aco_opcode::v_pk_fmac_f16;
+                  break;
                default:
                   break;
                }
@@ -2125,6 +2129,7 @@ void register_allocation(Program *program, std::vector<IDSet>& live_out_per_bloc
              instr->opcode == aco_opcode::v_fmac_f32 ||
              instr->opcode == aco_opcode::v_mac_f16 ||
              instr->opcode == aco_opcode::v_fmac_f16 ||
+             instr->opcode == aco_opcode::v_pk_fmac_f16 ||
              instr->opcode == aco_opcode::v_writelane_b32 ||
              instr->opcode == aco_opcode::v_writelane_b32_e64) {
             instr->definitions[0].setFixed(instr->operands[2].physReg());



More information about the mesa-commit mailing list