llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[🍒][ThreadSafety] Add two-state semantics for handleCall in beta mode (#210219)

Open ziqingluo-90 opened this issue 4 months ago • 2 comments

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)

ziqingluo-90 avatar Jul 31 '26 22:07 ziqingluo-90

@swift-ci test llvm

ziqingluo-90 avatar Jul 31 '26 22:07 ziqingluo-90

@swift-ci test

ziqingluo-90 avatar Jul 31 '26 22:07 ziqingluo-90

@swift-ci test llvm

ziqingluo-90 avatar Aug 05 '26 17:08 ziqingluo-90

12:09:08 ******************** 12:09:08 Failed Tests (1): 12:09:08 LLVM :: Transforms/ConstraintElimination/induction-condition-in-loop-exit.ll

Irrelevant.

ziqingluo-90 avatar Aug 06 '26 00:08 ziqingluo-90