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:
Andrew Trick
2018-03-31 16:40:01 -07:00
parent 6af333f307
commit 02e4429dba
2 changed files with 6 additions and 2 deletions

View File

@@ -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 });