Always inline calls with "not obviously legal" pointer args (instead of the opposite). #1023
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this PR, the behavior of the inliner wrt pointer types in
fn
signatures (and pointer args) was to special-case some illegal cases and force inlining. This PR flips some of that on its head, treating everything it's not sure about as illegal, forcing inlining in all the cases not explicitly deemed legal.Specifically for fixing #1021, the necessary change is obeying the SPIR-V spec about pointer call arguments having to be "memory object declarations" (i.e. an
OpVariable
, or one of the caller's ownOpFunctionParameter
s, which transitively must be a wholeOpVariable
etc.).With this PR, any pointer argument other than an
OpVariable
(either global or in the caller) or anOpFunctionParameter
, will force inlining (even if some of those edge cases may actually be legal, we'll still be correctly conservative).(The several commits should be reviewed separately, as the first 3 only refactor
linker::inline
's existing logic)