Commit Graph

10 Commits

Author SHA1 Message Date
Erik Eckstein
8cab792753 FunctionSignatureOptimization: don't convert indirect @in to @in_guaranteed if the argument is mutated
This fixes a verifier error because an `@in_guaranteed` argument must not be mutated.

https://github.com/swiftlang/swift/issues/81444
rdar://151147971
2025-05-13 18:53:31 +02:00
Erik Eckstein
65adc5a582 FunctionSignatureOpts: don't convert non-copyable owned -> guaranteed arguments
It's not safe to insert a compensating release_value at the call site.
This release_value calls the deinit which might have been already de-virtualized in the callee.
2024-08-12 08:54:22 +02:00
Tim Kientzle
1d961ba22d Add #include "swift/Basic/Assertions.h" to a lot of source files
Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
2024-06-05 19:37:30 -07:00
Michael Gottesman
c026e95cce [ownership] Extract out SILOwnershipKind from ValueOwnershipKind into its own type and rename Invalid -> Any.
This makes it easier to understand conceptually why a ValueOwnershipKind with
Any ownership is invalid and also allowed me to explicitly document the lattice
that relates ownership constraints/value ownership kinds.
2020-11-10 14:29:11 -08:00
Erik Eckstein
e3ac98cdbf FunctionSignatureTransforms: add a semantics attribute to prevent the owned-to-guarantee transformation.
If a function is annotated with @_semantics("optimize.sil.specialize.owned2guarantee.never") its arguments will not be converted from owned to guaranteed.
2020-05-26 18:01:17 +02:00
pi1024e
c8fa56600f Make booleans const 2020-03-21 12:56:56 -04:00
Michael Gottesman
df47eb2c1f [sil] Use SILNodes.def to define ARGKIND##ArrayRef instead of hard coding names.
I also changed all of the places that vended these to use SILNodes.def as well
so that when new argument kinds are added, things just work.
2019-12-02 14:39:02 -08:00
Jordan Rose
844ae38722 Remove some Swift STLExtras that LLVM now provides (#26443)
No functionality change.
2019-07-31 18:34:52 -07:00
Michael Gottesman
595a7dbc42 [epilogue-arc-analysis] Do not copy lists by value to read them. Use an ArrayRef instead.
I don't think I need to say more here.

rdar://41146023
2018-06-16 23:18:36 -07:00
Michael Gottesman
bfc2dac336 [func-sig-opts] Split FunctionSignatureOpts.cpp into 3 files one for each of the operations it employs now.
This is one step along the way to splitting FSO into sub-transforms.
2018-06-04 00:49:14 -07:00