Commit Graph

39091 Commits

Author SHA1 Message Date
Andrew Trick
8636c39259 Fix assert in MemAccessUtils isLetAccess
Assertion failed:
(accessedAddress == getAccessedAddress(accessedAddress) &&
"caller must find the address root"), function isLetAddress,
file /Users/rjmccall/dev/swift/swift/lib/SIL/Utils/MemAccessUtils.cpp,
line 63.

Teach the getAccessedAddress utility to iterate through nested access
markers with projections interposed.

Fixes <rdar://problem/61464370>
Crash in SILOptimizer/access_marker_verify.swift
2020-04-08 22:04:16 -07:00
Dario Rexin
2257667ad3 Merge pull request #30864 from drexin/wip-fix-static-executable
Fix linker flags for -static-executable
2020-04-08 22:01:40 -07:00
Dan Zheng
c142fcf6e2 [AutoDiff] Add SynthesizedFileUnit TBDGen/serialization tests.
Upstream `SynthesizedFileUnit` failing tests from TF-1239.
2020-04-08 21:22:06 -07:00
Saleem Abdulrasool
f46492f7a4 test: support long paths in rewrite-module-triples
The path that the tests are using here are extremely long, and can
easily exceed the 261 character limit on Windows.  Apply some
workarounds to support long paths.
2020-04-08 21:15:34 -07:00
Argyrios Kyrtzidis
1b26b96f05 Merge pull request #30897 from dan-zheng/autodiff-cleanup
[AutoDiff] Clean up syntax.
2020-04-08 21:07:01 -07:00
Mishal Shah
245eac55b5 Merge pull request #30908 from compnerd/30819
Fix #30819
2020-04-08 19:52:45 -07:00
Rintaro Ishizaki
a5fa431af4 Merge pull request #30890 from rintaro/sourcekit-test-diff
[SourceKit/Testing] Add %diff as an alias for 'diff --strip-trailing-cr'
2020-04-08 19:44:28 -07:00
Saleem Abdulrasool
5309f27cb4 Fix #30819
The commit added a broken header into the test which happened to pass
due to ObjC behaviours accidentally leaking.  Fix the header.
2020-04-08 19:43:16 -07:00
Dan Zheng
4495f6b87d Fix tests for 32-bit platforms.
- Remove unnecessary imports from test/AutoDiff/stdlib/simd.swift.
- Use platform-correct `Builtin` integer type in
  `PullbackEmitter::getArrayAdjointElementBuffer`.
