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

Author: Rhys Perry <[email protected]>
Date:   Wed Oct 14 15:35:20 2020 +0100

aco: copy-propgate through p_create_vector during value numbering

fossil-db (Navi):
Totals from 182 (0.13% of 137413) affected shaders:
SGPRs: 9304 -> 9312 (+0.09%)
VGPRs: 7636 -> 7620 (-0.21%); split: -0.26%, +0.05%
CodeSize: 733516 -> 733092 (-0.06%); split: -0.07%, +0.01%
MaxWaves: 2478 -> 2479 (+0.04%)
Instrs: 139664 -> 139561 (-0.07%); split: -0.09%, +0.02%
Cycles: 3215104 -> 3214080 (-0.03%); split: -0.04%, +0.01%

fossil-db (Polaris):
Totals from 161 (0.12% of 138881) affected shaders:
VGPRs: 5608 -> 5596 (-0.21%); split: -0.29%, +0.07%
CodeSize: 605336 -> 605120 (-0.04%); split: -0.05%, +0.02%
Instrs: 117957 -> 117902 (-0.05%); split: -0.07%, +0.02%
Cycles: 3105008 -> 3103876 (-0.04%); split: -0.04%, +0.00%

Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Daniel Schürmann <[email protected]>
Acked-by: Timur Kristóf <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

---

 src/amd/compiler/aco_opt_value_numbering.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/amd/compiler/aco_opt_value_numbering.cpp 
b/src/amd/compiler/aco_opt_value_numbering.cpp
index 91e03eb3cc0..4c35294e183 100644
--- a/src/amd/compiler/aco_opt_value_numbering.cpp
+++ b/src/amd/compiler/aco_opt_value_numbering.cpp
@@ -389,8 +389,13 @@ void process_block(vn_ctx& ctx, Block& block)
       }
 
       /* simple copy-propagation through renaming */
-      if ((instr->opcode == aco_opcode::s_mov_b32 || instr->opcode == 
aco_opcode::s_mov_b64 || instr->opcode == aco_opcode::v_mov_b32) &&
-          !instr->definitions[0].isFixed() && instr->operands[0].isTemp() && 
instr->operands[0].regClass() == instr->definitions[0].regClass() &&
+      bool copy_instr =
+         instr->opcode == aco_opcode::s_mov_b32 ||
+         instr->opcode == aco_opcode::s_mov_b64 ||
+         instr->opcode == aco_opcode::v_mov_b32 ||
+         (instr->opcode == aco_opcode::p_create_vector && 
instr->operands.size() == 1);
+      if (copy_instr && !instr->definitions[0].isFixed() && 
instr->operands[0].isTemp() &&
+          instr->operands[0].regClass() == instr->definitions[0].regClass() &&
           !instr->isDPP() && !((int)instr->format & (int)Format::SDWA)) {
          ctx.renames[instr->definitions[0].tempId()] = 
instr->operands[0].getTemp();
          continue;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to