Commit 3e283c4
[Reland] Fix handling of unvisited operands in AxisInfoAnalysis (#8758)
We currently force initialisation of operands that have not yet been
visited with `setToEntryState`. This means that the order in which
values are visited can change the results of the analysis.
This can be a source of bugs. For example, the lowering for
`AsyncCopyGlobalToLocalOp` validates that the load addresses permit
sufficient vectorisation, however, this is up to the analysis actually
recovering the same information it had when the async copy was created.
Otherwise, we crash during lowering. I have an actual repro for this but
it has been very difficult to minimise it enough to make it suitable for
an lit test:
https://gist.github.com/neildhar/7eea6a312afa39d1cc83dc12627c2ba3
Populating the operands in this way also means that we have to handle
control flow like `ForOp` and `IfOp` explicitly in `setToEntryState`,
because we may attempt to populate their results when we visit their
users.
Instead, when we encounter an operation whose operands have not yet been
encountered, skip over the operation entirely. We can revisit it once
the operands have actually been visited. This improves the quality of
the analysis, and leaves the handling of control flow to the dataflow
framework.
This reland adds handling for the case where the dataflow analysis fails
to initialise a particular value (likely because it is determined to be
dead).1 parent 13d7a47 commit 3e283c4
2 files changed
+30
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1079 | 1079 | | |
1080 | 1080 | | |
1081 | 1081 | | |
1082 | | - | |
1083 | | - | |
| 1082 | + | |
1084 | 1083 | | |
1085 | 1084 | | |
1086 | | - | |
| 1085 | + | |
1087 | 1086 | | |
1088 | 1087 | | |
1089 | 1088 | | |
| |||
1112 | 1111 | | |
1113 | 1112 | | |
1114 | 1113 | | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
1118 | 1119 | | |
1119 | 1120 | | |
1120 | 1121 | | |
| |||
1188 | 1189 | | |
1189 | 1190 | | |
1190 | 1191 | | |
1191 | | - | |
1192 | | - | |
1193 | | - | |
1194 | | - | |
1195 | | - | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
1196 | 1196 | | |
1197 | 1197 | | |
1198 | 1198 | | |
1199 | 1199 | | |
1200 | 1200 | | |
1201 | | - | |
1202 | | - | |
1203 | | - | |
1204 | | - | |
1205 | | - | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
1209 | 1201 | | |
1210 | 1202 | | |
1211 | 1203 | | |
| |||
1358 | 1350 | | |
1359 | 1351 | | |
1360 | 1352 | | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
1361 | 1357 | | |
1362 | 1358 | | |
1363 | 1359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1089 | 1089 | | |
1090 | 1090 | | |
1091 | 1091 | | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
0 commit comments