From 4257b87367017755832068b5409025f975b4cc57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Mon, 28 Dec 2020 19:15:17 +0000 Subject: [PATCH] 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 Part-of: (cherry picked from commit 856fd4750daf23ac3f8f40278cf685f36661c19f) --- .pick_status.json | 2 +- src/amd/compiler/aco_optimizer.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index fe4bfc732c5..ecd3cf8647b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2497,7 +2497,7 @@ "description": "aco/optimizer: don't propagate subdword temps of different size", "nominated": false, "nomination_type": null, - "resolution": 4, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 91ec8419bc8..33310f2ea83 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -858,7 +858,8 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr& 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: