Skip to content

Commit 62e8ffe

Browse files
committed
drop norecurse change for now
1 parent ee41e32 commit 62e8ffe

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

llvm/lib/Transforms/IPO/FunctionAttrs.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,13 +2086,11 @@ static void addNoRecurseAttrs(const SCCNodeSet &SCCNodes,
20862086
for (auto &BB : *F)
20872087
for (auto &I : BB.instructionsWithoutDebug())
20882088
if (auto *CB = dyn_cast<CallBase>(&I)) {
2089-
if (CB->hasFnAttr(Attribute::NoRecurse))
2090-
continue;
2091-
20922089
Function *Callee = CB->getCalledFunction();
20932090
if (!Callee || Callee == F ||
2094-
!(Callee->isDeclaration() &&
2095-
Callee->hasFnAttribute(Attribute::NoCallback)))
2091+
(!Callee->doesNotRecurse() &&
2092+
!(Callee->isDeclaration() &&
2093+
Callee->hasFnAttribute(Attribute::NoCallback))))
20962094
// Function calls a potentially recursive function.
20972095
return;
20982096
}

llvm/test/Transforms/FunctionAttrs/norecurse.ll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,9 @@ define void @unknown_call(ptr %fn) {
258258
}
259259

260260
define void @unknown_norecurse_call(ptr %fn) {
261-
; FNATTRS: Function Attrs: norecurse
262261
; FNATTRS-LABEL: define {{[^@]+}}@unknown_norecurse_call
263-
; FNATTRS-SAME: (ptr readonly captures(none) [[FN:%.*]]) #[[ATTR7:[0-9]+]] {
264-
; FNATTRS-NEXT: call void [[FN]]() #[[ATTR7]]
262+
; FNATTRS-SAME: (ptr readonly captures(none) [[FN:%.*]]) {
263+
; FNATTRS-NEXT: call void [[FN]]() #[[ATTR7:[0-9]+]]
265264
; FNATTRS-NEXT: ret void
266265
;
267266
; ATTRIBUTOR-LABEL: define {{[^@]+}}@unknown_norecurse_call

0 commit comments

Comments
 (0)