-
Notifications
You must be signed in to change notification settings - Fork 385
Validation and inlining don't work together #331
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
Comments
There are some conceptual issues -- validation relies on all locks being released when the function returns, which does not happen after inlining. After inlining, the locks acquired by the "outer" and "inner" function are not distinguishable, so it is not clear currently how that should even look like. |
We probably need to either mark the validation statements as inlined and do some logic here, or properly inline validation statements in the inline pass in rustc. |
The thing is, the statements/model as it is ow can't handle inlining. This needs a conceptual change. For example, rather than just identifying locks by stack frame number, there could be an additional index differentiating the "outer" and "inner" part of the inlined function. That should make inlining invertible; the resulting program is equivalent to the one before inlining. I am worried however that then validation statements will end up being in the way frequently; we'd have to figure out the rules for reordering them with other things. Or maybe, the border between the two functions should somehow "disappear". The release and acquire statements around the call should be gone, and same for the acquire statements in the callee. However, I think this will not handle lifetimes inside the callee that outlive the callee properly. Another option would be to erase validation before doing inlining; however that would probably prevent many useful optimizations that build on validation and are only discoverable after inlining. |
That sounds like an approach in the right direction to me
We can rewrite any statements during inlining if we modify the inlining pass. |
The validation stuff is going to completely change anyway. Closing this. |
I'm not sure what the exact issues are, but we should get them to work
The text was updated successfully, but these errors were encountered: