Skip to content

Commit a3fdc36

Browse files
committed
[FunctionAttrs] Remove dead code code in nocaptures inference (NFCI)
An argument graph node without uses forms a trivial SCC, which will already be handled by the preceding branch. If a node in the SCC points to a node with empty uses, then it will be part of a different SCC, and as such assumed to be capturing if it does not have an attribute. There is no need to handle them separately.
1 parent 9acaaeb commit a3fdc36

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

llvm/lib/Transforms/IPO/FunctionAttrs.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,23 +1296,14 @@ static void addArgumentAttrs(const SCCNodeSet &SCCNodes,
12961296
continue;
12971297
}
12981298

1299-
bool SCCCaptured = false;
1300-
for (ArgumentGraphNode *Node : ArgumentSCC) {
1301-
if (Node->Uses.empty() && !Node->Definition->hasNoCaptureAttr()) {
1302-
SCCCaptured = true;
1303-
break;
1304-
}
1305-
}
1306-
if (SCCCaptured)
1307-
continue;
1308-
13091299
SmallPtrSet<Argument *, 8> ArgumentSCCNodes;
13101300
// Fill ArgumentSCCNodes with the elements of the ArgumentSCC. Used for
13111301
// quickly looking up whether a given Argument is in this ArgumentSCC.
13121302
for (ArgumentGraphNode *I : ArgumentSCC) {
13131303
ArgumentSCCNodes.insert(I->Definition);
13141304
}
13151305

1306+
bool SCCCaptured = false;
13161307
for (ArgumentGraphNode *N : ArgumentSCC) {
13171308
for (ArgumentGraphNode *Use : N->Uses) {
13181309
Argument *A = Use->Definition;

0 commit comments

Comments
 (0)