RE: [PATCH] D110429: [OpenMP] Introduce a new worksharing RTL function for distribute

2021-09-27 Thread Lieberman, Ron via cfe-commits
[AMD Official Use Only]

Yes, thank you, it was two dependent patches 
Builder 1 only saw 1st patch, failed, then 2nd patch arrived, and passed.
Builder 2 picked up both and passed

All good.

-Original Message-
From: Johannes Doerfert via Phabricator  
Sent: Monday, September 27, 2021 12:07 PM
To: jhub...@vols.utk.edu; jdoerf...@anl.gov; tianshilei1...@gmail.com
Cc: Lieberman, Ron ; stefomeis...@gmail.com; 
cfe-commits@lists.llvm.org; llvm-comm...@lists.llvm.org; Liu, Yaxun (Sam) 
; zhang.guans...@gmail.com; Kumar N, Bhuvanendra 
; yanliang...@intel.com; dougp...@gmail.com; 
mlek...@skidmore.edu; blitzrak...@gmail.com; shen...@google.com; 
david.gr...@arm.com; t...@google.com; Song, Ruiling 
Subject: [PATCH] D110429: [OpenMP] Introduce a new worksharing RTL function for 
distribute

[CAUTION: External Email]

jdoerfert added a comment.

In D110429#3024886 
<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD110429%233024886&data=04%7C01%7Cron.lieberman%40amd.com%7C3712fe9761b14dbbe0d208d981d0cac1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637683556037623058%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=OVYB9EpYX6HAPHHh%2B3LcA3KXcsxWimKvtOUkBNV7cHg%3D&reserved=0>,
 @ronlieb wrote:

> looks like subsequent builders passed. we might have an issue where the 
> runtime was not fully built when the test ran.
> please disregard , your patch is fine.

two dependent patches and you probably picked up only one. Should resolve 
itself.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD110429%2Fnew%2F&data=04%7C01%7Cron.lieberman%40amd.com%7C3712fe9761b14dbbe0d208d981d0cac1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637683556037623058%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Mx06vT2zOUb1zF50rqbgWhHTKH%2Ba2dIunlcB4BGxwqU%3D&reserved=0

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD110429&data=04%7C01%7Cron.lieberman%40amd.com%7C3712fe9761b14dbbe0d208d981d0cac1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637683556037623058%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Eq%2FRXJpykvyBfM6x9grzFOac39xI9BnKua1fJZkfL5g%3D&reserved=0
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110429: [OpenMP] Introduce a new worksharing RTL function for distribute

2021-09-27 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment.

In D110429#3024886 , @ronlieb wrote:

> looks like subsequent builders passed. we might have an issue where the 
> runtime was not fully built when the test ran.
> please disregard , your patch is fine.

two dependent patches and you probably picked up only one. Should resolve 
itself.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110429/new/

https://reviews.llvm.org/D110429

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110429: [OpenMP] Introduce a new worksharing RTL function for distribute

2021-09-27 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment.

In D110429#3024884 , @ronlieb wrote:

> lld: error: undefined symbol: __kmpc_distribute_static_init_4
>
 referenced by 
 /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(__omp_outlined__)
 referenced by 
 /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(__omp_outlined__)
>
> lld: error: undefined symbol: __kmpc_distribute_static_fini
>
 referenced by 
 /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(__omp_outlined__)
 referenced by 
 /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(__omp_outlined__)
 referenced by 
 /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(__omp_outlined__.1)
 referenced 1 more times
>
> clang-14: error: amdgcn-link command failed with exit code 1 (use -v to see 
> invocation)

I'm guessing this has D110430  applied as 
well?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110429/new/

https://reviews.llvm.org/D110429

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110429: [OpenMP] Introduce a new worksharing RTL function for distribute

2021-09-27 Thread Ron Lieberman via Phabricator via cfe-commits
ronlieb added a comment.

looks like subsequent builders passed. we might have an issue where the runtime 
was not fully built when the test ran.
please disregard , your patch is fine.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110429/new/

https://reviews.llvm.org/D110429

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110429: [OpenMP] Introduce a new worksharing RTL function for distribute

2021-09-27 Thread Ron Lieberman via Phabricator via cfe-commits
ronlieb added a comment.

lld: error: undefined symbol: __kmpc_distribute_static_init_4

