forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 30
[pull] swiftwasm from main #5429
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
Merged
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
Clients may not want the lifetime to be fixed up.
When rewriting forwards, don't fix the lifetime which results in spurious lifetime ends.
...when running on Apple Silicon Addresses rdar://108794689
If `FuncDeclRef` is `null` we shouldn’t be trying to get any parameters from it.
…re in the stress tester
…tlang#65768) ...when running on Apple Silicon Addresses rdar://108794689
Handle a gap while matching SIL patterns for hoisting array bound checks
…ang#65814) We should no longer say "macro implementation must be provided via '-load-plugin-library'" as there are multiple ways to pick up a macro dependency. Here's an improved version: > warning: external macro implementation type 'MissingModule.MissingType' could not be found for macro 'missingMacro1'; the type must be public and provided by a macro target in a Swift package, or via '-plugin-path' or '-load-plugin-library'
This reverts commit be845f1.
…STScope. The previous code made the assumption that the ASTScope for a variable declaration should be the one of the declaration's source location. That is not necessarily the case, in some cases it should be an ancestor scope. This patch introduces a map from ValueDecl -> ASTScope that is derived from querying each ASTScope for its locals, which matches also what happens in name lookup. This patch also fixes the nesting of SILDebugScopes created for guard statement bodies, which are incorrectly nested in the ASTScope hierarchy. rdar://108940570
Use the signature to get the function type when getting Swift function pointer callees. This is okay because there is a previous call to cast to that type using the Signature
…-fixes [CodeCompletion] Fix two crashers found by the stress tester
… an address argument instead of an object. The signature was already correct, just the logic in the deinit code assumed that we would always have an object. rdar://109170069
… resilient guaranteed arguments. The only difference from normal concrete guaranteed parameter emission is we have a load_borrow on the argument before the copy_value. That is instead of: ``` bb0(%0 : @guaranteed $Type): %1 = copy_value %0 %2 = mark_must_check [no_consume_or_assign] %1 ``` we have, ``` bb0(%0 : $*Type): // in_guaranteed %1 = load_borrow %0 %2 = copy_value %1 %3 = mark_must_check [no_consume_or_assign] %2 ``` So I just needed to update the checker to recognize that pattern. This is tested by just making sure that the checker can handle the borrowVal in the tests without emitting an error. rdar://109170906
…ow if we call a resilient function that takes it in_guaranteed. This ensures that given a class that contains a noncopyable type that contains another noncopyable type: ``` @_moveOnly struct S2 {} @_moveOnly struct S { var s2: S2 } class C { var s: S } ``` if we call a resilient function that takes C.S.S2: ``` borrowVal(c.s.s2) ``` we properly spill s2 onto the stack using a store_borrow. Why Do This? ------------ Currently SILGenLValue treats ref_element_addr as a base that it needs to load from for both copyable and non-copyable types. We keep a separation of concerns and require emission of resilient functions to handle these loaded values. For copyable types this means copying the value and storing it into a temporary stack allocation. For noncopyable types, we never actually implemented this so we would hit an error in SILGenApply telling us that our resilient function expected an address argument, but we are passing an object. To work around this, I updated how we emit borrowed lvalue arguments to in this case to spill the value into a temporary allocation using a store_borrow. I also included a test that validates that we properly have a read exclusivity scope around the original loaded from memory for the entire call site so even though we are performing a load_borrow and then spilling it, we still have read exclusivity to the original memory for the entire region meaning that we still preserve the semantics. rdar://109171001
I hit a weird bug where for some reason it wasn't working. I can't reproduce it now, so it makes sense to use the correct syntax.
refactor two swift passes
Derive the SILDebugScope for a variable declaration from its owning ASTScope.
The new LexicalLifetimes suppressible language feature results in declarations annotated with @_eagerMove, @_noEagerMove, and @_lexicalLifetimes to be printed with that attribute when it's available and without it when it's not.
…oves the self parameter of a method When dropping the self metatype parameter of a method, it must become a "thin" function. Fixes a crash when using performance annotations. rdar://107202455
The module doesn't necessarily need to be in a valid state when de-serializing a function
This was a leftover from the time we didn't use C++ interop
Performance annotations can now be used without specifying this option
…the `Deallocation` protocol
as a shortcut for `Instruction.setOperand`
…ng to a separate function pass This allows to run the NamedReturnValueOptimization only late in the pipeline. The optimization shouldn't be done before serialization, because it might prevent predictable memory optimizations in the caller after inlining.
…ries Instead bail when trying to deleted a dead closure or when performing the apply-of-partial_apply optimization. TODO: In OSSA this should be solvable without the need of copies to temporaries.
… partial_apply * move the apply of partial_apply transformation from simplify-apply to simplify-partial_apply * delete dead partial_apply instructions * devirtualize apply, try_apply and begin_apply
* `Options.assertConfiguration` * `Argument.isIndirectResult` * in `Function`: `selfArgument`, `isTransparent`, `performanceConstraints` and `inlineStrategy` * `BuiltinInst.substitutionMap` * `SubstitutionMap.replacementTypes` * `Type.canBeClass`
As a replacement for the old MandatoryGenericSpecializer The pass it not enabled yet in the pass pipeline
…PerformanceOptimizations in the pipeline
…ions Fix several problems with performance annotations
…aranteed-value/dont-hoist-forwards [CanonicalizeGuaranteedValue] Rewrite forwards in place.
…_pointer_fix IRGen: Another fix for compiling LLVM opaque pointers
Fixes a verifier crash caused by a not properly nested alloc-dealloc pair rdar://109204178
…age_feature [AST] Added language feature for @_eagerMove.
…consuming use instead of liveness use. rdar://109217216
…e_borrow if we are using lowered addresses. When opaque values are enabled, we do not need this store_borrow. This was caught by the following tests: Swift(macosx-x86_64) :: SILGen/opaque_values_silgen.swift Swift(macosx-x86_64) :: SILGen/opaque_values_silgen_resilient.swift
SIL Optimizer: handle dead-end infinite loops in StackNesting
…7297f17557ddd02a5567ce7 [sil-optimizer] Add LLVM_DEBUG statements to escaping capture diagnostics
…fda427c5ce8d64de2158c85 [move-only] Fix a thinko where we are treating inout convention as a consuming use instead of liveness use.
[move-only] Batched resilient changes
…out-copyable add even more test coverage for parsing `~Copyable`
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.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )