1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[Inliner] Don't skip inlining alwaysinline in optnone functions

Previously the NPM inliner would skip all potential inlines in an
optnone function, but alwaysinline callees should be inlined regardless
of optnone.

Fixes inline-optnone.ll under NPM.

Reviewed By: kazu

Differential Revision: https://reviews.llvm.org/D83021
This commit is contained in:
Arthur Eubanks 2020-07-02 11:17:21 -07:00
parent 91a47585e0
commit 9451d2b35e
2 changed files with 4 additions and 1 deletions

View File

@ -791,7 +791,9 @@ PreservedAnalyses InlinerPass::run(LazyCallGraph::SCC &InitialC,
LazyCallGraph::Node &N = *CG.lookup(F);
if (CG.lookupSCC(N) != C)
continue;
if (F.hasOptNone()) {
if (!Calls[I].first->getCalledFunction()->hasFnAttribute(
Attribute::AlwaysInline) &&
F.hasOptNone()) {
setInlineRemark(*Calls[I].first, "optnone attribute");
continue;
}

View File

@ -1,4 +1,5 @@
; RUN: opt < %s -inline -S | FileCheck %s
; RUN: opt < %s --passes=inline -S | FileCheck %s
; Test that functions with attribute optnone are not inlined.
; Also test that only functions with attribute alwaysinline are