Commit Graph

36 Commits

Author SHA1 Message Date
Anthony Latsis
42e47d74f5 Gardening: Migrate test suite to GH issues: validation-test/SILOptimizer 2022-09-20 02:32:29 +03:00
Nate Chandler
d744af576f [Test] Disabled test to investigate.
The test validation-test/SILOptimizer/hoist_destroy_addr.sil is failing
to parse with invalid SIL.  The input will need to be updated.

rdar://98890125
2022-08-19 10:52:59 -07:00
Butta
3933fc0006 [android][test] Fix several tests on the Android CI
- #58975 switched many tests from XFAIL on linux to linux-gnu, so seven
  fail on the Android CI and two natively. They are now explicitly excluded.
- #39605 added several C++ Interop tests, 11 of which fail on the Android CI,
  so disable them for now.
- #42478 removed the @noescape attribute for the non-Android
  SIL/clang-function-types tests, so I remove it for Android too.
- My pull #40779 moved the Swift pointer tags to the second byte, so
  SILOptimizer/concat_string_literals.64 will need to be updated for that,
  disabled it for now.
- Compiler-rt moved the directory in which it places those libraries for
  Android, llvm/llvm-project@a68ccba, so lit.cfg is updated for that.
2022-06-09 14:35:41 +05:30
Ben Barham
efc9469444 Merge pull request #58975 from bnbarham/make-features-consistent
[Tests] Make OS features consistent
2022-05-25 16:02:43 -07:00
Nate Chandler
e39caea26a [Test] Run test with 64-bit SIL on 64-bit arch. 2022-05-24 08:03:11 -07:00
Nate Chandler
24979d48e0 [SSADestroyHoisting] Adopt new utilities.
Instead of doing one or two non-iterative BackwardReachability runs,
do a single run of IterativeBackwardReachability.  During that, pause
after discovery/local dataflow and use VisitBarrierAccessScopes to
determine which end_access instructions in the discovered region are
barriers.  Add those instructions as kills to the dataflow.  Finally run
the global dataflow.

Enables SSADestroyHoisting to hoist destroys over loops.

Addresses a correctness issue where access scopes which were open at
barrier blocks were not promoted to barriers, resulting in destroy_addrs
getting hoisted into unrelated access scopes.
2022-05-21 12:56:51 -07:00
Ben Barham
c163e0fe5e [Tests] Make OS features consistent
lit.py currently allows any substring of `target_triple` to be used as a
feature in REQUIRES/UNSUPPORTED/XFAIL. This results in various forms of
the OS spread across the tests and is also somewhat confusing since they
aren't actually listed in the available features.

Modify all OS-related features to use the `OS=` version that Swift adds
instead. We can later remove `config.target_triple` so that these don't
the non-OS versions don't work in the first place.
2022-05-20 19:51:23 -07:00
Nate Chandler
979196cb16 [Test] For disabling destroy hoisting. 2022-03-17 12:06:53 -07:00
Nate Chandler
f79f26f6ea [Test] Reenabled test.
Added flag to disable destroy hoisting to run line.  Destroy hoisting
will be disabled separately.

rdar://86271875
2022-02-21 08:05:48 -08:00
Nate Chandler
1d939d4201 [Test] Run in right contexts.
The validation-test/SILOptimizer/lexical-lifetimes.swift test uses
concurrency features.  Specified where that means the test can run
appropriately.
2022-01-14 18:31:33 -08:00
Nate Chandler
9b021c9ba7 [Test] Eased check assertion. 2022-01-12 13:15:57 -08:00
Nate Chandler
cb205a6ec0 [Test] Checked variable lifetimes not extend weak.
Verified that lexical lifetimes DO NOT result in a method call to a weak
reference resulting in a strong reference to the object.  Consequently,
even with lexical lifetimes enabled, it is still possible, within a
single scope, for the first method call to an object weakly referenced
to occur but for the second such call not to because the object will
have been deallocated.
2022-01-05 13:00:35 -08:00
Nate Chandler
f48f3ad228 [Test] Checked variable lifetimes extend self.
Verified that when a __consuming method calls a function which takes a
closure that captures self weakly, self is not deallocated until the
call returns.  (Note that this is a behavioral change from what occurs
when lexical borrow scopes are disabled; in that case, self is
deallocated before the call to the function.)
2022-01-05 12:12:01 -08:00
swift-ci
6a752615d6 Merge pull request #40477 from nate-chandler/lexical-lifetimes/reenable-destroy-hoisting 2021-12-09 15:42:02 -08:00
Nate Chandler
59f3b37c35 [SIL] Reenable destroy hoisting under lexical lifetimes.
Until https://github.com/apple/swift/pull/40392 lands, run destroy
hoisting with lexical lifetimes.
2021-12-09 10:42:36 -08:00
Nate Chandler
ea42e2f334 Enabling copy propagation enables lexical lifetimes.
The effect of passing -enable-copy-propagation is both to enable the
CopyPropagation pass to shorten object lifetimes and also to enable
lexical lifetimes to ensure that object lifetimes aren't shortened while
a variable is still in scope and used.

