This is an archive of the discontinued LLVM Phabricator instance.

[Inliner] Respect noinline call site attribute
ClosedPublic

Authored by xbolva00 on Feb 11 2022, 12:42 PM.

Details

Summary
always_inline foo() { }

bar () {

noinline foo();
}

We should prefer call site attribute over attribute on decl.

Related to https://reviews.llvm.org/D119061

Diff Detail

Event Timeline

xbolva00 created this revision.Feb 11 2022, 12:42 PM
xbolva00 requested review of this revision.Feb 11 2022, 12:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2022, 12:42 PM
xbolva00 updated this revision to Diff 408002.Feb 11 2022, 12:51 PM
aeubanks added inline comments.Feb 13 2022, 9:40 PM
llvm/lib/Analysis/InlineCost.cpp
2867

checking the call site attributes with Call.getAttributes().hasFnAttr(Attribute::NoInline) should be enough since noinline and alwaysinline are incompatible within a set of attriutes

xbolva00 updated this revision to Diff 408344.Feb 14 2022, 12:39 AM

Addressed review comment

xbolva00 marked an inline comment as done.Feb 14 2022, 12:40 AM
aeubanks accepted this revision.Feb 14 2022, 8:56 AM
This revision is now accepted and ready to land.Feb 14 2022, 8:56 AM
This revision was landed with ongoing or failed builds.Feb 14 2022, 9:36 AM
This revision was automatically updated to reflect the committed changes.