]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
amdgcn: Add waitcnt after LDS write instructions
authorJulian Brown <julian@codesourcery.com>
Mon, 10 Feb 2020 20:26:57 +0000 (12:26 -0800)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Thu, 22 Apr 2021 17:14:25 +0000 (10:14 -0700)
Data-share write (ds_write) instructions do not necessarily complete
the write to LDS immediately. When a write completes, LGKM_CNT is
decremented. For now, we wait until LGKM_CNT reaches zero after each
ds_write instruction.

This fixes a race condition in the case where LDS is read immediately
after being written. This can happen with broadcast operations.

2020-07-15  Julian Brown  <julian@codesourcery.com>

gcc/
* config/gcn/gcn-valu.md (scatter<mode>_insn_1offset_ds<exec_scatter>):
Add waitcnt.
(*mov<mode>_insn, *movti_insn): Add waitcnt to ds_write alternatives.

gcc/ChangeLog.omp

index 4f680f0ddd249f253adcbdb90a35b01b0f3b9bb4..882a2fbf473afbfd0f637c59bb0c29165f489268 100644 (file)
@@ -1,3 +1,9 @@
+2020-07-15  Julian Brown  <julian@codesourcery.com>
+
+       * config/gcn/gcn-valu.md (scatter<mode>_insn_1offset_ds<exec_scatter>):
+       Add waitcnt.
+       (*mov<mode>_insn, *movti_insn): Add waitcnt to ds_write alternatives.
+
 2020-07-15  Julian Brown  <julian@codesourcery.com>
 
        * config/gcn/gcn-protos.h (gcn_goacc_adjust_private_decl): Update