Commit Graph

12522 Commits

Author SHA1 Message Date
simon gladman
f3bdb4b835 Swift overlays to vDSP dot product, hypotenuse, and distance squared operations. 2019-03-14 10:50:00 +00:00
Saleem Abdulrasool
4f3a9ac46c Merge pull request #23199 from compnerd/trimming-the-fat
build: excise the concept of fat libraries
2019-03-13 16:58:39 -07:00
Mike Ash
48f9ac9de5 [Stdlib] Reconstitute the documentation part of the comment on AnyKeyPath. 2019-03-13 15:56:00 -04:00
Erik Eckstein
3c73685b93 runtime: avoid memory allocations in checkTransitiveCompleteness
Use SmallVector instead of std::vector and a SmallPtrSet-like implementation for the set.
2019-03-13 11:49:58 -07:00
Erik Eckstein
abccbd8c8c runtime: make the old remangler allocation free.
Extract common code from the old and new remangler into a common base class.
This lets the old remangler benefit from the changes I did recently in the new remangler.
2019-03-13 11:49:58 -07:00
Erik Eckstein
4186c69103 runtime: Fix a compiler warning in release the build 2019-03-13 11:49:58 -07:00
Mike Ash
c38f613aec [Stdlib] Remove a / from the comment describing the ObjC runtime name for AnyKeyPath.
With three /'s, it got interpreted as documentation, which it definitely is not meant to be.
2019-03-13 13:59:53 -04:00
simon gladman
d069a1e063 Rename vDSP reduction functions to disambiguate at every use site. 2019-03-13 16:49:54 +00:00
simon gladman
99d8e573c6 vDSP - Swift overlays to vDSP_desamp and vDSP_deq22. 2019-03-13 15:34:11 +00:00
simon gladman
34e8b1afbe Add missing operations: vDSP_sve_svesq and vDSP_sve_svesqD. 2019-03-13 14:57:27 +00:00
simon gladman
92dc74330a vDSP Vector Reduction Functions
Swift overlays to functions for summing, averaging, and finding extrema in collections.

Note current guidance is to not abbreviate "minimum" and "maximum" in new APIs, hence me avoiding `min` and `max` function names.
2019-03-13 13:40:47 +00:00
Mike Ash
597dcd8f3f [Stdlib][Frontend][CMake] Remove SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT option, make it permanently on. 2019-03-13 09:31:50 -04:00
simon gladman
49246470f8 vDSP Elementwise Vector-Vector and Vector-Scalar Arithmetic
A suite of Swift overlays to the vDSP elementwise arithmetic operations.
2019-03-13 10:53:45 +00:00
simon gladman
c64f42a763 Replace using single element arrays to pass scalar values with withUnsafePointer. 2019-03-13 10:08:10 +00:00
Saleem Abdulrasool
4b9e9d3164 build: excise the concept of fat libraries
This was used for the swift-reflection-test tool.  Instead of using fat
binaries, use the target binary itself.  This simplifies the build logic
as well as paves the road to sub-builds for each target rather than a
monolithic build as we have today.

Originally, the swift-reflection-test was a host tool that linked
against the target libraries since it was testing the target layout.
Now that the tool has been split into a host and target component
(5ea5bb06a3) and we have target and host
libraries that we can link against appropriately, we do not need to link
against the FAT binary.  Since there was exactly one use of this
functionality, switching that from fat linking to regular linking allows
us to remove this functionality entirely.  Switch to regular linking and
remove the option.
2019-03-12 22:30:20 -07:00
Itai Ferber
0235a81cd5 Merge pull request #23244 from itaiferber/data-underestimated-sequence-initializer-fix
Fix off-by-one when initializing Data with discontiguous, underestimated Sequences
2019-03-12 19:25:06 -07:00
Itai Ferber
7ce6f840d1 Fix off-by-one when initializing Data with discontiguous, underestimated sequences 2019-03-12 14:26:58 -07:00
simon gladman
c2d286bbf5 vDSP Miscellaneous Conversions
This commit contains operations for:

