Commit Graph

113 Commits

Author SHA1 Message Date
Eric Miotto
00334acf37 Disable tests that require arm64e slices for iOS sanitizers
We started building iOS sanitizers when switching to
`LLVM_ENABLE_RUNTIMES` to build compiler-rt, and turns out they
currently provide only the arm64 slice.

Addresses rdar://151782340
2025-05-22 14:40:07 -07:00
nate-chandler
8959f60ab1 Merge pull request #81566 from nate-chandler/rdar151325025
[MoveOnlyChecker] Don't complete phis.
2025-05-19 07:21:21 -07:00
Nate Chandler
9b3db3646a [MoveOnlyChecker] Don't complete phis.
Apply the MoveOnlyAddressChecker change from
https://github.com/swiftlang/swift/pull/73358 to the
MoveOnly[Value]Checker.

After 7713eef817, before running value
checking, all lifetimes in the function are completed.  That doesn't
quite work because lifetime completion expects not to encounter
reborrows or their adjacent phis.

rdar://151325025
2025-05-16 11:58:44 -07:00
Nate Chandler
1765f0b1e0 [MoveOnly] Fix consume of addr with mutated field.
Don't fail out of use visitation when encountering an apply which uses a
field of the value as an inout parameter.

rdar://139666145
2025-05-15 15:19:26 -07:00
Erik Eckstein
ec4d40cdbe tests: increase the timeout for large_nested_array.swift.gyb
This fixes a timeout failure in CI. It looks like that some CI machines are slower than expected.
I could not reproduce this locally. There doesn't seem to be a compile time regression.
2025-04-24 09:27:37 +02:00
Nate Chandler
4786bede68 [MoveOnly] Fix consumption of opened existentials.
Enable walking into `TypeOffsetSizePair`s from an existential into an
archetype.  And set the access kind on `open_existential_addr`
instructions which are the sources of rewritten `copy_addr`s to mutable.

rdar://141279635
2025-04-22 17:59:37 -07:00
Erik Eckstein
328e6aad07 ConstExpr: fix handling of store_borrow
The `store_borrow` instruction has a result and that must be set.
Fixes a false error of the OSLogOptimization.
rdar://144896232
2025-02-19 13:30:07 +01:00
Erik Eckstein
85736fb703 tests: increase timeout of SILOptimizer/large_c_struct.swift
I have to take into account that CI machines are sometimes not so fast.
rdar://144921565
2025-02-16 18:28:13 +01:00
Erik Eckstein
b07a06cd16 tests: increase the timeout for SILOptimizer/large_nested_array.swift.gyb
The test run time jumped from ~200s to ~600s on Linux.
Unfortunately I could not reproduce this locally.
But what I saw is that ARCSequenceOpts is taking 75% of the compile time: rdar://144863155

Let's increase the timeout a bit until we can get rid of ARCSequenceOpts.

rdar://144810758
2025-02-14 15:54:38 +01:00
Erik Eckstein
d351d10845 tests: add a testfile for a predictable-memory-opt complexity problem.
Reported here: https://github.com/swiftlang/swift/issues/56221
rdar://72885279
2025-02-07 11:30:35 +01:00
Hiroshi Yamauchi
7abb94a5f4 Add a reproducer for issue 78447
https://github.com/swiftlang/swift/issues/78447
2025-01-13 11:28:44 -08:00
nate-chandler
0d76250033 Merge pull request #77908 from nate-chandler/rdar139840307
[BarrierAccessScopes] Handle end_access instructions' barrierness introduced during run.
2024-12-04 15:29:02 -08:00
Nate Chandler
f79def4cee [BarrierAccessScopes] Handle found gen locality.
As the utility runs, new gens may become local: as access scopes are
determined to contain deinit barriers, their `end_access` instructions
become kills; if such an `end_access` occurs in the same block above an
initially-non-local gen, that gen is now local.

Previously, it was asserted that initially-non-local gens would not
encounter when visiting the block backwards from that gen.  Iteration
would also _stop_ at the discovered kill, if any.  As described above,
the assertion was incorrect.

Stopping at the discovered kill was also incorrect.  It's necessary to
continue walking the block after finding such a new kill because the
book-keeping the utility does for which access scopes contain barriers.
Concretely, there are two cases:
(1) It may contain another `end_access` and above it a deinit barrier
which must result in that second scope becoming a deinit barrier.
(2) Some of its predecessors may be in the region, all the access scopes
which are open at the begin of this block must be unioned into the set
of scopes open at each predecessors' end, and more such access scopes
may be discovered above the just-visited `end_access`.

