Commit Graph

24822 Commits

Author SHA1 Message Date
swift-ci
7710ee8a70 Merge pull request #29527 from atrick/fix-escape-assert 2020-01-29 01:27:34 -08:00
Pavel Yaskevich
ec3b783380 [Diagnostics] Improve diagnostic for invalid conversion to AnyObject 2020-01-29 00:37:39 -08:00
Andrew Trick
1af49ecb99 Fix an EscapeAnalysis assert to handle recent changes.
setPointsToEdge should assert that its target isn't already merged,
but now that we batch up multiple merge requests, it's fine to allow
the target to be scheduled-for-merge.

Many assertions have been recently added and tightened in order to
"discover" unexpected cases. There's nothing incorrect about how these
cases were handled, but they lack unit tests. In this case I still
haven't been able to reduce a test case. I'm continuing to work on
it, but don't want to further delay the fix.
2020-01-28 22:54:08 -08:00
swift-ci
a6dcd88219 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-28 18:23:18 -08:00
Max Desiatov
7392c8d01d [WebAssembly] Add no-op MutexWASI.h implementation (#29459)
* [WebAssembly] Add no-op MutexWASI.h implementation

* Update wording of header comment in MutexWASI.h
2020-01-28 18:16:06 -08:00
swift-ci
98bd56e58d Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-28 11:03:20 -08:00
Ravi Kandhadai
566d574f4d Merge pull request #29501 from ravikandhadai/constexpr-binary-integer-description
[Constant Evaluator] Add support for BinaryInteger.description which converts an integer to a string
2020-01-28 11:01:47 -08:00
Ravi Kandhadai
c198c1a2aa [Constant Evaluator] Add support for BinaryInteger.description which
converts an integer to a string. This patch adds a @_semantics
annotation to the BinaryInteger.description function.
2020-01-27 21:13:50 -08:00
swift-ci
8ad3379249 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-27 20:23:22 -08:00
swift-ci
81a6a266aa Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-27 18:23:23 -08:00
David Ungar
7b0cdc48a7 off-off-off! 2020-01-27 18:08:52 -08:00
David Ungar
a2df6b98f5 Merge pull request #29463 from davidungar/PBP-2-21-ICNR-on
[DNM, Incremental: Type-body-fingerprints on-by-default]
2020-01-27 18:03:38 -08:00
swift-ci
52f62ce7da Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-27 18:03:21 -08:00
David Smith
c8fa3b64e5 Merge pull request #29445 from Catfish-Man/fast-dealloc-fixups
Update fast dealloc to match libobjc
2020-01-27 17:47:31 -08:00
swift-ci
36849ea21b Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-27 16:43:23 -08:00
Robert Widmann
423bcdfcdd Merge pull request #29242 from CodaFi/smooth-as-sil-k
[NFC] Define SILGen Request Zone and GenerateSIL Request
2020-01-27 16:30:20 -08:00
David Ungar
4510c2f531 type body prints-on-by-default 2020-01-27 15:14:46 -08:00
David Ungar
8f4fd061f9 Use Optional for fingerprint 2020-01-27 15:14:46 -08:00
David Ungar
0a3be7575a unit tests compile 2020-01-27 15:14:46 -08:00
David Ungar
021a40a98f Coarse + prints -> warning, not error 2020-01-27 15:14:46 -08:00
David Ungar
d61f6f2f66 Changes to support per-type-body fingerprints. 2020-01-27 15:14:46 -08:00
swift-ci
3137a0acab Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-27 08:44:11 -08:00
Erik Eckstein
03b0a6c148 DeadFunctionElimination: remove externally available witness tables at the end of the pipeline
... including all SIL functions with are transitively referenced from such witness tables.

After the last devirtualizer run witness tables are not needed in the optimizer anymore.
We can delete witness tables with an available-externally linkage. IRGen does not emit such witness tables anyway.
This can save a little bit of compile time, because it reduces the amount of SIL at the end of the optimizer pipeline.
It also reduces the size of the SIL output after the optimizer, which makes debugging the SIL output easier.
2020-01-27 14:45:10 +01:00
swift-ci
906a7bc93f Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-27 05:23:22 -08:00
David Zarzycki
3c8fba0fca [AST] NFC: Fix -Wdeprecated-copy warning 2020-01-27 06:35:28 -05:00
swift-ci
a0fd05ffce Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-26 17:43:29 -08:00
Cory Benfield
565298620b [Sanitizers] Add Scudo support (#28538)
LLVM ships a hardened memory allocator called Scudo:
https://llvm.org/docs/ScudoHardenedAllocator.html. This allocator
provides additional mitigations against heap-based vulnerabilities, but
retains sufficient performance to be safely run in production
applications.

While ideal Swift applications are obviously written in pure Swift, in
practice most applications contain some amount of code written in
less-safe languages. Additionally, plenty of Swift programs themselves
contain unsafe code, particularly when attempting to implement
high-performance data structures. These sources of unsafety introduce
the risk of memory issues, and having the option to use the Scudo
allocator is a useful defense-in-depth tool.

This patch enables `-sanitize=scudo` as an extra `swiftc` flag. This
sanitizer is only supported on Linux, so no further work is required to
enable it on Windows or Apple platforms. As this "sanitizer" is only a
runtime component, we do not require any wider changes to instrument
code. This is similar to clang's `-fsanitize=scudo` flag.

The Swift driver rejects platforms that don't support Scudo using an
existing mechanism in the Driver that is not part of this patch. This
mechanism is in swift::parseSanitizerArgValues(...)
(lib/Option/SanitizerOptions.cpp). The mechanism determines if a
sanitizer is supported by checking for the existence of the
corresponding sanitizer runtime library in the compiler's resource
directory. The Scudo runtime library currently only exists in the
Linux compiler resource directory. This results in the driver only
allowing Scudo when targeting Linux.
2020-01-26 17:27:14 -08:00
Robert Widmann
b6fb6ed7ff Add type info for unique_ptr 2020-01-26 14:23:45 -08:00
Robert Widmann
6ec3ab94d2 [NFC] Define SILGen Request Zone and GenerateSIL Request
Define a high-level request for SILGen and switch the high-level
entrypoint to vector through it.
2020-01-26 13:43:52 -08:00
swift-ci
126434e79c Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-25 14:44:33 -08:00
Robert Widmann
e626cfb378 Remove lazy member loading re-entrancy guards
Effectively revert #28907. The request evaluator will also catch re-entrancy here, and those cycles can be broken with NameLookupFlags::IgnoreNewExtensions.
2020-01-25 11:04:53 -08:00
Robert Widmann
b09c9957ad Reintroduce NameLookupFlags::IgnoreNewExtensions
Soft revert a09382c. It should now be safe to add this flag back as an optimization to specifically disable lazy member loading instead of all extension loading.

Push the flag back everywhere it was needed, but also push it into lookup for associated type members which will never appear in extensions.
2020-01-25 11:04:53 -08:00
Robert Widmann
26d8bad7c2 Add DirectLookupRequest 2020-01-25 11:04:53 -08:00
swift-ci
afad2f3018 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-24 23:44:18 -08:00
Ravi Kandhadai
a12fe9ae3b [SIL Optimization] Fix a bug in the identification of dead constant
evaluable calls. The fix makes the check more conservative and
assumes that calls with generic arguments are not dead, as generic
functions with arbitrary side-effects can be invoked through them.

Also, add a few helper functions to the InstructionDeleter utility
that will enable deleting an instruction along with its users.
2020-01-24 19:00:16 -08:00
swift-ci
2fa9f63aa7 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-24 18:24:41 -08:00
nate-chandler
4bc78376aa Merge pull request #29442 from nate-chandler/generic-metadata-prespecialization-components/future-availability
[metadata prespecialization] Future availability.
2020-01-24 18:21:43 -08:00
David Smith
c6a428f3d9 Update fast dealloc to match libobjc 2020-01-24 15:32:27 -08:00
Nate Chandler
23ff5f8964 [metadata prespecialization] Future availability.
Metadata prespecialization will be available after Swift 5.2.
2020-01-24 14:46:30 -08:00
swift-ci
6238289313 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-24 10:24:34 -08:00
Meghana Gupta
5285bf7200 Turn off speculative devirtualization by default. (#29359)
Turn off speculative devirtualization by default. Add a flag to support enabling the pass.
Fixes rdar://58778959 and rdar://58429282
2020-01-24 10:23:06 -08:00
Dan Zheng
8c17687e02 Merge pull request #29405 from dan-zheng/autodiff-upstream-sil-diff-param
[AutoDiff upstream] Add `@noDerivative` flag to `SILParameterInfo`.
2020-01-24 10:10:04 -08:00
Dan Zheng
2d08a3f7e2 [AutoDiff upstream] Add SIL derivative function type calculation. (#29396)
Add `SILFunctionType::getAutoDiffDerivativeFunctionType`.

It computes the derivative `SILFunctionType` for an "original"
`SILFunctionType`, given:

- Differentiability parameter indices
- Differentiability result index
- Derivative function kind
- Derivative function generic signature (optional)
- Other auxiliary parameters

Add doc comments explaining typing rules, preconditions, and other details.

Partially resolves TF-1124.
Unblocks upstreaming other SIL differentiable programming infrastructure.
2020-01-24 10:09:29 -08:00
swift-ci
5ef7482da1 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-24 09:43:51 -08:00
Andrew Trick
7b611fcb1a Merge pull request #29410 from atrick/escape-verify-unmapped
Add EscapeAnalysis verification to catch unmapped SILValues.
2020-01-24 09:43:23 -08:00
Mike Ash
cd2b54f74e Merge branch 'master' into master-rebranch 2020-01-24 11:30:32 -05:00
Hamish Knight
ce7654423a Re-apply "Don't heap allocate for active requests" (#29391)
Re-apply "Don't heap allocate for active requests"
2020-01-24 07:16:35 -08:00
David Ungar
ab99ae24a1 Merge pull request #29379 from apple/fine-grained-on-by-default
[Incremental] Turn fine-grained-dependencies on-by-default.
2020-01-24 00:04:54 -08:00
kelvin13
1715ebcf9d address more reviewed issues 2020-01-23 22:46:30 -06:00
Hamish Knight
8c1374786d [Basic] Avoid reentrant stat collection (#29407)
[Basic] Avoid reentrant stat collection
2020-01-23 20:18:29 -08:00