* Split complex to/from interleaved complex conversion.
* Polar to/from rectangular coordinate conversion.
* Power and amplitude to decibel conversion.
2019-03-12 15:27:36 +00:00
simon gladman
12374f3a49 Swift Overlays to Accelerate vDSP Polynomial Evaluation Functions 2019-03-12 11:54:40 +00:00
simon gladman
d80065d5c6 Swift overlays to Accelerate.vDSP clipping, limit, and threshold operations. 2019-03-12 11:06:09 +00:00
Saleem Abdulrasool
8ed5c1a4bc build: introduce and switch to GYB_SOURCES
This avoids us having to pattern match every source file which should
help speed up the CMake generation.  A secondary optimization is
possible with CMake 3.14 which has the ability to remove the last
extension component without having to resort to regular expressions.  It
also helps easily identify the GYB'ed sources.
2019-03-11 13:48:54 -07:00
Stephen Canon
20a1781842 Minor improvement for the documentation of ulp and ulpOfOne. (#23211)
1. Move discussion of `DBL_EPSILON` etc. onto `ulpOfOne` instead of `ulp`.
2. Add text explaining that `ulpOfOne` is a poor value to use for approximate comparison.
2019-03-11 13:06:41 -04:00
simon gladman
6b7d7f6702 Merge remote-tracking branch 'refs/remotes/origin/accelerate-vDSP-conversion' 2019-03-11 16:57:27 +00:00
simon gladman
be81f917ee fix version numbers 2019-03-11 16:51:58 +00:00
simon gladman
5d63ddea51 Fix version numbers 2019-03-11 16:50:38 +00:00
simon gladman
6e502046c5 version number fix. 2019-03-11 16:47:24 +00:00
simon gladman
3cf79534b6 Accelerate vDSP Fill, Clear, and Generation Operations
A suite of Swift overlays to vDSP's fill, clear, window, and ramp generation operations.
2019-03-11 16:32:17 +00:00
simon gladman
6b2467337e Reorder parameters in comments. 2019-03-11 13:47:57 +00:00
simon gladman
f7360adac4 Swift Overlays to Accelerate.vDSP Integration Operations 2019-03-11 13:46:41 +00:00
USAMI Kosuke
aa9a0d4b16 Fix document : Numeric -> AdditiveArithmetic 2019-03-11 21:58:43 +09:00
Saleem Abdulrasool
14d771436c WinSDK: add some constants from CommCtrl
This exposes the common control window class name constants to the Swift
side enabling the use of these constants to create Windows.
2019-03-10 21:23:59 -07:00
Saleem Abdulrasool
0e7ff6582a WinSDK: add CW_USEDEFAULT to the SDK overlay 2019-03-10 18:34:24 -07:00
Simon Gladman
d840cd9a21 Code Review Fixes
* Correct copyright year from 2017 to 2019
* `towardsZero` -> `towardZero`
* `towardsNearestInteger` -> `towardNearestInteger`
2019-03-09 15:26:59 +00:00
Saleem Abdulrasool
2c5fe7dbd8 build: try to fix swift-reflection-test harder
Ensure that the symbol is marked for DLL import rather than just as a local.
2019-03-08 21:33:59 -08:00
swift-ci
70a0d4a5a1 Merge pull request #23182 from davezarzycki/latest_clang_build_fix 2019-03-08 11:02:18 -08:00
simon gladman
e9e9b4eac7 Fix availability check in tests. 2019-03-08 17:39:11 +00:00
David Zarzycki
b032d0b38f [Runtime] NFC: Move LLVM_ATTRIBUTE_USED from declaration to definition
This is both more correct and now required to keep building with
top-of-tree clang.
2019-03-08 12:35:53 -05:00
Saleem Abdulrasool
fbd456b84d SwiftRemoteMirror: repair the windows build
This symbol is meant to be exposed to users of the SwiftRemoteMirror
library which requires that it is explicitly marked with the appropriate
DLL storage on Windows.  This should repair the Windows build.
2019-03-08 07:59:21 -08:00
Saleem Abdulrasool
d4757d4b7a Merge pull request #22857 from compnerd/foreign-imports
IRGen: lazy initialize ForeignClassMetadata
2019-03-07 21:34:31 -08:00
Michael Gottesman
993347d132 Merge pull request #23176 from gottesmm/pr-ab2244e640285dbd76ecd7672e5cfe8338125021
[cmake] Do not generate the sib targets by default
2019-03-07 21:32:08 -08:00
Karoy Lorentey
5b9ab59515 [Foundation] NSSet, NSDictionary: Use as! casts to force-bridge elements
This traps with a clear runtime error on failure, rather than simply crashing in the runtime.
2019-03-07 19:57:13 -08:00
Michael Gottesman
cfbb97af79 [cmake] Add an option to enable/disable creation of "sib" stdlib targets and disable it by default.
These aren't really being used and generating these cause unnecessary configure
time in cmake.
2019-03-07 19:43:39 -08:00
Andrew Trick
404cf73ca6 Merge pull request #23111 from atrick/dominating-access-algo
Change the algorithm for the AccessEnforcementDom pass.
2019-03-07 16:51:18 -08:00
Saleem Abdulrasool
3f829c28d2 IRGen: lazy initialize ForeignClassMetadata
This is needed for Windows which does not support cross-module data
references without indirection.  By lazy initializing the data, we can
indirect through the IAT for the data pointer and fill in the parent
pointer.
2019-03-07 16:19:07 -08:00
Saleem Abdulrasool
68cb52a351 Merge pull request #23168 from compnerd/invalid-invalid
WinSDK: overwrite `INVALID_FILE_ATTRIBUTES`
2019-03-07 15:14:50 -08:00
swift-ci
74d1322a72 Merge pull request #23119 from ravikandhadai/array-init-semantics 2019-03-07 14:17:34 -08:00
Andrew Trick
3da2cc9e06 Clarify comments. 2019-03-07 13:48:41 -08:00
Mike Ash
c4434fe2a9 Merge pull request #23064 from mikeash/dynamically-select-is-swift-bit
[Runtime] Dynamically select the is-Swift bit at runtime on Apple platforms.
2019-03-07 16:48:15 -05:00
Saleem Abdulrasool
52054d2443 WinSDK: overwrite INVALID_FILE_ATTRIBUTES
`INVALID_FILE_ATTRIBUTES` is imported as a signed value which will
overflow the unsigned usage.  Explicitly create it in the SDK overlay.
2019-03-07 13:30:47 -08:00
Andrew Trick
f4c7d4611f Change the algorithm for the AccessEnforcementDom pass.
This adds a mostly flow-insensitive analysis that runs before the
dominator-based transformations. The analysis is simple and efficient
because it only needs to track data flow of currently in-scope
accesses. The original dominator tree walk remains simple, but it now
checks the flow insensitive analysis information to determine general
correctness. This is now correct in the presence of all kinds of nested
static and dynamic nested accesses, call sites, coroutines, etc.

This is a better compromise than:

(a) disabling the pass and taking a major performance loss.

(b) converting the pass itself to full-fledged data flow driven
optimization, which would be more optimal because it could remove
accesses when nesting is involved, but would be much more expensive
and complicated, and there's no indication that it's useful.

The new approach is also simpler than adding more complexity to
independently handle to each of many issues:

- Nested reads followed by a modify without a false conflict.
- Reads nested within a function call without a false conflict.
- Conflicts nested within a function call without dropping enforcement.
- Accesses within a generalized accessor.
- Conservative treatment of invalid storage locations.
- Conservative treatment of unknown apply callee.
- General analysis invalidation.

Some of these issues also needed to be considered in the
LoopDominatingAccess sub-pass. Rather than fix that sub-pass, I just
integrated it into the main pass. This is a simplification, is more
efficient, and also handles nested loops without creating more
redundant accesses. It is also generalized to:
- hoist non-uniquely identified accesses.
- Avoid unnecessarily promoting accesses inside the loop.

With this approach we can remove the scary warnings and caveats in the
comments.

While doing this I also took the opportunity to eliminate quadratic
behavior, make the domtree walk non-recursive, and eliminate cutoff
thresholds.

Note that simple nested dynamic reads to identical storage could very
easily be removed via separate logic, but it does not fit with the
dominator-based algorithm. For example, during the analysis phase, we
could simply mark the "fully nested" read scopes, then convert them to
[static] right after the analysis, removing them from the result
map. I didn't do this because I don't know if it happens in practice.
2019-03-07 12:39:53 -08:00