>>> referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(__omp_outlined__)
>>> referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(__omp_outlined__)

lld: error: undefined symbol: __kmpc_distribute_static_fini

>>> referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(__omp_outlined__)
>>> referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(__omp_outlined__)
>>> referenced by 
>>> /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(__omp_outlined__.1)
>>> referenced 1 more times

clang-14: error: amdgcn-link command failed with exit code 1 (use -v to see 
invocation)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110429/new/

https://reviews.llvm.org/D110429

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110429: [OpenMP] Introduce a new worksharing RTL function for distribute

2021-09-27 Thread Ron Lieberman via Phabricator via cfe-commits
ronlieb added a comment.

apologies, that pasted very poorly ...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110429/new/

https://reviews.llvm.org/D110429

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110429: [OpenMP] Introduce a new worksharing RTL function for distribute

2021-09-27 Thread Ron Lieberman via Phabricator via cfe-commits
ronlieb added a comment.

hi, we seem to have a link time error after this patch in our buildbot

https://lab.llvm.org/staging/#/builders/182/builds/2023

- TEST 'libomptarget :: amdgcn-amd-amdhsa :: mapping/private_mapping.c' FAILED 


Script:
---

: 'RUN: at line 1';   
/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/./bin/clang 
-fopenmp  -fno-experimental-isel   -I 
/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.src/openmp/libomptarget/test
 -I 
/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/runtime/src
 -L 
/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget
 -L 
/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/runtime/src
  
-Wl,-rpath,/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget
 
-Wl,-rpath,/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/runtime/src
 
--libomptarget-amdgcn-bc-path=/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget
 -fopenmp-targets=amdgcn-amd-amdhsa 
/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.src/openmp/libomptarget/test/mapping/private_mapping.c
 -o 
/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget/test/amdgcn-amd-amdhsa/mapping/Output/private_mapping.c.tmp
 && 
/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget/test/amdgcn-amd-amdhsa/mapping/Output/private_mapping.c.tmp
 | /work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/./bin/FileCheck 
/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.src/openmp/libomptarget/test/mapping/private_mapping.c
--

Exit Code: 1

Command Output (stdout):


$ ":" "RUN: at line 1"
$ "/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/./bin/clang" 
"-fopenmp" "-fno-experimental-isel" "-I" 
"/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.src/openmp/libomptarget/test"
 "-I" 
"/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/runtime/src"
 "-L" 
"/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget"
 "-L" 
"/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/runtime/src"
 
"-Wl,-rpath,/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget"
 
"-Wl,-rpath,/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/runtime/src"
 
"--libomptarget-amdgcn-bc-path=/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget"
 "-fopenmp-targets=amdgcn-amd-amdhsa" 
"/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.src/openmp/libomptarget/test/mapping/private_mapping.c"
 "-o" 
"/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget/test/amdgcn-amd-amdhsa/mapping/Output/private_mapping.c.tmp"

command stderr:
===

lld: error: undefined symbol: __kmpc_distribute_static_init_4

>>> referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(__omp_outlined__)
>>> referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(__omp_outlined__)

lld: error:

[PATCH] D110429: [OpenMP] Introduce a new worksharing RTL function for distribute

2021-09-27 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

LG.

We might be able to revert/simplify this eventually again but for now it makes 
it much simpler to distinguish the distribute and workshare (=for) via their 
call site.




Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:2879
+StaticInitFunction =
+createForStaticInitFunction(Values.IVSize, Values.IVSigned);
+

Could we pass the 4 potential functions to `createForStaticInitFunction` (or 
similar name) to avoid the duplication? Or just pass a flag.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110429/new/

https://reviews.llvm.org/D110429

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110429: [OpenMP] Introduce a new worksharing RTL function for distribute

2021-09-24 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992.
Herald added subscribers: guansong, yaxunl.
jhuber6 requested review of this revision.
Herald added subscribers: llvm-commits, cfe-commits, sstefan1.
Herald added projects: clang, LLVM.

This patch adds a new RTL function for worksharing. Currently we use
`__kmpc_for_static_init` for both the `distribute` and `parallel`
portion of the loop clause. This patch replaces the `distribute` portion
with a new runtime call `__kmpc_distribute_static_init`. Currently this
will be used exactly the same way, but will make it easier in the future
to fine-tune the distribute and parallel portion of the loop.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110429

