aco: check instruction format before waiting for a previous SMEM store
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 29 Apr 2020 16:47:50 +0000 (17:47 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 28 May 2020 10:34:03 +0000 (10:34 +0000)
Totals from 7 (0.01% of 127638) affected shaders:
CodeSize: 40336 -> 40320 (-0.04%)
Instrs: 7807 -> 7803 (-0.05%)
Cycles: 118588 -> 118344 (-0.21%); split: -0.23%, +0.02%
SMEM: 331 -> 339 (+2.42%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: 1749953ea3 ('aco/gfx10: Wait for pending SMEM stores before loads')
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4880>

src/amd/compiler/aco_insert_waitcnt.cpp

index d2d1c76c6c96200e50df10c9fc70798f4bd90b19..196b45fbb75c071c43826e6cd7f9b30ccbee5438 100644 (file)
@@ -460,7 +460,7 @@ wait_imm kill(Instruction* instr, wait_ctx& ctx)
       imm.lgkm = 0;
    }
 
-   if (ctx.chip_class >= GFX10) {
+   if (ctx.chip_class >= GFX10 && instr->format == Format::SMEM) {
       /* GFX10: A store followed by a load at the same address causes a problem because
        * the load doesn't load the correct values unless we wait for the store first.
        * This is NOT mitigated by an s_nop.