[PATCH] D134117: [Transforms] Introduce InlineFunctionAndMergeAttributes (NFC)

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 17 16:47:04 PDT 2022


kazu created this revision.
Herald added subscribers: ormris, wenlei, hiraditya.
Herald added a project: All.
kazu requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In the past, we've had a bug resulting in a compiler crash after
forgetting to merge function attributes (D105729 <https://reviews.llvm.org/D105729>).

This patch adds a function that calls InlineFunction and
mergeAttributesForInlining.  The new function provides convenience
while minimizing the "time" when the IR is valid, but the function
attributes are not.

Since there are several calls to InlineFunction that are not
accompanied by calls to mergeAttributesForInlining, this patch
introduces the new "syntactic sugar" function instead of incorporating
mergeAttributesForInlining into InlineFunction.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134117

Files:
  llvm/include/llvm/Transforms/Utils/Cloning.h
  llvm/lib/Transforms/IPO/AlwaysInliner.cpp
  llvm/lib/Transforms/IPO/Inliner.cpp
  llvm/lib/Transforms/IPO/ModuleInliner.cpp
  llvm/lib/Transforms/IPO/SampleProfile.cpp
  llvm/lib/Transforms/Utils/InlineFunction.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134117.461034.patch
Type: text/x-patch
Size: 6153 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220917/c6566919/attachment.bin>


More information about the llvm-commits mailing list