Merge pull request #22962 from atrick/remove-keypath-attr

Remove references to the unused "keypath.entry" attribute.
This commit is contained in:
Andrew Trick
2019-03-05 13:15:05 -08:00
committed by GitHub
3 changed files with 2 additions and 57 deletions

View File

@@ -597,10 +597,6 @@ bool SILDeclRef::isNoinline() const {
return true;
}
if (auto *attr = decl->getAttrs().getAttribute<SemanticsAttr>())
if (attr->Value.equals("keypath.entry"))
return true;
return false;
}

View File

@@ -110,6 +110,8 @@ private:
// Returns a bool: If we should bail on this function
// we return false - else true
// See the discussion in DominatedAccessRemoval::analyze() below
//
// FIXME: Handle KeyPath access.
bool DominatedAccessRemoval::visitInstruction(
SILInstruction *instr,
AccessedStorageInfo &visitedDomAccessesToStorageInfo) {
@@ -123,18 +125,6 @@ bool DominatedAccessRemoval::visitInstruction(
}
visitBeginAccess(BAI, storage, visitedDomAccessesToStorageInfo);
} else if (auto fullApply = FullApplySite::isa(instr)) {
SILFunction *callee = fullApply.getReferencedFunction();
if (!callee)
return true;
if (!callee->hasSemanticsAttr("keypath.entry"))
return true;
// we can't eliminate dominated checks even when we can prove that
// the dominated scope has no internal nested conflicts.
// We just bail on these functions.
// Aprevious commit handled them, you can see the full support there,
// but, to simplify the code, assuming key-paths are rare for now, bail.
return false;
} else if (auto *BUAI = dyn_cast<BeginUnpairedAccessInst>(instr)) {
// We have an Implementation that handles this in the analyzer
// and optimizer in a previous commit, However,

View File

@@ -334,47 +334,6 @@ bb0:
return %10 : $()
}
sil [_semantics "keypath.entry"] @stdlibKeyPathEntry: $@convention(thin) () -> () {
bb0:
%ret = tuple ()
return %ret : $()
}
// public func testDomKeyPath() {
// Checks 3 scopes, two of which are dominated and access the same storage
// However, There's a call to a "fake" key-path entry function - bail for now
//
// CHECK-LABEL: sil @testDomKeyPath : $@convention(thin) () -> () {
// CHECK: [[GLOBAL:%.*]] = global_addr @globalX : $*X
// CHECK-NEXT: [[BEGIN:%.*]] = begin_access [read] [dynamic] [[GLOBAL]] : $*X
// CHECK-NEXT: load [[BEGIN]] : $*X
// CHECK-NEXT: end_access [[BEGIN]] : $*X
// CHECK-NEXT: [[BEGIN:%.*]] = begin_access [read] [dynamic] [no_nested_conflict] [[GLOBAL]] : $*X
// CHECK-NEXT: load [[BEGIN]] : $*X
// CHECK-NEXT: end_access [[BEGIN]] : $*X
// CHECK-NEXT: [[BEGIN:%.*]] = begin_access [read] [dynamic] [no_nested_conflict] [[GLOBAL]] : $*X
// CHECK-NEXT: load [[BEGIN]] : $*X
// CHECK-NEXT: end_access [[BEGIN]] : $*X
// CHECK-NOT: begin_access
// CHECK-LABEL: } // end sil function 'testDomKeyPath'
sil @testDomKeyPath : $@convention(thin) () -> () {
bb0:
%0 = global_addr @globalX: $*X
%1 = begin_access [read] [dynamic] %0 : $*X
%2 = load %1 : $*X
end_access %1 : $*X
%4 = begin_access [read] [dynamic] [no_nested_conflict] %0 : $*X
%5 = load %4 : $*X
end_access %4 : $*X
%7 = begin_access [read] [dynamic] [no_nested_conflict] %0 : $*X
%8 = load %7 : $*X
end_access %7 : $*X
%keyRef = function_ref @stdlibKeyPathEntry : $@convention(thin) () -> ()
apply %keyRef() : $@convention(thin) () -> ()
%10 = tuple ()
return %10 : $()
}
// public func testLoopDominatingAccessAdderSimple() {
// Checks creation of new scope in loop preheader
//