aco: skip value numbering of copies
Instead, copy-propagate through and remove them.
This improves value numbering in this situation:
a = ...
b = copy a
c = copy a
use(b)
use(c)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>
diff --git a/src/amd/compiler/aco_opt_value_numbering.cpp b/src/amd/compiler/aco_opt_value_numbering.cpp
index 11aad20..91e03eb 100644
--- a/src/amd/compiler/aco_opt_value_numbering.cpp
+++ b/src/amd/compiler/aco_opt_value_numbering.cpp
@@ -393,6 +393,7 @@
!instr->definitions[0].isFixed() && instr->operands[0].isTemp() && instr->operands[0].regClass() == instr->definitions[0].regClass() &&
!instr->isDPP() && !((int)instr->format & (int)Format::SDWA)) {
ctx.renames[instr->definitions[0].tempId()] = instr->operands[0].getTemp();
+ continue;
}
instr->pass_flags = ctx.exec_id;