Module: Mesa Branch: main Commit: 16e0c312fa475fe9883f8f3fab0c827d9059472b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=16e0c312fa475fe9883f8f3fab0c827d9059472b
Author: Rhys Perry <[email protected]> Date: Fri Jan 28 14:49:50 2022 +0000 aco: preserve pass_flags during format conversions This helps the "vopc() & exec" optimization. fossil-db (Sienna Cichlid): Totals from 1638 (1.21% of 134913) affected shaders: CodeSize: 3331804 -> 3327520 (-0.13%); split: -0.19%, +0.06% Instrs: 611807 -> 610096 (-0.28%) Latency: 5579326 -> 5574874 (-0.08%) InvThroughput: 936782 -> 936731 (-0.01%); split: -0.01%, +0.00% Copies: 43324 -> 43302 (-0.05%); split: -0.06%, +0.01% Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14773> --- src/amd/compiler/aco_ir.cpp | 4 ++++ src/amd/compiler/aco_optimizer.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/amd/compiler/aco_ir.cpp b/src/amd/compiler/aco_ir.cpp index 1b624e4b930..4f9091f9e24 100644 --- a/src/amd/compiler/aco_ir.cpp +++ b/src/amd/compiler/aco_ir.cpp @@ -289,6 +289,8 @@ convert_to_SDWA(chip_class chip, aco_ptr<Instruction>& instr) if (instr->operands.size() >= 3) instr->operands[2].setFixed(vcc); + instr->pass_flags = tmp->pass_flags; + return tmp; } @@ -375,6 +377,8 @@ convert_to_DPP(aco_ptr<Instruction>& instr, bool dpp8) if (instr->operands.size() >= 3) instr->operands[2].setFixed(vcc); + instr->pass_flags = tmp->pass_flags; + return tmp; } diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 537f3d4b1b9..85701c0b70b 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -607,6 +607,8 @@ to_VOP3(opt_ctx& ctx, aco_ptr<Instruction>& instr) } /* we don't need to update any instr_mod_labels because they either haven't * been applied yet or this instruction isn't dead and so they've been ignored */ + + instr->pass_flags = tmp->pass_flags; } bool
