[all-commits] [llvm/llvm-project] 8dce4c: [Inliner] Handle convergence control when inlining...

Sameer Sahasrabuddhe via All-commits all-commits at lists.llvm.org
Wed Aug 16 21:26:54 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8dce4c56dd760b34b222d3188a0fe26232928406
      https://github.com/llvm/llvm-project/commit/8dce4c56dd760b34b222d3188a0fe26232928406
  Author: Sameer Sahasrabuddhe <sameer.sahasrabuddhe at amd.com>
  Date:   2023-08-17 (Thu, 17 Aug 2023)

  Changed paths:
    M llvm/lib/Transforms/Utils/InlineFunction.cpp
    A llvm/test/Transforms/Inline/convergence-inline.ll

  Log Message:
  -----------
  [Inliner] Handle convergence control when inlining a call

When a convergencectrl token is passed to a convergent call, and the called
function in turn calls the entry intrinsic, the intrinsic is now now replaced
with the convergencectrl token.

The spec requires the following check:
  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.

But this change does not implement this complete check. A proper implemenation
require a whole new analysis that identifies convergence in every function. For
now, we skip that and just do a cursory check for the entry intrinsic. The
underlying assumption is that in a compiler flow that fully implements
convergence control tokens, there is no mixing of controlled and uncontrolled
convergent operations in the whole program.

This is a reboot of the original change D85606 by
Nicolai Haehnle <nicolai.haehnle at amd.com>.

Reviewed By: arsenm, nhaehnle

Differential Revision: https://reviews.llvm.org/D152431




More information about the All-commits mailing list