[PATCH] D152431: [Inliner] Handle convergence control when inlining a call

Sameer Sahasrabuddhe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 8 02:40:17 PDT 2023


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

The inliner is now aware of controlled and uncontrolled convergent operations.
A call from function F to function G can be inlined only if:

- at least one of F or G does not make any convergent calls, or,
- both F and G make the same kind of convergent calls: controlled or uncontrolled.

When such a call is inlined, if G makes a call to the entry intrinsic, this is
now replaced with the token passed in the "convergencectrl" operand bundle at
the callsite.

This adapts and supersedes the original change D85606 <https://reviews.llvm.org/D85606> by
Nicolai Haehnle <nicolai.haehnle at amd.com>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152431

Files:
  llvm/include/llvm/Analysis/ConvergenceControlUsage.h
  llvm/include/llvm/Transforms/Scalar/PlaceSafepoints.h
  llvm/include/llvm/Transforms/Utils/Cloning.h
  llvm/lib/Analysis/CMakeLists.txt
  llvm/lib/Analysis/ConvergenceControlUsage.cpp
  llvm/lib/CodeGen/SafeStack.cpp
  llvm/lib/Passes/PassBuilder.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Transforms/Coroutines/CoroSplit.cpp
  llvm/lib/Transforms/IPO/AlwaysInliner.cpp
  llvm/lib/Transforms/IPO/Inliner.cpp
  llvm/lib/Transforms/IPO/ModuleInliner.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
  llvm/test/Transforms/Inline/cgscc-incremental-invalidate.ll
  llvm/test/Transforms/Inline/convergence-inline.ll
  llvm/test/Transforms/Inline/convergence-no-mixing.ll
  llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152431.529543.patch
Type: text/x-patch
Size: 58007 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230608/e35aa8f0/attachment.bin>


More information about the llvm-commits mailing list