summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRhys Perry <pendingchaos02@gmail.com>2022-07-21 19:23:38 +0100
committerDylan Baker <dylan.c.baker@intel.com>2022-08-11 10:30:38 -0700
commit71703783c22690ad0e14cd3eeb79619706bc04a6 (patch)
treec96ca02bdd5ed8c2dab955f36a9a6334e11a0868
parente63f5e6eb41749f09ae923e3d59c56ea719d80d7 (diff)
downloadmesa-71703783c22690ad0e14cd3eeb79619706bc04a6.tar.gz
aco: fix LdsBranchVmemWARHazard with 2+ branch chains
For example, "DS -> branch -> VMEM -> branch -> DS". fossil-db (navi10): Totals from 639 (0.40% of 161220) affected shaders: Instrs: 629090 -> 628254 (-0.13%); split: -0.19%, +0.06% CodeSize: 3410164 -> 3406748 (-0.10%); split: -0.14%, +0.04% Latency: 7834755 -> 7821011 (-0.18%); split: -0.70%, +0.52% InvThroughput: 1369698 -> 1374495 (+0.35%); split: -0.12%, +0.47% A lot of the fossil-db changes are noise. threekingdoms.8db138826c386a62.1.foz/0b222ed175eebad0 is an example of a shader that actually has this issue. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Fixes: c037ba1bb7a ("aco/gfx10: Mitigate LdsBranchVmemWARHazard.") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17697> (cherry picked from commit b17e59a03b2c31460145b691dc5b39b13e340003)
-rw-r--r--.pick_status.json2
-rw-r--r--src/amd/compiler/aco_insert_NOPs.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 5d6a4c130a7..a7b5fe33c77 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -895,7 +895,7 @@
"description": "aco: fix LdsBranchVmemWARHazard with 2+ branch chains",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "c037ba1bb7aba99bd15e063bbdbc6d4c68cf2384"
},
diff --git a/src/amd/compiler/aco_insert_NOPs.cpp b/src/amd/compiler/aco_insert_NOPs.cpp
index 5dd1c7183e8..69aab519788 100644
--- a/src/amd/compiler/aco_insert_NOPs.cpp
+++ b/src/amd/compiler/aco_insert_NOPs.cpp
@@ -787,6 +787,9 @@ handle_instruction_gfx10(State& state, NOP_ctx_gfx10& ctx, aco_ptr<Instruction>&
wait->definitions[0] = Definition(sgpr_null, s1);
wait->imm = 0;
new_instructions.emplace_back(std::move(wait));
+
+ ctx.has_VMEM = instr->isVMEM() || instr->isGlobal() || instr->isScratch();
+ ctx.has_DS = instr->isDS();
}
/* NSAToVMEMBug