File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
test/Transforms/FunctionAttrs Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -908,7 +908,7 @@ determinePointerAccessAttrs(Argument *A,
908
908
for (Use &UU : CB.uses ())
909
909
if (Visited.insert (&UU).second )
910
910
Worklist.push_back (&UU);
911
- } else if (! CB.doesNotCapture (UseIndex)) {
911
+ } else if (capturesAnyProvenance ( CB.getCaptureInfo (UseIndex) )) {
912
912
if (!CB.onlyReadsMemory ())
913
913
// If the callee can save a copy into other memory, then simply
914
914
// scanning uses of the call is insufficient. We have no way
@@ -1382,10 +1382,9 @@ static void addArgumentAttrs(const SCCNodeSet &SCCNodes,
1382
1382
}
1383
1383
}
1384
1384
1385
- // TODO(captures): Ignore address-only captures.
1386
- if (capturesAnything (CC)) {
1387
- // As the pointer may be captured, determine the pointer attributes
1388
- // looking at each argument individually.
1385
+ if (capturesAnyProvenance (CC)) {
1386
+ // As the pointer provenance may be captured, determine the pointer
1387
+ // attributes looking at each argument individually.
1389
1388
for (ArgumentGraphNode *N : ArgumentSCC) {
1390
1389
if (DetermineAccessAttrsForSingleton (N->Definition ))
1391
1390
Changed.insert (N->Definition ->getParent ());
Original file line number Diff line number Diff line change @@ -1234,7 +1234,7 @@ define void @dont_increase_existing_captures_scc2(ptr %p) {
1234
1234
define void @addr_only_scc (ptr %p ) {
1235
1235
; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: read, inaccessiblemem: none)
1236
1236
; FNATTRS-LABEL: define void @addr_only_scc
1237
- ; FNATTRS-SAME: (ptr captures(address_is_null) [[P:%.*]]) #[[ATTR20:[0-9]+]] {
1237
+ ; FNATTRS-SAME: (ptr readonly captures(address_is_null) [[P:%.*]]) #[[ATTR20:[0-9]+]] {
1238
1238
; FNATTRS-NEXT: [[V:%.*]] = load i8, ptr [[P]], align 1
1239
1239
; FNATTRS-NEXT: store i8 [[V]], ptr @g, align 1
1240
1240
; FNATTRS-NEXT: call void @addr_only_scc2(ptr [[P]])
@@ -1257,7 +1257,7 @@ define void @addr_only_scc(ptr %p) {
1257
1257
define void @addr_only_scc2 (ptr %p ) {
1258
1258
; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: read, inaccessiblemem: none)
1259
1259
; FNATTRS-LABEL: define void @addr_only_scc2
1260
- ; FNATTRS-SAME: (ptr captures(address_is_null) [[P:%.*]]) #[[ATTR20]] {
1260
+ ; FNATTRS-SAME: (ptr readonly captures(address_is_null) [[P:%.*]]) #[[ATTR20]] {
1261
1261
; FNATTRS-NEXT: [[CMP:%.*]] = icmp ne ptr [[P]], null
1262
1262
; FNATTRS-NEXT: br i1 [[CMP]], label [[IF:%.*]], label [[EXIT:%.*]]
1263
1263
; FNATTRS: if:
You can’t perform that action at this time.
0 commit comments