Commit 6068a5d
committed
[comgr][hotswap] preserve VGPR-MSB mode when splitting gfx1250 WMMAs
The WMMA split pass rewrites gfx1250 B0-only WMMAs into pairs of narrower
WMMAs that also run on A0. On gfx1250, VGPR operands past v255 are reached
through a persistent VGPR-MSB bank mode, so a split whose upper half crosses
v255 (or a K-split whose second half reuses dst as src2) must execute that
half under a different bank.
Make the pass VGPR-MSB aware:
- Recover the live VGPR-MSB mode at each WMMA via a whole-function CFG fixed
point, fail-closed: an ambiguous or unprovable mode declines the split.
- Bracket the upper half with s_set_vgpr_msb (switch before, restore after),
and emit nothing when no bank change is needed.
- Fail closed on every matched-but-unsplittable path (RequiredPatchFailed)
instead of silently leaving an A0-illegal opcode in .text.
Use the same control-flow surface as the rewrite so the mode proof cannot be
seeded from a wrong incoming mode:
- Decline the analysis when collectDirectBranchTargets() reports an unresolved
call target, since such a call may enter any function at an interior offset.
- Resolve absolute-immediate and PC-materialized s_swap_pc_i64 / s_set_pc_i64
targets in the interior-entry pre-pass so a cross-function interior entry
declines the split rather than seeding the symbol-start mode.
- Seed declared kernel-descriptor entries so an interior KD-entry block is
analyzed from the real entry mode rather than misread as unreachable.
Add lit coverage for the bank-crossing, fail-closed, and loop-carried mode
cases, plus interior cross-function s_swap_pc_i64 (materialized and absolute),
an interior s_set_pc_i64 jump, and an interior kernel-descriptor entry.1 parent 4da88cf commit 6068a5d
17 files changed
Lines changed: 1341 additions & 55 deletions
File tree
- amd/comgr
- src
- test-lit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
989 | 989 | | |
990 | 990 | | |
991 | 991 | | |
992 | | - | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
1005 | | - | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
1006 | 1001 | | |
1007 | 1002 | | |
1008 | | - | |
| 1003 | + | |
1009 | 1004 | | |
1010 | 1005 | | |
1011 | 1006 | | |
| |||
1041 | 1036 | | |
1042 | 1037 | | |
1043 | 1038 | | |
1044 | | - | |
| 1039 | + | |
1045 | 1040 | | |
1046 | 1041 | | |
1047 | 1042 | | |
1048 | | - | |
| 1043 | + | |
1049 | 1044 | | |
1050 | 1045 | | |
1051 | 1046 | | |
1052 | 1047 | | |
1053 | 1048 | | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
| 1049 | + | |
| 1050 | + | |
1057 | 1051 | | |
1058 | 1052 | | |
1059 | 1053 | | |
1060 | 1054 | | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
1061 | 1076 | | |
1062 | 1077 | | |
1063 | 1078 | | |
| |||
2273 | 2288 | | |
2274 | 2289 | | |
2275 | 2290 | | |
2276 | | - | |
2277 | | - | |
2278 | | - | |
2279 | | - | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
2280 | 2296 | | |
2281 | 2297 | | |
2282 | 2298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1133 | 1133 | | |
1134 | 1134 | | |
1135 | 1135 | | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
1136 | 1146 | | |
1137 | 1147 | | |
1138 | 1148 | | |
| |||
1158 | 1168 | | |
1159 | 1169 | | |
1160 | 1170 | | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1161 | 1177 | | |
1162 | 1178 | | |
1163 | 1179 | | |
1164 | 1180 | | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
1165 | 1186 | | |
1166 | 1187 | | |
1167 | 1188 | | |
| |||
1277 | 1298 | | |
1278 | 1299 | | |
1279 | 1300 | | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
1280 | 1322 | | |
1281 | 1323 | | |
1282 | 1324 | | |
| |||
0 commit comments