Skip to content

Commit 1256f82

Browse files
committed
Remove references to the unused "keypath.entry" attribute.
1 parent f46b184 commit 1256f82

File tree

3 files changed

+2
-57
lines changed

3 files changed

+2
-57
lines changed

lib/SIL/SILDeclRef.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,6 @@ bool SILDeclRef::isNoinline() const {
597597
return true;
598598
}
599599

600-
if (auto *attr = decl->getAttrs().getAttribute<SemanticsAttr>())
601-
if (attr->Value.equals("keypath.entry"))
602-
return true;
603-
604600
return false;
605601
}
606602

lib/SILOptimizer/Transforms/AccessEnforcementDom.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ class DominatedAccessRemoval {
110110
// Returns a bool: If we should bail on this function
111111
// we return false - else true
112112
// See the discussion in DominatedAccessRemoval::analyze() below
113+
//
114+
// FIXME: Handle KeyPath access.
113115
bool DominatedAccessRemoval::visitInstruction(
114116
SILInstruction *instr,
115117
AccessedStorageInfo &visitedDomAccessesToStorageInfo) {
@@ -123,18 +125,6 @@ bool DominatedAccessRemoval::visitInstruction(
123125
}
124126

125127
visitBeginAccess(BAI, storage, visitedDomAccessesToStorageInfo);
126-
} else if (auto fullApply = FullApplySite::isa(instr)) {
127-
SILFunction *callee = fullApply.getReferencedFunction();
128-
if (!callee)
129-
return true;
130-
if (!callee->hasSemanticsAttr("keypath.entry"))
131-
return true;
132-
// we can't eliminate dominated checks even when we can prove that
133-
// the dominated scope has no internal nested conflicts.
134-
// We just bail on these functions.
135-
// Aprevious commit handled them, you can see the full support there,
136-
// but, to simplify the code, assuming key-paths are rare for now, bail.
137-
return false;
138128
} else if (auto *BUAI = dyn_cast<BeginUnpairedAccessInst>(instr)) {
139129
// We have an Implementation that handles this in the analyzer
140130
// and optimizer in a previous commit, However,

test/SILOptimizer/access_dom.sil

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -334,47 +334,6 @@ bb0:
334334
return %10 : $()
335335
}
336336

337-
sil [_semantics "keypath.entry"] @stdlibKeyPathEntry: $@convention(thin) () -> () {
338-
bb0:
339-
%ret = tuple ()
340-
return %ret : $()
341-
}
342-
343-
// public func testDomKeyPath() {
344-
// Checks 3 scopes, two of which are dominated and access the same storage
345-
// However, There's a call to a "fake" key-path entry function - bail for now
346-
//
347-
// CHECK-LABEL: sil @testDomKeyPath : $@convention(thin) () -> () {
348-
// CHECK: [[GLOBAL:%.*]] = global_addr @globalX : $*X
349-
// CHECK-NEXT: [[BEGIN:%.*]] = begin_access [read] [dynamic] [[GLOBAL]] : $*X
350-
// CHECK-NEXT: load [[BEGIN]] : $*X
351-
// CHECK-NEXT: end_access [[BEGIN]] : $*X
352-
// CHECK-NEXT: [[BEGIN:%.*]] = begin_access [read] [dynamic] [no_nested_conflict] [[GLOBAL]] : $*X
353-
// CHECK-NEXT: load [[BEGIN]] : $*X
354-
// CHECK-NEXT: end_access [[BEGIN]] : $*X
355-
// CHECK-NEXT: [[BEGIN:%.*]] = begin_access [read] [dynamic] [no_nested_conflict] [[GLOBAL]] : $*X
356-
// CHECK-NEXT: load [[BEGIN]] : $*X
357-
// CHECK-NEXT: end_access [[BEGIN]] : $*X
358-
// CHECK-NOT: begin_access
359-
// CHECK-LABEL: } // end sil function 'testDomKeyPath'
360-
sil @testDomKeyPath : $@convention(thin) () -> () {
361-
bb0:
362-
%0 = global_addr @globalX: $*X
363-
%1 = begin_access [read] [dynamic] %0 : $*X
364-
%2 = load %1 : $*X
365-
end_access %1 : $*X
366-
%4 = begin_access [read] [dynamic] [no_nested_conflict] %0 : $*X
367-
%5 = load %4 : $*X
368-
end_access %4 : $*X
369-
%7 = begin_access [read] [dynamic] [no_nested_conflict] %0 : $*X
370-
%8 = load %7 : $*X
371-
end_access %7 : $*X
372-
%keyRef = function_ref @stdlibKeyPathEntry : $@convention(thin) () -> ()
373-
apply %keyRef() : $@convention(thin) () -> ()
374-
%10 = tuple ()
375-
return %10 : $()
376-
}
377-
378337
// public func testLoopDominatingAccessAdderSimple() {
379338
// Checks creation of new scope in loop preheader
380339
//

0 commit comments

Comments
 (0)