Add a new flag, -enable-lexical-borrow-scopes=true to override
-enable-copy-propagation's effect (setting it to ::ExperimentalLate) on
SILOptions::LexicalLifetimes that sets it to ::Early even in the face of
-enable-copy-propagation.  The old flag -disable-lexical-lifetimes is
renamed to -enable-lexical-borrow-scopes=false but continues to set that
option to ::Off even when -enable-copy-propagation is passed.
2021-12-08 19:13:21 -08:00
Nate Chandler
2356b07427 [Test] Add two lexical lifetime verification tests.
Verify that lexical-lifetimes and copy-propagation interact correctly to
keep objects named by variables alive in a couple interesting cases:
unsafe pointers, synchronization point calls.
2021-12-07 16:29:17 -08:00
Nate Chandler
1961be8845 Renamed flag to -enable-lexical-lifetimes.
Previously, both swift-frontend and sil-opt put lexical lifetimes behind
a flag named -enable-experimental-lexical-lifetimes.  That's redundant.
Here, the experimental portion of the name is dropped.
2021-12-03 17:40:37 -08:00
Nate Chandler
d9b32f243c [Test] Fixed run line for lexical-lifetimes.swift.
rdar://84984903
2021-11-03 16:48:48 -07:00
Nate Chandler
3bb1766a5f [SILOptimizer] Keep lexical lifetime markers.
Previously, TempRValueElimination would peephole simple alloc_stacks,
even when they were lexical; here, they are left for Mem2Reg to properly
handle.

Previously, SemanticARCOpts would eliminate lexical begin_borrows,
incorrectly allowing the lifetime of the value borrowed by them to be
observably shortened.  Here, those borrow scopes are not eliminated if
they are lexical.

Added an executable test that verifies that a local variable strongly
referencing a delegate object keeps that delegate alive through the call
to an object that weakly references the delegate and calls out to it.
2021-10-22 15:00:23 -07:00
Karoy Lorentey
4c12217157 [test] Add missing postprocessing phase to executable stress tests
We need to run utils/swift-darwin-postprocess.py on every executable test on Darwin platforms to work around a dyld issue. (And to ad-hoc sign executables on platforms that need it.)

Add a %target-codesign step to stress tests that are currently missing it.
2021-06-17 13:35:21 -07:00
Holly Borla
11496e2c4c [NFC] Add bugs.swift.org links to disabled tests to track re-enabling. 2021-04-08 23:04:51 -07:00
Holly Borla
e6e716a44a [Test] Disable a few failing tests on linux. 2021-04-08 22:57:01 -07:00
zoecarver
6def04d360 Removes dead function cleanup from MandatoryInlining.
This will help reduce compile time in SourceKit (among others). Dead
function elimination will handle the removal of dead functions (not in
-Onone).
2020-12-10 09:18:16 -08:00
Erik Eckstein
f14916832f EscapeAnalysis: fix a quadratic behavior in ConnectionGraph::getNode
Fixes a compile time problem. The single linked list of merge targets in connection graph nodes can be very large.
Update the final merge target in the map, so that it has to be traversed only once for a given SILValue.

rdar://problem/71602804
2020-11-24 15:47:46 +01:00
Joe Groff
f588f2f478 Merge pull request #33650 from jckarter/global_init_mangling
Remove hardcoded symbol name parsing from SILOptimizer passes
2020-08-28 08:34:35 -07:00
Joe Groff
0bef4a661b Give global once symbols stabler manglings.
This allows symbol ordering and other analyses to be more robust with regards to these symbols.
2020-08-27 16:00:20 -07:00
Kuba (Brecka) Mracek
9de7b59388 Subsume SWIFT_STDLIB_USE_NONATOMIC_RC into SWIFT_STDLIB_SINGLE_THREADED_RUNTIME (#33643) 2020-08-26 21:28:30 -07:00
Holly Borla
4096a62b2a [ConstraintSystem] Don't update the work list when merging type variables
in addJoinConstraint.
2020-08-10 19:56:00 -07:00
Mishal Shah
ac6683994a [Disable] SILOptimizer test (66807959) 2020-08-10 17:22:26 -07:00
Holly Borla
989a432898 [NFC] Update array literal type checking performance validation tests. 2020-08-06 12:30:45 -07:00
Nate Cook
498969f64e XFAIL SILOptimizer/large_string_array.swift.gyb (#33157) 2020-07-28 11:09:57 -05:00
Erik Eckstein
5b77f64356 tests: The large_string_array test only works for 64 bits. 2020-04-13 08:19:16 +02:00
Erik Eckstein
e117378d68 tests: add a compile-time test for large string arrays.
rdar://problem/56268570
2020-04-10 20:10:24 +02:00
Daniel Rodríguez Troitiño
9d7728ff55 [test] Mark string_switch.swift as executable test.
The test might want to be split in two, because it does both checks for
the output of the compilation, and the run time itself, but for now mark
it as executable, so it doesn't break the Android test suite (which
cannot execute tests).
2019-03-25 15:02:36 -07:00
David Zarzycki
c00c18fc68 [Tests] Consolidate stress/long tests in validation-tests 2018-03-20 22:19:37 -04:00