-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add some swift SIL+Optimizer infrastructure #60745
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
Merged
eeckstein
merged 17 commits into
swiftlang:main
from
eeckstein:swift-sil-infrastructure
Aug 25, 2022
Merged
Add some swift SIL+Optimizer infrastructure #60745
eeckstein
merged 17 commits into
swiftlang:main
from
eeckstein:swift-sil-infrastructure
Aug 25, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To be used to iterate over all instructions in a function without the need of two loops - one for blocks and one for instructions.
E.g. used if function effects are changed. This tells the passmanager that something changed, but no SIL-specific analysis have to be invalidated.
…sting to their own `TestPasses` directory.
It fixes the default reflection for bridged random access collections, which usually have a `bridged` stored property. Conforming to this protocol displays the "real" children of a bridged random access collection and not just `bridged`.
…ailableExternally`
Returning true if the element was not contained in the set before inserting
To add a module pass in `Passes.def` use the new `SWIFT_MODULE_PASS` macro. On the swift side, create a `ModulePass`. It’s run function receives a `ModulePassContext`, which provides access to all functions of a module. But it doesn't provide any APIs to modify functions. In order to modify a function, a module pass must use `ModulePassContext.transform(function:)`.
…dulePassContext`
…ctions` * add `DynamicFunctionRefInst` and `PreviousDynamicFunctionRefInst` * add a common base class to all function-referencing instructions: `FunctionRefBaseInst` * add `KeyPathInst` * add `IndexAddrInst.base` and `IndexAddrInst.index` getters * add `Instruction.visitReferencedFunctions` to visit all functions which are referenced by an instruction
* add `createAllocStack` * add `createDeallocStack` * add `createCopyAddr` * add `@discardableResult` to the existing `createDeallocStackRef`
Provides a list of instructions, which reference a function. A function "use" is an instruction in another (or the same) function which references the function. In most cases those are `function_ref` instructions, but can also be e.g. `keypath` instructions. 'FunctionUses' performs an analysis of all functions in the module and collects instructions which reference other functions. This utility can be used to do inter-procedural caller-analysis.
And move it out of the "proposals" folder, directly into "docs". It's now more a documentation of what we have and useful as a programming guide.
@swift-ci smoke test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR contains a lot of changes which I need for my upcoming work on stack protectors.
Most notably:
FunctionUses
There are many more small additions and improvements. For details see the commit list.