[llvm-branch-commits] [llvm] bd3ca66 - [Inlining] Delete redundant optnone/alwaysinline check
Xun Li via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Jan 21 18:42:08 PST 2021
Author: Xun Li
Date: 2021-01-21T18:38:10-08:00
New Revision: bd3ca6666d14464b1bb7eecbd3cc227ee0614799
URL: https://github.com/llvm/llvm-project/commit/bd3ca6666d14464b1bb7eecbd3cc227ee0614799
DIFF: https://github.com/llvm/llvm-project/commit/bd3ca6666d14464b1bb7eecbd3cc227ee0614799.diff
LOG: [Inlining] Delete redundant optnone/alwaysinline check
The same check is done in InlineCost: https://github.com/llvm/llvm-project/blob/8b0bd54d0ec968df28ccc58bbb537a7b7c074ef2/llvm/lib/Analysis/InlineCost.cpp#L2537-L2552
Also, doing a check on the callee here is confusing, because anything that deals with callee should be done in the inner loop where we proecss all calls from the same caller.
Differential Revision: https://reviews.llvm.org/D95186
Added:
Modified:
llvm/lib/Transforms/IPO/Inliner.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp
index 574d870bccd8..a7d7594c00b3 100644
--- a/llvm/lib/Transforms/IPO/Inliner.cpp
+++ b/llvm/lib/Transforms/IPO/Inliner.cpp
@@ -761,12 +761,6 @@ PreservedAnalyses InlinerPass::run(LazyCallGraph::SCC &InitialC,
LazyCallGraph::Node &N = *CG.lookup(F);
if (CG.lookupSCC(N) != C)
continue;
- if (!Calls[I].first->getCalledFunction()->hasFnAttribute(
- Attribute::AlwaysInline) &&
- F.hasOptNone()) {
- setInlineRemark(*Calls[I].first, "optnone attribute");
- continue;
- }
LLVM_DEBUG(dbgs() << "Inlining calls in: " << F.getName() << "\n");
More information about the llvm-branch-commits
mailing list