Here, both the assertion failure and the early bailout are fixed by
walking from the indicated initially-non-local gen backwards over the
entire block, regardless of whether a kill was encountered.  If a kill
is encountered, it is asserted that the kill is an `end_access` to
account for the case described above.

rdar://139840307
2024-12-02 15:36:00 -08:00
Erik Eckstein
15ead8aa48 tests: fix a wrong check line in SILOptimizer/large_string_array.swift.gyb
Triggered by https://github.com/swiftlang/swift/pull/77806
rdar://140778726
2024-12-02 19:26:39 +01:00
Erik Eckstein
c6408387a7 tests: add a missing -sil-print-types in validation-test/SILOptimizer/rdar114699006.swift
rdar://140405972
2024-11-22 14:32:52 +01:00
Daniel Rodríguez Troitiño
6b27d33596 [validation-test] Add missing REQUIRES: macosx-x86_64 to test (#77357)
This test forces the usage of macosx-x86_64 and will fail if the x86_64
slice of the stdlib has not been built. Mark it as only running on
macosx-x86_64 to avoid the test failure in that case.
2024-11-02 19:00:22 -07:00
Nate Chandler
ce368e8220 [DiagnoseUnreachable] Ignore dead_end destroys.
Such destroys mark the lifetime end of their operands along their
availability boundary.  They are currently inserted in this test case
by the ClosureLifetimeFixup pass, but in the fullness of time they will
be present for every value which is not explicitly destroyed (that's
what complete OSSA lifetimes is mostly about).

Currently, such destroys are diagnosed by DiagnoseUnreachable.  Fix the
diagnostic pass not to diagnose these valid instructions.

rdar://137960229
2024-10-15 21:00:16 -07:00
Nate Chandler
350aaa4d39 [Test] Mark unsupported for OS stdlib.
The test verifies a stdlib behavior whose fix is not present in all
OSes.

rdar://136943907
2024-09-30 07:14:54 -07:00
Erik Eckstein
60e7346b87 tests: re-enable SILOptimizer/string_switch.swift
And fix the check lines.

(the test was disabled in https://github.com/swiftlang/swift/pull/76592)

rdar://136304425
2024-09-20 09:30:30 +02:00
Mishal Shah
5fb9583f0c Merge pull request #76592 from nate-chandler/rdar136304425
[Test] Disable test blocking Linux PR testing.
2024-09-19 21:24:17 -07:00
Nate Chandler
9b00df3ba0 [Test] Disable test blocking Linux PR testing.
rdar://136304425
2024-09-19 17:37:39 -07:00
Nate Chandler
653d7b36e0 [Test] Add regression test.
For rdar://136267186 .
2024-09-19 11:29:13 -07:00
Erik Eckstein
6c46d03601 tests: reduce the timeout of SILOptimizer/large_nested_array.swift.gyb again
It turns out that some CI jobs need 5-6 minutes for this test. To give some slack, use a timeout of 10 minutes.

This is a follow-up of https://github.com/swiftlang/swift/pull/76146
2024-09-03 09:26:31 +02:00
nate-chandler
9ee877943e Merge pull request #76186 from nate-chandler/rdar133779160
[ODL] Handle builtins.
2024-08-30 21:54:08 -07:00
Nate Chandler
5d9802f25f [ODL] Handle builtins.
No update is needed for the values they produce.  This pass should
really be refactored not to crash on instructions that aren't explicitly
listed or at least not to compile if not every instruction is listed.

rdar://133779160
2024-08-30 16:09:11 -07:00
Mike Ash
eead3fa921 [Test] Temporarily increase large_nested_array.swift.gyb timeout to 2400 seconds while we investigate timeouts in CI. 2024-08-29 09:07:52 -04:00
nate-chandler
c56a313d6c Merge pull request #76114 from nate-chandler/rdar133969821_2
[DAH] Bail on pointer use if ignoring barriers.
2024-08-27 21:57:39 -07:00
Nate Chandler
74c4bc9c55 [DAH] Bail on pointer use if ignoring barriers.
Unknown uses of raw pointers should not result in bailing out when an
address is lexical--the destroy of the address will already not be
hoisted over any instructions which may access pointers.  If the address
is not lexical however (such as any address when lexical lifetimes are
disabled), that rationale does not apply, so unknown uses of raw
pointers must cause hoisting to bail.

rdar://133969821
2024-08-27 16:18:39 -07:00
Erik Eckstein
c1c3f76885 tests: fix SILOptimizer/rdar114699006.swift after a mangling change
Also enable this test for all 64 bit platforms, like arm64
2024-08-27 20:04:37 +02:00
Alexander Cyon
4a2942bb4e Fix typos in: cmake, tools, utils, unittests, validation-test
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
2024-07-12 02:34:00 +03:00
nate-chandler
a83269ebd1 Merge pull request #74361 from nate-chandler/gh69252
[Test] Add regression test.
2024-06-12 21:21:36 -07:00
Nate Chandler
b1c7999361 [Test] Add regression test.
For https://github.com/apple/swift/issues/69252 .
2024-06-12 14:10:05 -07:00
nate-chandler
689e889297 Merge pull request #74318 from nate-chandler/gh72615
[Test] Add regression test.
2024-06-12 00:13:45 -07:00
Nate Chandler
562e724bbd [Test] Add regression test.
For https://github.com/apple/swift/issues/72615 .
2024-06-11 17:43:18 -07:00
Nate Chandler
d895c34c70 [Test] Add regression test. 2024-06-11 14:57:23 -07:00
Nate Chandler
666f036b82 [Test] Add regression test.
For https://github.com/apple/swift/issues/68128 .
2024-06-05 07:48:50 -07:00
Nate Chandler
cae89a9562 [ConsumeObjectChecker] End lifetimes at consumes.
The checker already verifies that no non-destroy consuming users occur
after any `move_value`s corresponding to `consume` operators applied to
a value.  There may, however, be _destroy_ users after it.

Previously, the checker did not shorten the lifetime from those destroys
up to `move_value`s that appear after those `move_value`s.  The result
was that the value's lifetime didn't end at the `consume`.

Here, the checker is fixed to rewrite the lifetimes so that they both
end at `consume`s and also maintain their lexical lifetimes on paths
away from the `consume`s.  This is done by using
`OwnedValueCanonicalization`/`CanonicalizeOSSALifetime`.

Specifically, it passes the `move_value`s that correspond to
source-level `consume`s as the `lexicalLifetimeEnds` to the
canonicalizer.  Typically, the canonicalizer retracts the lexical
lifetime of the value from its destroys.  When these `move_value`s are
specified, however, instead it retracts them from the lifetime boundary
obtained by maximizing the lifetime within its original lifetime while
maintaining the property that the lifetime ends at those `move_value`s.

rdar://113142446
2024-06-03 15:45:32 -07:00
Joe Groff
10f9289ef8 Enable 'BorrowingSwitch' feature. 2024-05-14 07:31:59 -07:00
Kavon Farvardin
0420310623 NCGenerics: it's no longer "experimental"
resolves rdar://127701059
2024-05-08 10:49:12 -07:00
Nate Chandler
5325a4d5f8 [MoveOnlyAddressChecker] Fix empty struct repr.
An empty struct without a deinit gets a single bit which is used to
track the struct's liveness.  Previously, an empty struct with a deinit
also only got a single bit.  Consequently, when discarding the struct
(i.e. dropping the deinit), there was no bit left to represent the
struct.  This resulted in a failure to track liveness for the value.

rdar://126863003
2024-04-22 08:42:14 -07:00
Nate Chandler
de8f1c0b69 [NoncopyablePartialConsumption] Promote to feature 2024-04-19 12:37:34 -07:00
Nate Chandler
943cc3cc7c [NoncopyablePartialConsumption] Enable.
SE-429 was accepted.

rdar://126275392
2024-04-11 08:19:29 -07:00
Karoy Lorentey
9725b892cc [test] More test updates 2024-03-18 13:27:46 -07:00
nate-chandler
d80854ea3b Merge pull request #72256 from nate-chandler/gh70234
[ConsumeChecker] Check guaranteed arguments.
2024-03-12 14:04:34 -07:00
Nate Chandler
863c919713 [Test] Add regression test.
For https://github.com/apple/swift/issues/70234 .
2024-03-12 08:33:16 -07:00
Nate Chandler
d8a9c428b0 [Test] Add regression test.
For https://github.com/apple/swift/issues/72055 .
2024-03-11 21:08:16 -07:00
Nate Chandler
ae9d501d77 [Test] Mix in another experimental feature. 2024-03-01 21:01:49 -08:00
Nate Chandler
6100a1b495 Allow partial consumption of self in deinit.
Basic support for partial consumption in deinit without full support for
all future uses of drop_deinit.
2024-02-28 15:57:09 -08:00
Meghana Gupta
ad170b6758 Update test lexical-lifetimes.swift 2024-01-08 22:22:08 -08:00
Erik Eckstein
8fb002e009 tests: add a missing target-codesign in constant_folded_fp_operations.swift
rdar://119268917
2023-12-07 09:45:02 +01:00