From 207b2cd4340f18fa48038ad7b19c0e02a27d0f29 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 17 Jun 2021 14:15:09 +0100 Subject: [PATCH] aco: find scratch reg for sub-dword psuedo instructions which read sgprs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If there's a sgpr operand before a sub-dword operand, a scratch register will not be found on GFX6/7. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index 95e5540..e5111c1 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -1787,10 +1787,8 @@ handle_pseudo(ra_ctx& ctx, const RegisterFile& reg_file, Instruction* instr) bool reads_sgpr = false; bool reads_subdword = false; for (Operand& op : instr->operands) { - if (op.isTemp() && op.getTemp().type() == RegType::sgpr) { + if (op.isTemp() && op.getTemp().type() == RegType::sgpr) reads_sgpr = true; - break; - } if (op.isTemp() && op.regClass().is_subdword()) reads_subdword = true; } -- 2.7.4