[PATCH] D72744: [NFC] Refactor InlineResult for readability

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 16:23:37 PST 2020


mtrofin created this revision.
Herald added subscribers: llvm-commits, haicheng, hiraditya, eraman, nhaehnle, jvesely, arsenm.
Herald added a project: LLVM.
mtrofin added reviewers: eraman, davidxl.

InlineResult is used both in APIs assessing whether a call site is
inlinable (e.g. llvm::isInlineViable) as well as in the function
inlining utility (llvm::InlineFunction). It means slightly different
things (can/should inlining happen, vs did it happen), and the
implicit casting may introduce ambiguity (casting from 'false' in
InlineFunction will default a message about hight costs,
which is incorrect here).

The change renames the type to a more generic name, and disables
implicit constructors.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72744

Files:
  llvm/include/llvm/Analysis/InlineCost.h
  llvm/include/llvm/Transforms/Utils/Cloning.h
  llvm/lib/Analysis/InlineCost.cpp
  llvm/lib/CodeGen/SafeStack.cpp
  llvm/lib/Target/AMDGPU/AMDGPUInline.cpp
  llvm/lib/Transforms/IPO/AlwaysInliner.cpp
  llvm/lib/Transforms/IPO/Inliner.cpp
  llvm/lib/Transforms/IPO/PartialInlining.cpp
  llvm/lib/Transforms/IPO/SampleProfile.cpp
  llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
  llvm/lib/Transforms/Utils/InlineFunction.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72744.238134.patch
Type: text/x-patch
Size: 27675 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200115/bf1805c4/attachment.bin>


More information about the llvm-commits mailing list