[all-commits] [llvm/llvm-project] c5ea46: [OMPIRBuilder] - Fix emitTargetTaskProxyFunc to no...

Pranav Bhandarkar via All-commits all-commits at lists.llvm.org
Mon Feb 17 07:45:28 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c5ea469f4dafe4c310ba26511575afda3569b0b5
      https://github.com/llvm/llvm-project/commit/c5ea469f4dafe4c310ba26511575afda3569b0b5
  Author: Pranav Bhandarkar <pranav.bhandarkar at amd.com>
  Date:   2025-02-17 (Mon, 17 Feb 2025)

  Changed paths:
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    M mlir/test/Target/LLVMIR/omptarget-depend-host-only.mlir
    M mlir/test/Target/LLVMIR/omptarget-nowait-host-only.mlir

  Log Message:
  -----------
  [OMPIRBuilder] - Fix emitTargetTaskProxyFunc to not generate empty functions (#126958)

This is a fix for https://github.com/llvm/llvm-project/issues/126949
There are two issues being fixed here.
First, in some cases, OMPIRBuilder generates empty target task proxy functions. This happens
when the target kernel doesn't use any stack-allocated data (either no data or only globals).

The second problem is encountered when the target task i.e the code that makes the target call
spans a single basic block. This usually happens when we do not generate a target or device kernel
launch and instead fall back to the host. In such cases, we end up not outlining the target task entirely. 
This can cause us to call target kernel twice - once via the target task proxy function and a second time
via the host fallback

This PR fixes both of these problems and updates some tests to catch these problems should this patch fail.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list