summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/amd/compiler/aco_optimizer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index 73b9c653a64..fbeb76df990 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -2682,13 +2682,15 @@ void select_instruction(opt_ctx &ctx, aco_ptr<Instruction>& instr)
/* choose a literal to apply */
for (unsigned i = 0; i < num_operands; i++) {
Operand op = instr->operands[i];
+
+ if (instr->isVALU() && op.isTemp() && op.getTemp().type() == RegType::sgpr &&
+ op.tempId() != sgpr_ids[0])
+ sgpr_ids[!!sgpr_ids[0]] = op.tempId();
+
if (op.isLiteral()) {
current_literal = op;
continue;
} else if (!op.isTemp() || !ctx.info[op.tempId()].is_literal()) {
- if (instr->isVALU() && op.isTemp() && op.getTemp().type() == RegType::sgpr &&
- op.tempId() != sgpr_ids[0])
- sgpr_ids[!!sgpr_ids[0]] = op.tempId();
continue;
}