This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Prefix outlined and reduction func names with original func's name
ClosedPublic

Authored by nextsilicon-itay-bookstein on Dec 28 2022, 1:36 AM.

Details

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptDec 28 2022, 1:36 AM
nextsilicon-itay-bookstein requested review of this revision.Dec 28 2022, 1:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 28 2022, 1:36 AM

can we update some tests to see the results?

Update relevant test outputs.

I had to cut context lines to 2 to fit in the 8MB limit. It looks like there are a few files that absorb way more line diff than makes sense, but I haven't investigated way. One particular offender is clang/test/OpenMP/nvptx_SPMD_codegen.cpp, which loses 23KLOC. I think some of the NVPTX files are not idempotent under update_cc_test_checks in master, but I haven't checked again to make sure.

Generally, I think this is fine. I left comments below.

clang/lib/CodeGen/CGOpenMPRuntime.cpp
1261

why the empty string?

clang/test/OpenMP/declare_target_codegen_globalization.cpp
65

This might be easier to debug than the SPMD test. For some reason the function is gone, which is bad. My money is on the trailing $ which prevents us from matching it as a function in the update test script. That said, I really doubt we want that $ anyway.

Removed the empty string in the getName() invocation for the outlined helper's name.

jdoerfert accepted this revision.Mar 22 2023, 4:56 PM

Assuming this passes all tests, incl. runtime tests in openmp/libomptarget/tests, LGTM.

This revision is now accepted and ready to land.Mar 22 2023, 4:56 PM

Minor fix to the clang/CodeGen/ppc64le-varargs-f128.c test.

@jdoerfert Does the PR CI run these, or are there build bots that cover the different target-offloading variants? Can I somehow check this prior to merging without having all hardware variants on-hand?

Retry, wrong patch uploaded last time.

Another minor tweak to clang/test/CodeGen/PowerPC/ppc64le-varargs-f128.c.

Passes CI. How should I proceed w.r.t. libomptarget tests?

Minor fix to the clang/CodeGen/ppc64le-varargs-f128.c test.

@jdoerfert Does the PR CI run these, or are there build bots that cover the different target-offloading variants? Can I somehow check this prior to merging without having all hardware variants on-hand?

There is a buildbot for AMDGPU and the x86 fallback. Not sure about the status of the NVPTX openmp offloading buildbot.
What hardware do you have access to? I could potentially give it a try on AMDGPU prior to merging.

I don't have non-cumbersome access to GPU targets at the moment.
I have run the following locally with the patch, and it seems to pass:

> ninja check-libomptarget
[0/1] Running libomptarget tests

Testing Time: 9.69s
  Unsupported:  57
  Passed     : 205

This is with the following parts enabled:

-- LIBOMPTARGET: Building offloading runtime library libomptarget.
-- LIBOMPTARGET: Not building aarch64 offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Building AMDGPU plugin for dlopened libhsa
-- LIBOMPTARGET: Not generating AMDGPU tests, no supported devices detected. Use 'LIBOMPTARGET_FORCE_AMDGPU_TESTS' to override.
-- LIBOMPTARGET: Building CUDA offloading plugin.
-- LIBOMPTARGET: Building CUDA plugin for dlopened libcuda
-- LIBOMPTARGET: Not generating NVIDIA tests, no supported devices detected. Use 'LIBOMPTARGET_FORCE_NVIDIA_TESTS' to override.
-- LIBOMPTARGET: Not building PPC64 offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Not building PPC64le offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Not building nec-aurora plugin: libveo or libveosinfo not found.
-- LIBOMPTARGET: Building x86_64 offloading plugin.
-- LIBOMPTARGET: Not building aarch64 NextGen offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Building AMDGPU NextGen plugin for dlopened libhsa
-- LIBOMPTARGET: Building CUDA NextGen offloading plugin.
-- LIBOMPTARGET: Building CUDA plugin for dlopened libcuda
-- LIBOMPTARGET: Not building PPC64 NextGen offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Not building PPC64le NextGen offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Building x86_64 NextGen offloading plugin.
-- LIBOMPTARGET: Building DeviceRTL. Using clang from in-tree build
-- LIBOMPTARGET: Building the llvm-omp-device-info tool
-- LIBOMPTARGET: Building the llvm-omp-kernel-replay tool

I'll get back to this soon, enjoyed vacation. ;)

Tested on AMDGPU (gfx90a)

-- OpenMP tools dir in libomptarget: /home/janplehr/git/trunk17.0/build/llvm-project/runtimes/runtimes-bins/openmp/runtime/src
-- LIBOMPTARGET: Building offloading runtime library libomptarget.
-- LIBOMPTARGET: Not building aarch64 offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Building AMDGPU plugin linked against libhsa
-- LIBOMPTARGET: Not building CUDA offloading plugin: LIBOMPTARGET_BUILD_CUDA_PLUGIN is false
-- LIBOMPTARGET: Not building PPC64 offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Not building PPC64le offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Not building nec-aurora plugin: libveo or libveosinfo not found.
-- LIBOMPTARGET: Building x86_64 offloading plugin.
-- LIBOMPTARGET: Not building aarch64 NextGen offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Building AMDGPU NextGen plugin linked against libhsa
-- LIBOMPTARGET: Not building CUDA NextGen offloading plugin: LIBOMPTARGET_BUILD_CUDA_PLUGIN is false
-- LIBOMPTARGET: Not building PPC64 NextGen offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Not building PPC64le NextGen offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Building x86_64 NextGen offloading plugin.

Before
Testing Time: 44.63s

Unsupported: 123
Passed     : 657

After
Testing Time: 38.74s

Unsupported: 123
Passed     : 657

Alright, cool, thanks! I'll land it tomorrow evening if there are no objections.

I'm seeing some test failures in our CI:

Clang :: OpenMP/parallel_masked.cpp
Clang :: OpenMP/parallel_masked_target.cpp

Bot: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64-rbe/b8783369579855138017/overview

If this will be hard to fix, can you revert until a fix is ready?

Sorry, I missed that this was already reverted.

nextsilicon-itay-bookstein marked 2 inline comments as done.

Reopening due to revert, will update with a fixed patch

This revision is now accepted and ready to land.Apr 19 2023, 11:13 AM
nextsilicon-itay-bookstein edited the summary of this revision. (Show Details)

Updated a couple of tests that were introduced in the interim

This revision was landed with ongoing or failed builds.Apr 19 2023, 1:01 PM
This revision was automatically updated to reflect the committed changes.