Skip to content

[pull] swiftwasm from main #3638

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 36 commits into from
Oct 2, 2021
Merged

[pull] swiftwasm from main #3638

merged 36 commits into from
Oct 2, 2021

Conversation

pull[bot]
Copy link

@pull pull bot commented Oct 2, 2021

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

al45tair and others added 30 commits September 29, 2021 14:27
…context

If you had a type alias (for instance) with its context set to a static
bound generic function, the generic arguments were remangled in the wrong
place because Node::Kind::Static wasn't handled properly in a couple of
functions.  Fix that.

rdar://82870372
…otocol conformances via !llvm.used.conditional

A new LLVM IR affordance that allows expressing conditions under which globals
can be removed/dropped (even when marked with @llvm.used) is being discussed at:

- <https://reviews.llvm.org/D104496>
- <https://lists.llvm.org/pipermail/llvm-dev/2021-September/152656.html>

This is a preliminary implementation that marks runtime lookup records (namely
protocol records, type descriptors records and protocol conformance records)
with the !llvm.used.conditional descriptors. That allows link-time / LTO-time
removal of these records (by GlobalDCE) based on whether they're actually used
within the linkage unit. Effectively, this allows libraries that have a limited
and known set of clients, to be optimized against the client at LTO time, and
significantly reduce the code size of that library.

Parts of the implementation:
- New -conditional-runtime-records frontend flag to enable using !llvm.used.conditional
- IRGen code that emits these records can now emit these either as a single contiguous
  array (asContiguousArray = true, the old way), which is used for JIT mode, or
  as indivial globals (asContiguousArray = false), which is necessary for the
  !llvm.used.conditional stripping to work.
- When records are emitted as individual globals, they have new names of
  "\01l_protocol_" + mangled name of the protocol descriptor, and similarly for
  other records.
- Fixed existing tests to account for individual records instead of a single array
- Added an IR level test, and an end-to-end execution test to demonstrate that
  the !llvm.used.conditional-based stripping actually works.
use >/< instead of !=

fix some bugs

fix
fix infinite recursion bug

NFC: Remove early ccc check

remember that false is turned on
It gets interpreted as just an executable we feed to the linker, since we launch `emit-pcm` actions via `swift-frontend` invocations, not `clang`.
…se-extra-clang-opts` is specified.

Instead of *just* passing in `ExtraArgs`, we need to make sure to still form a command-line according to Clang's expectation.
The goal here is not to eventually implement a concurrent thread
pool ourselves.  We're just making it easier for integrators who
have their own pool and don't want to use Dispatch to build the
Swift concurrency runtime.  Just hook the right functions and
you should be fine.

The necessary functions to hook are:
- swift_task_enqueueGlobal
- swift_task_enqueueGlobalAfterDelay

The following functions *would* be necessary to hook:
- swift_task_enqueueMainExecutor
- swift_task_asyncMainDrainQueue (only if you have an async main?)
However, this configuration does not currently properly support
the main executor, and so `@MainActor` should be avoided for now.

rdar://83513751
Implement conditional stripping of type descriptors, protocols and protocol conformances via !llvm.used.conditional
…re paths when initializing sub-tuple patterns"

This reverts commit be922b9.

By adding some extra scopes here we are triggering some broken behavior in a
bunch of projects. I am going to see if I can do another fix for this. That
being said in the short term, we are reverting to unblock those projects.

rdar://83770295
…on-ownership

SILGen: Ensure +1 before reabstracting closure BB args.
…rating-conformances

RequirementMachine: Improvements and fixes for generating conformances algorithm
…ency-builds-2

Allow building a concurrent libSwiftConcurrency without libdispatch
Android NDK layout might not be the same as the system layout for
finding libc++ so the test seems to fail. Disabling for the time being
to avoid having the CI broken.
[stdlib] Implement native normalization for String
Fix `'linker' input unused` warnings in Explicit Module Builds
gottesmm and others added 4 commits October 1, 2021 17:54
…48b232ff2a8c75f3334d930

Revert "[silgen] Ensure that the outer cleanup is emitted along failure paths when initializing sub-tuple patterns"
…symbols

Ensure that we only depend on a small expected set of external symbols in the freestanding stdlib
DougGregor and others added 2 commits October 1, 2021 21:25
[Distributed] Fix when we invoke thunk, base it on typesystem implicit effects
[Remangler] Fix remangling in static bound generic function context
@MaxDesiatov MaxDesiatov enabled auto-merge October 2, 2021 10:31
@MaxDesiatov MaxDesiatov merged commit 3702a00 into swiftwasm Oct 2, 2021
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.