[🍒][ThreadSafety] Add two-state semantics for handleCall in beta mode (#210219)
Previous contributions added alias analysis and strengthened soundness by invalidating out-parameters in beta mode. The latter feature introduced a distinction between the contexts before and after a function call, because the invalidation assumes that an argument passed by pointer or reference may be changed by the function.
This requires two-state semantics for handling function attributes. Specifically, AcquireCapability and AssertCapability, which both ensure that some locks are held after the call, should be associated with the post-state. Other function attributes, like RequireCapability or ReleaseCapability, are associated with the pre-state.
This commit implements these semantics. This change only affects beta mode.
A previous discussion about these semantics: https://github.com/llvm/llvm-project/pull/190154
rdar://171209196 (cherry picked from commit bd47223f2009fc5d7b997cc3572cbe89b37a6d8c)
@swift-ci test llvm
@swift-ci test
@swift-ci test llvm
12:09:08 ******************** 12:09:08 Failed Tests (1): 12:09:08 LLVM :: Transforms/ConstraintElimination/induction-condition-in-loop-exit.ll
Irrelevant.