Commit d881f92
committed
[OSSACanonicalizeOwned] Only discover defs once.
The utility performs two def-use traversals. The first determines
liveness from uses. The second rewrites copies.
Previously, the defs whose uses were analyzed were discovered twice,
once during each traversal. The non-triviality of the discovery logic
(i.e. the logic determining when to walk into the values produced by the
instructions which were the users of visited uses) opened the
possibility for a divergence between the two discoveries. This
possibility had indeed been realized--the two traversals didn't visit
exactly the same uses, and issues ensue.
Here, the defs whose uses are analyzed are discovered only once (and not
discarded as their uses are analyzed) during the first traversal. The
second traversal reuses the defs discovered in the first traversal,
eliminating the possibility of a def discovery difference.
The second traversal is now done in a different order. This results in
perturbing the SIL in certain cases.1 parent 5ac7226 commit d881f92
File tree
2 files changed
+3
-22
lines changed- lib/SILOptimizer/Utils
- test/SILOptimizer
2 files changed
+3
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1161 | 1161 | | |
1162 | 1162 | | |
1163 | 1163 | | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
| 1164 | + | |
1174 | 1165 | | |
1175 | 1166 | | |
1176 | 1167 | | |
| |||
1180 | 1171 | | |
1181 | 1172 | | |
1182 | 1173 | | |
1183 | | - | |
1184 | | - | |
1185 | | - | |
1186 | | - | |
1187 | | - | |
1188 | 1174 | | |
1189 | 1175 | | |
1190 | 1176 | | |
| |||
1217 | 1203 | | |
1218 | 1204 | | |
1219 | 1205 | | |
1220 | | - | |
1221 | | - | |
1222 | 1206 | | |
1223 | | - | |
1224 | | - | |
1225 | | - | |
1226 | | - | |
| 1207 | + | |
1227 | 1208 | | |
1228 | 1209 | | |
1229 | 1210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| |||
0 commit comments