Files:
  clang/lib/CodeGen/CGOpenMPRuntime.cpp
  clang/lib/CodeGen/CGOpenMPRuntime.h
  clang/test/OpenMP/distribute_firstprivate_codegen.cpp
  clang/test/OpenMP/distribute_lastprivate_codegen.cpp
  clang/test/OpenMP/distribute_parallel_for_firstprivate_codegen.cpp
  clang/test/OpenMP/distribute_parallel_for_if_codegen.cpp
  clang/test/OpenMP/distribute_parallel_for_lastprivate_codegen.cpp
  clang/test/OpenMP/distribute_parallel_for_num_threads_codegen.cpp
  clang/test/OpenMP/distribute_parallel_for_private_codegen.cpp
  clang/test/OpenMP/distribute_parallel_for_proc_bind_codegen.cpp
  clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_codegen.cpp
  clang/test/OpenMP/distribute_parallel_for_simd_if_codegen.cpp
  clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_codegen.cpp
  clang/test/OpenMP/distribute_parallel_for_simd_num_threads_codegen.cpp
  clang/test/OpenMP/distribute_parallel_for_simd_private_codegen.cpp
  clang/test/OpenMP/distribute_parallel_for_simd_proc_bind_codegen.cpp
  clang/test/OpenMP/distribute_private_codegen.cpp
  clang/test/OpenMP/distribute_simd_firstprivate_codegen.cpp
  clang/test/OpenMP/distribute_simd_lastprivate_codegen.cpp
  clang/test/OpenMP/distribute_simd_private_codegen.cpp
  clang/test/OpenMP/distribute_simd_reduction_codegen.cpp
  clang/test/OpenMP/nvptx_distribute_parallel_generic_mode_codegen.cpp
  clang/test/OpenMP/nvptx_target_parallel_reduction_codegen_tbaa_PR46146.cpp
  clang/test/OpenMP/nvptx_target_teams_distribute_codegen.cpp
  clang/test/OpenMP/nvptx_target_teams_distribute_parallel_for_codegen.cpp
  
clang/test/OpenMP/nvptx_target_teams_distribute_parallel_for_generic_mode_codegen.cpp
  clang/test/OpenMP/nvptx_target_teams_distribute_parallel_for_simd_codegen.cpp
  clang/test/OpenMP/nvptx_target_teams_distribute_simd_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_collapse_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_firstprivate_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_lastprivate_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_collapse_codegen.cpp
  
clang/test/OpenMP/target_teams_distribute_parallel_for_dist_schedule_codegen.cpp
  
clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_if_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_private_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_proc_bind_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen.cpp
  
clang/test/OpenMP/target_teams_distribute_parallel_for_simd_collapse_codegen.cpp
  
clang/test/OpenMP/target_teams_distribute_parallel_for_simd_dist_schedule_codegen.cpp
  
clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_codegen.cpp
  
clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_codegen.cpp
  
clang/test/OpenMP/target_teams_distribute_parallel_for_simd_private_codegen.cpp
  
clang/test/OpenMP/target_teams_distribute_parallel_for_simd_proc_bind_codegen.cpp
  
clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_private_codegen.cpp
  clang/test/OpenMP/target_teams_distribute_reduction_codegen.cpp
  clang/test/OpenMP/teams_distribute_codegen.cpp
  clang/test/OpenMP/teams_distribute_collapse_codegen.cpp
  clang/test/OpenMP/teams_distribute_firstprivate_codegen.cpp
  clang/test/OpenMP/teams_distribute_lastprivate_codegen.cpp
  clang/test/OpenMP/teams_distribute_parallel_for_collapse_codegen.cpp
  clang/test/OpenMP/teams_distribute_parallel_for_copyin_codegen.cpp
  clang/test/OpenMP/teams_distribute_parallel_for_dist_schedule_codegen.cpp
  clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_codegen.cpp
  clang/test/OpenMP/teams_distribute_parallel_for_if_codegen.cpp
  clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_codegen.cpp
  clang/test/OpenMP/teams_distribute_parallel_for_num_threads_codegen.cpp
  clang/test/OpenMP/teams_distribute_paralle