Module: Mesa
Branch: staging/20.1
Commit: dd42e8258687708093795af5c9d9fe786ef1c07c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=dd42e8258687708093795af5c9d9fe786ef1c07c

Author: Daniel Schürmann <[email protected]>
Date:   Wed May  6 17:24:38 2020 +0100

aco: either copy-propagate or inline create_vector operands

Don't do both at the same time as it breaks DCE

Fixes: 2dc550202e82c5da198ad0a416a5d24dd89addd8 ('aco: copy-propagate 
p_create_vector copies of vectors')
Fixes: dEQP-VK.glsl.builtin.precision_double.ldexp.compute.scalar on GFX6-GFX7

Reviewed-by: Rhys Perry <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4922>
(cherry picked from commit 37e89e30276724932328edb7b8bf4909606052d1)

---

 .pick_status.json                  |  2 +-
 src/amd/compiler/aco_optimizer.cpp | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 5b50bef6869..008e4271f78 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -112,7 +112,7 @@
         "description": "aco: either copy-propagate or inline create_vector 
operands",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "2dc550202e82c5da198ad0a416a5d24dd89addd8"
     },
diff --git a/src/amd/compiler/aco_optimizer.cpp 
b/src/amd/compiler/aco_optimizer.cpp
index 0543d38a3fa..9203f1c4b43 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -898,9 +898,12 @@ void label_instruction(opt_ctx &ctx, Block& block, 
aco_ptr<Instruction>& instr)
 
    switch (instr->opcode) {
    case aco_opcode::p_create_vector: {
-      bool copy_prop = instr->operands.size() == 1 && 
instr->operands[0].isTemp();
-      if (copy_prop)
+      bool copy_prop = instr->operands.size() == 1 && 
instr->operands[0].isTemp() &&
+                       instr->operands[0].regClass() == 
instr->definitions[0].regClass();
+      if (copy_prop) {
          
ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
+         break;
+      }
 
       unsigned num_ops = instr->operands.size();
       for (const Operand& op : instr->operands) {
@@ -928,8 +931,7 @@ void label_instruction(opt_ctx &ctx, Block& block, 
aco_ptr<Instruction>& instr)
          assert(k == num_ops);
       }
 
-      if (!copy_prop)
-         ctx.info[instr->definitions[0].tempId()].set_vec(instr.get());
+      ctx.info[instr->definitions[0].tempId()].set_vec(instr.get());
       break;
    }
    case aco_opcode::p_split_vector: {

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

Reply via email to