[PATCH] D121084: [NewPM][Inliner] Make inlined calls to functions in same SCC as callee exponentially expensive

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 6 23:53:47 PST 2022


aeubanks created this revision.
Herald added subscribers: ormris, ChuanqiXu, jdoerfert, haicheng, hiraditya.
Herald added a reviewer: ctetreau.
Herald added a project: All.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Introduce a new attribute "function-inline-cost-multiplier" which
multiplies the inline cost of a call site (or all calls to a callee) by
the multiplier.

When processing the list of calls created by inlining, check each call
to see if the new call's callee is in the same SCC as the original
callee. If so, set the "function-inline-cost-multiplier" attribute of
the new call site to double the original call site's attribute value.
This does not happen when the original call site is intra-SCC.

This is an alternative to D120584 <https://reviews.llvm.org/D120584>, which marks the call sites as
noinline.

Hopefully fixes PR45253.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121084

Files:
  llvm/include/llvm/Analysis/InlineCost.h
  llvm/lib/Analysis/InlineCost.cpp
  llvm/lib/Transforms/IPO/Inliner.cpp
  llvm/test/Transforms/Inline/inline-cost-attributes.ll
  llvm/test/Transforms/Inline/mut-rec-scc-2.ll
  llvm/test/Transforms/Inline/mut-rec-scc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121084.413350.patch
Type: text/x-patch
Size: 9658 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220307/ee2b6da7/attachment.bin>


More information about the llvm-commits mailing list