[PATCH] D83021: [Inliner] Don't skip inlining alwaysinline in optnone functions
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 7 13:03:11 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2279380eab08: [Inliner] Don't skip inlining alwaysinline in optnone functions (authored by aeubanks).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83021/new/
https://reviews.llvm.org/D83021
Files:
llvm/lib/Transforms/IPO/Inliner.cpp
llvm/test/Transforms/Inline/inline-optnone.ll
Index: llvm/test/Transforms/Inline/inline-optnone.ll
===================================================================
--- llvm/test/Transforms/Inline/inline-optnone.ll
+++ llvm/test/Transforms/Inline/inline-optnone.ll
@@ -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
Index: llvm/lib/Transforms/IPO/Inliner.cpp
===================================================================
--- llvm/lib/Transforms/IPO/Inliner.cpp
+++ llvm/lib/Transforms/IPO/Inliner.cpp
@@ -791,7 +791,9 @@
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;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83021.276188.patch
Type: text/x-patch
Size: 1009 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200707/cf70c9ce/attachment.bin>
More information about the llvm-commits
mailing list