forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 29
[pull] swiftwasm from main #2028
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
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
This refactoring removes a lot of special-casing in collectLoads and also makes tryOptimizeStoreIntoTemp simpler. It's a NFC.
It's sufficient to pass the operand instead of the operand, the user and the operand value. NFC.
…to checkNoSourceModification ... where it belongs. This is mostly refactoring, but it also fixes a bug: we don't recurse into a begin_access in collectLoads. If there is an apply in such a scope, the mayWrite-check wouldn't be done. In checkNoSourceModification all instructions are visited, so the check is always done.
Consider the related end_access instructions as uses to correctly mark the end of the lifetime of the temporary. This fixes a miscompile in case there is a modification of the copy-source between an begin_access and end_access.
load [take] was not considered as a use and it was not detected if it's in a different basic block. This fixes a miscompile in case there is a modification of the copy-source before a load [take]. rdar://problem/69757314
... and use that API in FullApplySite::insertAfterInvocation. Also change FullApplySite::insertAfterInvocation/insertAfterFullEvaluation to directly pass a SILBuilder instead of just an insertion point to the callback. This makes more sense (given the function names) and simplifies the usages. It's a NFC.
…dr [take] Instead of reusing the existing destroy_addr (or load/copy_addr [take]) of the temporary, insert a new destroy_addr - at the correct location. This fixes a memory lifetime failure in case the copy-source is modified (actually: re-initialized) after the last use of the temporary: E.g. (before copy elimination): copy_addr [take] %src to [initialization] %temp %x = load %temp // last use of %temp store %y to [init] %src destroy_addr %temp The correct location for the destroy_addr is after the last use (after copy elimination): %x = load %src destroy_addr %src store %y to [init] %src rdar://problem/69757314
…temporary. This fixes a memory lifetime failure.
…n in non-OSSA mode. In OSSA, memory locations are always destroyed in a "visible" way, e.g. with destroy_addr or load [take].
…-commandline-test [XFAIL] Disable validation-test/stdlib/CommandLine.swift (70423908)
Fix several correctness issues in TempRValueOpt
…infinity (swiftlang#34339) Previously, overflow and underflow both caused this to return `nil`, which causes several problems: * It does not distinguish between a large but valid input and a malformed input. `Float("3.402824e+38")` is perfectly well-formed but returns nil * It differs from how the compiler handles literals. As a result, `Float(3.402824e+38)` is very different from `Float("3.402824e+38")` * It's inconsistent with Foundation Scanner() * It's inconsistent with other programming languages This is exactly the same as swiftlang#25313 Fixes rdar://problem/36990878
MaxDesiatov
approved these changes
Oct 19, 2020
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]. Want to support this open source service? Please star it : )