Meghana Gupta
b6ed0d41a7
Handle switch_value in MemoryLifetimeVerifier
2024-04-03 10:30:55 -07:00
Meghana Gupta
c30eea156f
Verify switch_value has int operands only
2024-04-03 10:30:55 -07:00
Kuba (Brecka) Mracek
7553c41705
Merge pull request #72690 from kubamracek/embedded-subclassing-across-modules
...
[embedded] Relax verifier check on hidden-external functions in embedded mode
2024-04-02 10:47:49 -07:00
Andrew Trick
44a2661644
Merge pull request #72764 from atrick/fix-address-yield
...
Fix LifetimeDependenceDefUseWalker for address yields.
2024-04-02 08:32:51 -07:00
Andrew Trick
a1bb9f401a
Fix SILVerifier and AddressUtils handling of addr casts.
...
These core utils did not handle UnconditionalCheckedCastAddrInst or
UncheckedRefCastAddrInst correctly.
2024-04-01 21:46:10 -07:00
Slava Pestov
32dab83420
SIL: Stronger assertions in InitExistential{Addr,Value,Ref}Inst
2024-04-01 23:05:35 -04:00
Alejandro Alonso
36bf2ae3bf
Merge pull request #72592 from Azoy/raw-layout-inst
...
[IRGen] Add Builtin.addressOfRawLayout
2024-03-29 07:38:37 -07:00
Kuba Mracek
a54dfe8b8e
[embedded] Relax verifier check on hidden-external functions in embedded mode
2024-03-28 17:57:54 -07:00
nate-chandler
a91bfcc376
Merge pull request #72600 from nate-chandler/rdar125443922
...
[BitwiseCopyable] Loosen validation assertion.
2024-03-27 15:27:19 -07:00
Pavel Yaskevich
d3540b4838
Merge pull request #71376 from simanerush/pack-argument-fix
...
SIL: Adjust `isTypeMetadataForLayoutAccessible()` to visit more lowered positions
2024-03-27 13:44:22 -07:00
Anton Korobeynikov
d84847ac9d
Reland Allow normal function results of @yield_once coroutines ( #71645 )
...
* Allow normal function results of @yield_once coroutines
* Address review comments
* Workaround LLVM coroutine codegen problem: it assumes that unwind path never returns.
This is not true to Swift coroutines as unwind path should end with error result.
2024-03-27 13:09:02 -07:00
Alejandro Alonso
f5e10e2c0b
Get rid of sil instruction and use a builtin for addressOfRawLayout
2024-03-27 11:36:29 -07:00
Nate Chandler
da92b37856
[BitwiseCopyable] Loosen validation assertion.
...
Don't verify triviality of a suppressed conformance.
2024-03-27 08:51:57 -07:00
Nate Chandler
3d54cacc97
[BitwiseCopyable] Loosen validation assertion.
...
A function can return `some BitwiseCopyable`. The resulting value is
(currently) non-trivial but conforms to `BitwiseCopyable`.
rdar://125443922
2024-03-26 15:25:08 -07:00
Andrew Trick
2f6c4ad90d
Merge pull request #72513 from atrick/markdep_escape
...
SIL: Fix handling of mark_dependence [nonescaping] in several utilities
2024-03-23 09:33:28 -07:00
Konrad `ktoso` Malawski
6132386371
[Distributed] Complete handling of protocol calls and witnesses using adjusted mangling scheme ( #72416 )
2024-03-23 23:54:23 +09:00
Andrew Trick
f809d72507
Merge pull request #72504 from atrick/complete-ossa-flags
...
Options for complete OSSA lifetimes.
2024-03-22 16:53:42 -07:00
Andrew Trick
d7b9149ee5
Fix visitNonEscapingLifetimeEnds to handle mark_dependence uses
...
Now it visits unknown uses separately rather than asserting.
2024-03-22 14:29:57 -07:00
Adrian Prantl
9b0c4104ef
Merge pull request #72397 from Snowy1803/verifier-conflicting-debug-value-types
...
[SILVerifier] Add detection of conflicting debug variables
2024-03-22 11:31:05 -07:00
Meghana Gupta
50b358c64f
Merge pull request #72359 from meg-gupta/skiphismdi
...
Fix utilities that may see phis of mark_dependence [nonescaping]
2024-03-21 18:28:08 -07:00
nate-chandler
4f6ed730a4
Merge pull request #72469 from nate-chandler/rdar125113258
...
[MoveOnlyAddressChecker] Fix enum representation.
2024-03-21 17:18:03 -07:00
Andrew Trick
38d9557481
Options for complete OSSA lifetimes.
...
Adds
-disable-ossa-complete-lifetimes,
-enable-ossa-verify-complete,
-disable-ossa-verify-complete
2024-03-21 16:32:10 -07:00
eeckstein
83b2593fba
Merge pull request #72485 from eeckstein/node-bits
...
Some improvements for inline bitfields in SILNode, SILBasicBlock and Operand
2024-03-21 22:45:22 +01:00
Nate Chandler
a0a1ff2a04
[MoveOnlyAddressChecker] Fix enum repr.
...
Change FieldSensitive's enum representation to allow distinguishing
among the elements with associated value. Consider
`unchecked_take_enum_data_addr` to consume all other fields than that
taken.
rdar://125113258
2024-03-21 10:48:32 -07:00
Erik Eckstein
e45b4bd329
SIL: clear operand bit fields of instructions which are moved between functions
...
This fixes a bug with can cause OperandSet to misbehave for instructions which were moved from another function.
2024-03-21 15:52:39 +01:00
Emil Pedersen
fed03ccc2b
[SILVerifier] Add detection of conflicting debug variables
2024-03-20 15:55:52 -07:00
Meghana Gupta
3ebef80261
Fix utilities that may see phis of mark_dependence [nonescaping]
2024-03-20 15:44:11 -07:00
Nate Chandler
4f6f8d9459
[NFC] MoveOnly: Map operand to list of ranges.
2024-03-20 12:52:57 -07:00
Nate Chandler
76348df0cf
[MoveOnlyAddressChecker] Fix repr for consumes.
...
An instruction can consume multiple (discontiguous) fields. Use a
SmallBitVector to track the fields consumed by an instruction rather
than a TypeTreeLeafRange.
rdar://125103951
2024-03-20 12:08:48 -07:00
Nate Chandler
7feb7e2675
[NFC] FSPrunedLiveness: Move impl to cpp file.
...
The function is long and will get longer.
2024-03-20 08:20:16 -07:00
Joe Groff
dc4c874c49
Merge pull request #72452 from jckarter/pruned-liveness-try-apply-conditional-def
...
FieldSensitivePrunedLiveness: Handle conditionality of `try_apply` defs.
2024-03-20 07:43:42 -07:00
Joe Groff
1166f2e0d8
FieldSensitivePrunedLiveness: Handle conditionality of try_apply defs.
...
A `try_apply` with indirect out arguments is only a def for those arguments on
the success path. Model this by sinking the def-ness of the instruction into the
success branch of the try_apply, and introducing a new `DeadToLiveEdge` mode for
block liveness which stops propagation of use-before-def conditions into the
block that introduced the def. Fixes rdar://118567869.
2024-03-19 22:46:26 -07:00
Erik Eckstein
20ca456601
SIL: fix runtime effect of copy_addr of trivial types
...
Fixes a false performance error
Reported in https://forums.swift.org/t/generic-type-nolocks-trouble/70667
2024-03-18 13:18:12 +01:00
Kavon Farvardin
76c6510519
Merge pull request #72276 from kavon/ncgenerics-xfails-3
2024-03-16 04:18:35 -07:00
Ellie Shin
7c7a2de736
Merge pull request #72344 from apple/elsh/pkg-cmo-flag-false
...
Set EnableSerializePackage to false.
2024-03-15 17:15:49 -07:00
Ellie Shin
6fc909837f
Set EnableSerializePackage to false and update call sites.
...
Update doc comments.
rdar://124651962
2024-03-15 14:11:36 -07:00
Meghana Gupta
237b70c7d4
Merge pull request #72314 from meg-gupta/fixnonestructonly
...
Fix ownership of move-only structs in SIL
2024-03-15 01:28:12 -07:00
Kavon Farvardin
149c052ec5
use new noncopyable types infrastructure
...
The infrastructure underpinning the new feature NoncopyableGenerics is
mature enough to be used.
2024-03-14 23:10:44 -07:00
Pavel Yaskevich
c3bc3d39d5
Merge pull request #72331 from xedin/xfail-move-only-cxx-test-with-ncgenerics-enabled
...
[SIL] Fix a couple of test-cases with NCGenerics enabled
2024-03-14 16:37:53 -07:00
Rintaro Ishizaki
91dc6822fa
Merge pull request #72310 from rintaro/ifconfigregisons-per-clause
...
[SourceKit] Use recorded #if regions in 'active-regions' request
2024-03-15 06:22:51 +09:00
Pavel Yaskevich
840ef47fed
[SIL] Unwrap MoveOnly wrapper type before checking Escapable conformance
2024-03-14 09:45:51 -07:00
Ben Barham
cbcfc85777
Merge pull request #72323 from bnbarham/rename-startswith
...
Rename startswith to starts_with
2024-03-14 09:06:54 -07:00
nate-chandler
71e0041413
Merge pull request #72313 from nate-chandler/rdar124552608
...
[BitwiseCopyable] Loosen validation assertion.
2024-03-13 22:28:11 -07:00
Ben Barham
9779c18da3
Rename startswith to starts_with
...
LLVM is presumably moving towards `std::string_view` -
`StringRef::startswith` is deprecated on tip. `SmallString::startswith`
was just renamed there (maybe with some small deprecation inbetween, but
if so, we've missed it).
The `SmallString::startswith` references were moved to
`.str().starts_with()`, rather than adding the `starts_with` on
`stable/20230725` as we only had a few of them. Open to switching that
over if anyone feels strongly though.
2024-03-13 22:25:47 -07:00
Michael Gottesman
e156289cea
Merge pull request #72126 from gottesmm/async-let-fixes
...
[region-isolation] Make async let closures non-Sendable and require actor isolation crossing function into an async let use a transferring result.
2024-03-13 21:54:04 -07:00
Doug Gregor
685b493ac3
Merge pull request #72305 from DougGregor/silgen-thrown-error-closures
...
[SILGen] Correctly determine the thrown error type for closures
2024-03-13 18:28:29 -07:00
Rintaro Ishizaki
2abddcb260
[SourceKit] Use recored #if regions in "active regions" request
...
* Record each IfConfig clause location info in SourceFile
* Update SILProfiler to handle them
* Update SwiftLangSupport::findActiveRegionsInFile() to use the recorded
regions instead of walking into AST to find #if regions
rdar://118082146
2024-03-14 08:52:57 +09:00
Meghana Gupta
a15d5fea09
Fix ownership of move-only structs in SIL
...
Not doing this for enums yet because it is tripping the ownership verifier
We dont have move-only tuples yet.
2024-03-13 16:24:57 -07:00
Nate Chandler
f43d4f0158
[NFC] Note how to disable validation.
2024-03-13 15:50:31 -07:00
Nate Chandler
ee1bc88481
[BitwiseCopyable] Loosen validation assertion.
...
Now that it's possible to be `BitwiseCopyable` and `~Escapable`, because
the latter implies non-trivial, verification must permit a type to be
non-trivial but conform to `BitwiseCopyable` when it contains a
`~Escapable` field.
rdar://124552608
2024-03-13 15:50:21 -07:00