Commit Graph

4 Commits

Author SHA1 Message Date
Meghana Gupta
1e6f93e0e1 Disable function signature optimization on functions with lifetime dependencies
If a function has lifetime dependencies, disable FSO's dead param optimization. Dead params maybe dependency sources and we should not delete them. It is also problematic to dead code params that are not dependency sources, since lifetime dependent sources are stored as indices and deleting dead parameters will require recomputation of these indices.
2025-07-10 11:35:23 -07:00
Erik Eckstein
881351bcb5 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-14 07:09:33 +02:00
Erik Eckstein
741c6c38df Swift Optimizer: add the ComputeSideEffects pass.
Computes the side effects for a function, which consists of argument- and global effects.
This is similar to the ComputeEscapeEffects pass, just for side-effects.
2022-10-05 07:38:11 +02:00
Erik Eckstein
0c3e6e2291 FunctionSignatureOpts: fix a crash due to a missing argument declaration
The existential -> generic transformation in FSO didn't preserve the argument declaration.
This caused an assert to hit in a later FSO transformation.

rdar://problem/61206439
https://bugs.swift.org/browse/SR-12487
2020-04-15 20:52:30 +02:00