2020-04-08 19:16:00 -07:00
swift-ci
f6d30c383d Merge pull request #30900 from aschwaighofer/fix_test_irgen_abitypes_armv7 2020-04-08 18:02:21 -07:00
Suyash Srijan
724f8c23db [Typechecker] Implement SE-0268 Refine didSet Semantics (#26632) 2020-04-09 01:23:15 +01:00
Arnold Schwaighofer
51de63693a Fix test/IRGen/abitypes.swift on armv7
Add alignment.

rdar://61468038
2020-04-08 16:14:36 -07:00
Pavel Yaskevich
deb58e0b68 Merge pull request #30022 from LucianoPAlmeida/SR-9839-convention-function-conversions-fail
[SR-9839] Fixes ambiguity in convention function argument inference
2020-04-08 15:48:51 -07:00
swift-ci
7068536a37 Merge pull request #30893 from ravikandhadai/emit-code-conditioned-on-creation-loc 2020-04-08 14:58:14 -07:00
Holly Borla
008b33ecb3 Merge pull request #30896 from hborla/property-wrapper-invalid-redeclaration
[Property Wrappers] Improve error recovery in buildStorageReference.
2020-04-08 14:50:25 -07:00
Andrew Trick
d951279e53 Merge pull request #30892 from atrick/silcombine-builtin-same-metatype
Add Builtin.is_same_metatype to SILCombine.
2020-04-08 14:48:13 -07:00
Dan Zheng
01db90dd61 Merge branch 'master' of github.com:apple/swift into autodiff-upstream-stdlib-differentiation 2020-04-08 14:12:03 -07:00
Dan Zheng
9cfe91aa01 Merge pull request #30877 from dan-zheng/SR-12548-fix
[SILOptimizer] Disable `SILCombiner::visitPartialApplyInst` for method callees.
2020-04-08 14:09:58 -07:00
marcrasi
0340e9a84e Merge pull request #30887 from marcrasi/ad-upstream-tests
[AutoDiff upstream] witness table IRGen test
2020-04-08 13:55:18 -07:00
Dario Rexin
e4e6c16319 Fix linker flags for -static-executable
Also adds a test to ensure it does not break in the future
2020-04-08 13:25:27 -07:00
Luciano Almeida
4c8f1c8b2d [test] Adding SR-9839 test cases 2020-04-08 17:17:04 -03:00
Dan Zheng
73f0560af5 [AutoDiff] Standardize on "differentiability parameter" terminology.
Change "differentiation parameter" to "differentiability parameter", matching
terminology in docs/DifferentiableProgramming.md.
2020-04-08 13:01:17 -07:00
Holly Borla
32c338f465 [Property Wrappers] Improve error recovery in buildStorageReference.
Bail out if the backing storage has an error type. This can happen
if there's an invalid redeclaration of the property wrapper, for
example.
2020-04-08 12:45:32 -07:00
Nathan Hawes
df3b6a83bb [SourceKit/CodeFormat] Don't modify multiline string indentation regardless of it being column-aligned or not.
Resolves rdar://problem/61463947
2020-04-08 12:11:48 -07:00
Ravi Kandhadai
fb943cca8a [OSLogOptimization] Make emitCodeForSymbolicValue function generate
code for closures iff the closure is not created by the caller function
where the code is generated. Otherwise, when the closure is created
by the caller, just reuse it after copying and extending its lifetime.

Before this change new closures were created as long as all captures
of the closures were symbolic constants. This patch updates it so that
even if all captures are symbolic constants no code is generated for
closures that are already available in the caller. This avoids doing
needless work and also fixes the following bug.

<rdar://problem/61465764>
2020-04-08 11:53:52 -07:00
Brent Royal-Gordon
4de19e1c3c Merge pull request #30819 from brentdax/a-less-ambitious-crossover-event
Ignore transitive ObjC imports when cross-importing
2020-04-08 11:40:35 -07:00
Andrew Trick
ba75b3b3fb Add Builtin.is_same_metatype to SILCombine.
To optimize String decoding.
2020-04-08 11:34:22 -07:00
Dan Zheng
2eb460de4d [AutoDiff upstream] Add forward-mode differentiation. (#30878)
JVP functions are forward-mode derivative functions. They take original
arguments and return original results and a differential function. Differential
functions take derivatives wrt arguments and return derivatives wrt results.

`JVPEmitter` is a cloner that emits JVP and differential functions at the same
time. In JVP functions, function applications are replaced with JVP function
applications. In differential functions, function applications are replaced
with differential function applications.

In JVP functions, each basic block takes a differential struct containing callee
differentials. These structs are consumed by differential functions.
2020-04-08 11:29:21 -07:00
Rintaro Ishizaki
aee280ad65 [SourceKit/Testing] Add %diff as an alias for 'diff --strip-trailing-cr' 2020-04-08 11:23:48 -07:00
Marc Rasi
105e3b298c [AutoDiff upstream] witness table IRGen test 2020-04-08 11:14:21 -07:00
Andrew Trick
b5570a1aa9 Merge pull request #30872 from atrick/cse-init-existential-metatype
Add init_existential_metatype to CSE.
2020-04-08 11:06:26 -07:00
Nathan Hawes
c6a06e0feb [SourceKit/CodeFormat] Column-align enum element decls and the items in their parameter lists.
Resolves rdar://problem/61461022
2020-04-08 10:16:59 -07:00
Pavel Yaskevich
51267754fc Merge pull request #30867 from xedin/rdar-59874355
[TypeChecker] Diagnose key paths with contextual type but no leading dot
2020-04-08 10:05:35 -07:00
Nathan Hawes
19d6effc5e [SourceKit/CodeFormat] Column-align multiple patterns in catch clauses.
Catch clauses now support mutliple patterns. Like 'case' patterns, these
should be column-aligned if split across multiple lines.

do {
  ...
} catch MyErr.a(let x),
        MyErr.b(let x) {
  print("hello")
}
2020-04-08 09:46:09 -07:00
AG
4e85c51b07 Merge pull request #30857 from bitjammer/acgarland/rdar-60796811-rootmost-extension-sgf
[SymbolGraph] Put extending declarations in rootmost module
2020-04-08 09:41:25 -07:00
Saleem Abdulrasool
3036774e0b Merge pull request #30869 from compnerd/exec-test
test: mark stdlib/StringSwitch as executable_test
2020-04-08 07:39:04 -07:00
Dan Zheng
606c070e11 [SILOptimizer] Disable SILCombiner::visitPartialApplyInst for method callees.
Disable `SILCombiner::visitPartialApplyInst` from rewriting `partial_apply` with
with `@convention(method)` callee to `thin_to_thick_function`.

This fixes SIL verification errors: `thin_to_thick_function` only supports
`@convention(thin)` operands.

Resolves SR-12548.
2020-04-08 12:40:44 +00:00
Dan Zheng
06f52182c4 Add negative test for SR-12548.
Test SR-12548: `SILCombiner::visitPartialApplyInst` rewrites `partial_apply`
with `@convention(method)` callee to `thin_to_thick_function`.

This produces a SIL verification error: `thin_to_thick_function` only supports
`@convention(thin)` operands.
2020-04-08 12:29:29 +00:00
Erik Eckstein
e743280d6c tests: fix the benchmark test after renaming some benchmarks 2020-04-08 13:28:46 +02:00
Dan Zheng
b6d765348d [AutoDiff upstream] Test differentiable collection higher-order functions.
Test `Array.differentiableMap(_:)` and `Array.differentiableReduce(_:_:)`.
2020-04-08 02:50:50 -07:00
Dan Zheng
d599105715 [AutoDiff upstream] Fix stdlib differentiation tests.
Temporarily disable not-yet-supported differentiation tests:

- Forward-mode differentiation.
  - TF-1237: to be upstreamed.
- `Differentiable.zeroTangentVector`.
  - TF-1238: to be upstreamed.
- `SIMD.sum` differentiation.
  - TF-1103: `@_alwaysEmitIntoClient` derivative registration.
2020-04-08 02:50:43 -07:00
Dan Zheng
e377436169 Merge branch 'master' of github.com:apple/swift into autodiff_upstream_conformances_derivatives_master 2020-04-08 02:49:17 -07:00
Dan Zheng
da36555aa5 [AutoDiff upstream] Gardening.
- Standardize filenames: `XXXDifferentiation.swift`.
  - Use Pascal or snake case consistently.
- Formatting changes.
2020-04-08 02:49:12 -07:00
Dan Zheng
f27f1cde66 Merge pull request #30863 from dan-zheng/synthesized-file-unit
[AutoDiff] Add generated implicit declarations to SynthesizedFileUnit.
2020-04-07 23:48:09 -07:00
Andrew Trick
a22d0f229c Add init_existential_metatype to CSE.
So String decoding can be optimized.
2020-04-07 21:16:21 -07:00
Andrew Trick
91a425ee80 Merge pull request #30868 from atrick/simplify-metatype
Simplify metatype instructions.
2020-04-07 20:43:03 -07:00
Saleem Abdulrasool
1471d52662 test: mark stdlib/StringSwitch as executable_test
This is a runtime test, ensure that is marked as an execution test.
2020-04-07 20:36:59 -07:00
Doug Gregor
b6df6ef59f Merge pull request #30843 from DougGregor/consistent-simulator-triples
[Build] Use simulator triples consistently
2020-04-07 20:23:51 -07:00
Artem Chikin
0d1013245e Merge pull request #30782 from artemcm/Rcross-import
Add -Rcross-import option
2020-04-07 19:04:47 -07:00
Dan Zheng
f7a9eed4de [AutoDiff] Add generated implicit declarations to SynthesizedFileUnit.
Add implicit declarations generated by the differentiation transform to a
`SynthesizedFileUnit` instead of an ad-hoc pre-existing `SourceFile`.

Resolves TF-1232: type reconstruction for AutoDiff-generated declarations.

Previously, type reconstruction failed because retroactively adding declarations
to a `SourceFile` did not update name lookup caches.
2020-04-07 18:29:34 -07:00