mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Full IRGen support for begin_access [no_nested_conflict].
Suppress generation of the endAccess runtime call when the begin_access was a "non-tracking" access.
This commit is contained in:
@@ -4260,8 +4260,8 @@ static SILAccessEnforcement getEffectiveEnforcement(IRGenFunction &IGF,
|
||||
return enforcement;
|
||||
}
|
||||
|
||||
template <class Inst>
|
||||
static ExclusivityFlags getExclusivityFlags(Inst *i) {
|
||||
template <class BeginAccessInst>
|
||||
static ExclusivityFlags getExclusivityFlags(BeginAccessInst *i) {
|
||||
return getExclusivityFlags(i->getModule(), i->getAccessKind(),
|
||||
i->hasNoNestedConflict());
|
||||
}
|
||||
@@ -4363,6 +4363,9 @@ void IRGenSILFunction::visitEndAccessInst(EndAccessInst *i) {
|
||||
return;
|
||||
|
||||
case SILAccessEnforcement::Dynamic: {
|
||||
if (access->hasNoNestedConflict())
|
||||
return;
|
||||
|
||||
auto scratch = getLoweredDynamicEnforcementScratchBuffer(access);
|
||||
|
||||
auto call = Builder.CreateCall(IGM.getEndAccessFn(), { scratch });
|
||||
|
||||
Reference in New Issue
Block a user