Commit c5c5225
committed
[AMDGPU] Handle direct loads to LDS in memory model
Add additional waitcnt insertion to ensure proper ordering between LDS
operations and direct loads from global memory to LDS on pre-GFX10
hardware.
Direct LDS loads perform both a global memory load and an LDS store,
which can be reordered with respect to other LDS operations without
explicit synchronization. This can cause ordering violations even within
a single thread.
The change conservatively inserts vmcnt(0) waits for all sync scopes
when the LDS address space is involved. Future optimizations in
SIInsertWaitcnts can relax this to only wait for outstanding direct LDS
loads rather than all vmcnt events.
This change only affects LDS address space synchronization and preserves
existing cross-address space ordering behavior.1 parent 551d49c commit c5c5225
File tree
5 files changed
+103
-1
lines changed- llvm
- lib/Target/AMDGPU
- test/CodeGen/AMDGPU
- GlobalISel
5 files changed
+103
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1084 | 1084 | | |
1085 | 1085 | | |
1086 | 1086 | | |
| 1087 | + | |
1087 | 1088 | | |
1088 | 1089 | | |
1089 | 1090 | | |
| |||
1104 | 1105 | | |
1105 | 1106 | | |
1106 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
1107 | 1112 | | |
1108 | 1113 | | |
1109 | 1114 | | |
| |||
1149 | 1154 | | |
1150 | 1155 | | |
1151 | 1156 | | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
1152 | 1169 | | |
1153 | 1170 | | |
1154 | 1171 | | |
| |||
0 commit comments