-
Notifications
You must be signed in to change notification settings - Fork 10.5k
EscapeAnalysis verification: fix false positives. #29316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When ConnectionGraph merging triggers an assert, report which functions are being merged.
@swift-ci test |
@swift-ci test source compatibility |
@swift-ci benchmark |
Performance: -OCode size: -OPerformance: -OsizeCode size: -OsizePerformance: -Onone
Code size: -swiftlibsHow to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
Don't merge node properties until after node merging begins, so internal verification can run right before each merge. Rework ConnectionGraph::mergeFrom. Remove an extra loop. Defer mergeAllScheduledNodes until all the source graph's mapped nodes are added so that the graph is always structurally valid before a merge. This is also necessary to avoid EscapeAnalysis assert: (!To->mergeTo), in setPointsToEdge. Enable -escapes-internal-verify to all tests in escape_analysis.sil. Add hand-reduced unit tests in escape_analysis_reduced.sil.
Noticed by code inspection during debugging. This avoids some work but is probably NFC.
Noticed by code inspection during debugging. Iterator invalidaton could occur because two types of edges, which are handled independently, actually share the same phyical list. Fix the visitor utility that iterates over defer edges to be robust for visitors that change the pointsTo edge. Use a temporary vector to be safe.
Defer edges should always point to the more specific SSA value. For example, the contents of a memory location point to the values stored in that locations. Tuples point to their elements. BBArgs point to their source operands. Likewise, array objects should point to their exposed unsafe pointer (which is effectively a value stored in the array object). I'm not sure why the defer edges were reversed in the first place, but it was always confusing me.
Consistently handle base and derived pointers. Consistently avoid creating nodes for undef, which breaks verification. Be more precise about creating the node based on the derived pointer type. Remove a few extraneous helpers. Fixes <rdar://58445744> swiftc assert during EscapeAnalysis verification: (EA->isPointer(Nd->mappedValue)), function verify
@swift-ci test |
@swift-ci test source compatibility |
Build failed |
Build failed |
This is a collection of EscapeAnalysis commits related to verification. It fixes some false positives while making the analysis results a bit more precise and consistent.
They are easier to review independently, but easier to push through as one PR. An open bug is waiting on the last commit in the series.
Fixes rdar://58445744 swiftc assert during EscapeAnalysis verification: (EA->isPointer(Nd->mappedValue)), function verify