Mesa (master): aco/optimizer: don't propagate subdword temps of different size

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jan 21 11:13:24 UTC 2021


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

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Mon Dec 28 19:15:17 2020 +0000

aco/optimizer: don't propagate subdword temps of different size

It could happen that due to inconsistent copy-propagation

  v1 = p_parallelcopy v2b

instructions were left after optimization on GFX8.

Cc: 20.3
Cc: 21.0

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

---

 src/amd/compiler/aco_optimizer.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index 6952e51fcc4..04676516bbc 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -860,7 +860,8 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr)
          if (info.is_temp() && info.temp.type() == RegType::sgpr) {
             instr->operands[i].setTemp(info.temp);
             info = ctx.info[info.temp.id()];
-         } else if (info.is_temp() && info.temp.type() == RegType::vgpr) {
+         } else if (info.is_temp() && info.temp.type() == RegType::vgpr &&
+                    info.temp.bytes() == instr->operands[i].bytes()) {
             /* propagate vgpr if it can take it */
             switch (instr->opcode) {
             case aco_opcode::p_create_vector:



More information about the mesa-commit mailing list