Skip to content

[pull] swiftwasm from master #1279

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 12 commits into from
Jun 22, 2020
Merged

[pull] swiftwasm from master #1279

merged 12 commits into from
Jun 22, 2020

Conversation

pull[bot]
Copy link

@pull pull bot commented Jun 22, 2020

See Commits and Changes for more details.


Created by pull[bot]. Want to support this open source service? Please star it : )

dan-zheng and others added 12 commits June 18, 2020 20:46
head -c, to print the specified number of bytes, is a GNU extension.
Using dd for the same task should be somewhat more portable.

Mac OS X does not have status=none, so redirect the status output away
instead. Despite appearances, redirecting with the Bourne shell-ism
`2>/dev/null` is fine on Windows since Windows executes with the
internal lit shell runner, which translates `/dev/null` to a temporary
file.
…ntial_addr.

Look "through" those instructions when trying to find the underlying objects.
Currently we only have load [take] in OSSA which needed to be changed.
(copy_addr is not handled in MemBehavior at all, yet)

Even if the memory is physically not modified, conceptually it's "destroyed" when the value is taken.
Optimizations, like TempRValueOpt rely on this behavior when the check for may-writes.

This fixes a MemoryLifetime failure in TempRValueOpt.
Only let copy_addr have side effects if the source or destination really aliases with the address in question.
Optimizes copies from a temporary (an "l-value") to a destination.

    %temp = alloc_stack $Ty
    instructions_which_store_to %temp
    copy_addr [take] %temp to %destination
    dealloc_stack %temp

is optimized to

    destroy_addr %destination
    instructions_which_store_to %destination

The name TempLValueOpt refers to the TempRValueOpt pass, which performs a related transformation, just with the temporary on the "right" side.
The TempLValueOpt is similar to CopyForwarding::backwardPropagateCopy.
It's more restricted (e.g. the copy-source must be an alloc_stack).
That enables other patterns to be optimized, which backwardPropagateCopy cannot handle.

This pass also performs a small peephole optimization which simplifies copy_addr - destroy sequences.

    copy_addr %source to %destination
    destroy_addr %source

is replace with

    copy_addr [take] %source to %destination
…ze_nested_class_types

analyze_code_size.py: Improve recognition of nested class types and sort listing by size
SILOptimizer: A new "TempLValueOpt" optimization for copy_addr
[AutoDiff upstream] Add differentiation diagnostics tests.
@pull pull bot merged commit 31c89a5 into swiftwasm Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants