To allow further optimizations to s_addk_i32.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15999>
}
}
+ /* allow more s_addk_i32 optimizations if carry isn't used */
+ if (instr->opcode == aco_opcode::s_add_u32 && ctx.uses[instr->definitions[1].tempId()] == 0 &&
+ (instr->operands[0].isLiteral() || instr->operands[1].isLiteral()))
+ instr->opcode = aco_opcode::s_add_i32;
+
ctx.instructions.emplace_back(std::move(instr));
}