[PATCH] D152054: [OpenMP] Codegen support for thread_limit on target directive

2023-09-10 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. In D152054#4642725 , @kaz7 wrote: > I run check-openmp on our machine, this omp_get_thread_limit() returns > default thread limit 2147483647 (=0x7fff). That is something wrong because this patch is about host instead

[PATCH] D157040: [OpenMP][IR] Set correct alignment for internal variables

2023-08-10 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 accepted this revision. tianshilei1992 added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157040/new/ https://reviews.llvm.org/D157040 ___

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-08-04 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added inline comments. Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:4065 + Constant *KernelEnvironmentGV = new GlobalVariable( + M, KernelEnvironment, /* IsConstant */ true, GlobalValue::ExternalLinkage, + KernelEnvironmentInitializer, KernelEn

[PATCH] D152054: [OpenMP] Codegen support for thread_limit on target directive

2023-08-04 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. Is this patch to support `thread_limit` on `target` directive on the host? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152054/new/ https://reviews.llvm.org/D152054 ___ c

[PATCH] D156901: [OpenMP] Change OpenMP default version in documentation and help text for -fopenmp-version

2023-08-02 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added inline comments. Comment at: flang/test/Driver/driver-help.f90:55 ! HELP-NEXT: -fopenmp-version= -! HELP-NEXT:Set OpenMP version (e.g. 45 for OpenMP 4.5, 50 for OpenMP 5.0). Default value is 50 for Clang and 11 for Flang +! HELP-NEXT

[PATCH] D156901: [OpenMP] Change OpenMP default version in documentation and help text for --fopenmp-version

2023-08-02 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added inline comments. Comment at: flang/test/Driver/driver-help.f90:55 ! HELP-NEXT: -fopenmp-version= -! HELP-NEXT:Set OpenMP version (e.g. 45 for OpenMP 4.5, 50 for OpenMP 5.0). Default value is 50 for Clang and 11 for Flang +! HELP-NEXT

[PATCH] D156368: [OpenMP] Do not always emit unused extern variables

2023-07-28 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. I think this is reasonable. Comment at: clang/test/OpenMP/declare_target_codegen.cpp:264 -// CHECK-DAG: !{i32 1, !"aaa", i32 0, i32 {{[0-9]+}}} -// CHECK-DAG: !{i32 1, !"ccc", i32 0, i32 {{[0-9]+}}} // CHECK-DAG: !{{{.+}}virtual_foo

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-07-26 Thread Shilei Tian via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG10068cd65440: [OpenMP] Introduce kernel environment (authored by tianshilei1992). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-07-26 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 544381. tianshilei1992 added a comment. rebase and prepare for landing Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569 Files: clang/lib/CodeGen/CGOpenMPRunti

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-07-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 544183. tianshilei1992 added a comment. rebase and fix test issues Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569 Files: clang/lib/CodeGen/CGOpenMPRuntimeGP

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-07-23 Thread Shilei Tian via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc5c8040390e7: [OpenMP] Introduce kernel environment (authored by tianshilei1992). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-07-23 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 54. tianshilei1992 added a comment. rebase. I'll land it and see if AMD buildbot will be happy. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569 Files: c

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-07-23 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 543303. tianshilei1992 added a comment. Herald added subscribers: gysit, Dinistro, bviyer, Moerafaat, zero9178, bzcheeseman, awarzynski, sdasgup3, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo,

[PATCH] D155692: [clang][OpenMP] Add interop support for multiple depend clauses

2023-07-19 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. In D155692#4515364 , @mhalk wrote: > In D155692#4515265 , > @tianshilei1992 wrote: > >> We don't need to update the interface function to indicate how many deps we >> have? > > Wh

[PATCH] D155692: [clang][OpenMP] Add interop support for multiple depend clauses

2023-07-19 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. We don't need to update the interface function to indicate how many deps we have? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155692/new/ https://reviews.llvm.org/D155692 _

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-07-17 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. For AMDGPU it is something in the linker. If I directly read the struct from `.o` file, the value is correct, but if I read from `.img` which is generated by `lld`, then the value is messy/random. @__omp_offloading_32_71401f4c_main_l12_dynamic_environment = int

[PATCH] D153883: [Clang][OpenMP] Enable use of __kmpc_alloc_shared for VLAs defined in AMD GPU offloaded regions

2023-06-28 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. I think it's better to just limit it to AMDGPU for now. BTW, it might be worth to check if heap-to-stack will push it back to stack. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153883/new/ https://reviews.llvm.org/

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-06-01 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. ping @arsenm Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[PATCH] D141627: [Clang][OpenMP] Fix the issue that list items in `has_device_addr` are still mapped to the target device

2023-05-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. `12d840375d5a81e9ce1050354371c550669de2d7` should fix the case. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141627/new/ https://reviews.llvm.org/D141627 ___ cfe-commits

[PATCH] D141627: [Clang][OpenMP] Fix the issue that list items in `has_device_addr` are still mapped to the target device

2023-05-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. In D141627#4374782 , @dyung wrote: > In D141627#4374757 , > @tianshilei1992 wrote: > >> In D141627#4374753 , @Northbadge >> wrote: >> >>>

[PATCH] D141627: [Clang][OpenMP] Fix the issue that list items in `has_device_addr` are still mapped to the target device

2023-05-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. In D141627#4374753 , @Northbadge wrote: > FYI this is failing- > https://lab.llvm.org/buildbot/#/builders/109/builds/64971/steps/6/logs/FAIL__Clang__bug59160_c Thanks. I pushed a fix in eaf3de6970fc

[PATCH] D141627: [Clang][OpenMP] Fix the issue that list items in `has_device_addr` are still mapped to the target device

2023-05-25 Thread Shilei Tian via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb8e3077d60de: [Clang][OpenMP] Fix the issue that list items in `has_device_addr` are still… (authored by tianshilei1992). Repository: rG LLVM Gith

[PATCH] D141627: [Clang][OpenMP] Fix the issue that list items in `has_device_addr` are still mapped to the target device

2023-05-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 525627. tianshilei1992 added a comment. add a test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141627/new/ https://reviews.llvm.org/D141627 Files: clang/lib/CodeGen/CGOpenMPRuntime.cpp clang/test/

[PATCH] D150461: [OpenMP] Naturally align internal global variables in the OpenMPIRBuilder

2023-05-12 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 accepted this revision. tianshilei1992 added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150461/new/ https://reviews.llvm.org/D150461 _

[PATCH] D150156: [OpenMP] Fix incorrect interop type for number of dependencies

2023-05-08 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 accepted this revision. tianshilei1992 added a comment. This revision is now accepted and ready to land. Does this cause the IR issue? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150156/new/ https://reviews.llvm.org/D150156 __

[PATCH] D149641: [docs] Hide collaboration and include graphs in doxygen docs

2023-05-02 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. Looks good on the OpenMP side as we don’t generally have a good API doc anyway. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149641/new/ https://reviews.llvm.org/D149641

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-05-01 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added inline comments. Comment at: llvm/test/Transforms/OpenMP/always_inline_device.ll:11 -; Function Attrs: norecurse nounwind +@kernel_environment = local_unnamed_addr constant %struct.KernelEnvironmentTy { %struct.ConfigurationEnvironmentTy { i8 1, i8 0, i8 1

[PATCH] D141627: [Clang][OpenMP] Fix the issue that list items in `has_device_addr` are still mapped to the target device

2023-04-27 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141627/new/ https://reviews.llvm.org/D141627 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-04-22 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 516110. tianshilei1992 added a comment. Fix two test failres. It looks like not working on AMDGPU because of the global read on the host is not correct. Needs to investigate more. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-04-22 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 reopened this revision. tianshilei1992 added a comment. This revision is now accepted and ready to land. In D142569#4290109 , @ronlieb wrote: > @tianshilei1992 this seems to have broken the amdgpu buildbot, could you > please address qui

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-04-22 Thread Shilei Tian via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG35cfadfbe2de: [OpenMP] Introduce kernel environment (authored by tianshilei1992). Herald added a subscriber: hoy. Repository: rG LLVM Github Monor

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-04-22 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 516088. tianshilei1992 added a comment. add the last test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569 Files: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp c

[PATCH] D141627: [Clang][OpenMP] Fix the issue that list items in `has_device_addr` are still mapped to the target device

2023-04-22 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. After reading some threads (https://github.com/OpenMP/spec/issues/2178#issue-622053885 and https://github.com/OpenMP/spec/issues/1870), I think `has_device_addr` is not supposed to have any semantics about creating a mapping, especially in `https://github.com/Op

[PATCH] D141627: [Clang][OpenMP] Fix the issue that list items in `has_device_addr` are still mapped to the target device

2023-04-22 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 516086. tianshilei1992 added a comment. Herald added subscribers: jplehr, sunshaoce. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141627/new/ https://reviews.llvm.org/D141627 Files: clang/lib/

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-04-21 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 515876. tianshilei1992 added a comment. update more tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569 Files: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp c

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-04-21 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 515854. tianshilei1992 added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569 Files: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp clang/test/H

[PATCH] D130545: [cmake] Slight fix ups to make robust to the full range of GNUInstallDirs

2023-04-20 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. Herald added subscribers: ekilmer, jplehr, StephenFan. This patch breaks the assumption that some projects are supposed to support to be built as a standalone project. For example, we do have a standalone release for OpenMP (https://github.com/llvm/llvm-project/r

[PATCH] D144873: [OpenMP] Ignore implicit casts on assertion for `use_device_ptr`

2023-02-27 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 accepted this revision. tianshilei1992 added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144873/new/ https://reviews.llvm.org/D144873 _

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-02-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. Only `llvm/test/Transforms/OpenMP/spmdization_constant_prop.ll` is left. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569 ___ cfe

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-02-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 500440. tianshilei1992 added a comment. Herald added subscribers: okura, kuter, steven_wu. update tests in LLVM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569

[PATCH] D144590: Fix shared memory allocation on AMDGPU

2023-02-22 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 accepted this revision. tianshilei1992 added a comment. This revision is now accepted and ready to land. I think this looks reasonable to me. @jdoerfert WDYT? I'm not sure if you need to fix some clang tests. Let's see if Buildbot is happy. Repository: rG LLVM Github Monorepo

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-02-22 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 499555. tianshilei1992 marked 2 inline comments as done. tianshilei1992 added a comment. rebase and fix comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-02-21 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. Pass two benchmarks: XSBench and RSBench. The patch will break the old plugins as well. I'm wondering we might want to land it after D142820 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-02-21 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 marked 2 inline comments as done. tianshilei1992 added inline comments. Comment at: openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp:583 + if (!KernelEnvOrError) +return KernelEnvOrError.takeError(); + jdoerfert

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-02-21 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 499355. tianshilei1992 added a comment. rebase, update tests, fix comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569 Files: clang/lib/CodeGen/CGOpenMPR

[PATCH] D144320: [Clang][OpenMP] Update tests using update_cc_test_checks.py

2023-02-21 Thread Shilei Tian via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG270f533e8b0c: [Clang][OpenMP] Update tests using update_cc_test_checks.py (authored by tianshilei1992). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D144320: [Clang][OpenMP] Update tests using update_cc_test_checks.py

2023-02-21 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 499337. tianshilei1992 added a comment. update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144320/new/ https://reviews.llvm.org/D144320 Files: clang/test/OpenMP/amdgcn_target_codegen.cpp clang/tes

[PATCH] D144320: [Clang][OpenMP] Update tests using update_cc_test_checks.py

2023-02-21 Thread Shilei Tian via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG61faf261506f: [Clang][OpenMP] Update tests using update_cc_test_checks.py (authored by tianshilei1992). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D144320: [Clang][OpenMP] Update tests using update_cc_test_checks.py

2023-02-21 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 499241. tianshilei1992 added a comment. remove hash Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144320/new/ https://reviews.llvm.org/D144320 Files: clang/test/OpenMP/amdgcn_target_codegen.cpp clan

[PATCH] D143306: [Driver] Default to -fno-openmp-implicit-rpath

2023-02-20 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. I prefer to follow established convention. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143306/new/ https://reviews.llvm.org/D143306 ___ cfe-commits mailing list cfe-comm

[PATCH] D144320: [Clang][OpenMP] Update tests using update_cc_test_checks.py

2023-02-18 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 498610. tianshilei1992 added a comment. unify check prefix(es) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144320/new/ https://reviews.llvm.org/D144320 Files: clang/test/OpenMP/amdgcn_target_codegen

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-02-17 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added inline comments. Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:3910 + // proper method. + if (Kernel->hasLocalLinkage()) { +assert(Kernel->hasOneUse() && "Unexpected use of debug kernel wrapper."); This doesn't work as expected.

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-02-17 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 498492. tianshilei1992 marked 7 inline comments as done. tianshilei1992 added a comment. rebase and fix comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569

[PATCH] D143768: [Clang] Add options to disable direct linking of arch tools

2023-02-11 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. FWIW, there are methods in CMake to check if features (such as if a struct contains specific data member, or if a library contains APIs). I think that would be the right way to fix the issue. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

[PATCH] D142569: [WIP][OpenMP] Introduce kernel argument

2023-02-01 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 493978. tianshilei1992 added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569 Files: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp llvm/include

[PATCH] D142985: [LinkerWrapper] Fix memory issues due to unguarded accesses to global state

2023-02-01 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 accepted this revision. tianshilei1992 added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142985/new/ https://reviews.llvm.org/D142985 _

[PATCH] D142569: [WIP][OpenMP] Introduce kernel argument

2023-01-28 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added inline comments. Comment at: openmp/libomptarget/plugins/cuda/src/rtl.cpp:26 #include "Debug.h" -#include "DeviceEnvironment.h" +#include "Environment.h" #include "omptarget.h" These changes in old plugins will be gone because the old plugi

[PATCH] D142569: [WIP][OpenMP] Introduce kernel argument

2023-01-28 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 493043. tianshilei1992 added a comment. rebase and fix bugs Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569 Files: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp

[PATCH] D142569: [WIP][OpenMP] Introduce kernel argument

2023-01-28 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 493019. tianshilei1992 added a comment. rebase and fix bugs Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569 Files: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp

[PATCH] D142569: [WIP][OpenMP] Introduce kernel argument

2023-01-26 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 492495. tianshilei1992 added a comment. rebase and fix problems Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569 Files: clang/lib/CodeGen/CGOpenMPRuntimeGPU.c

[PATCH] D129008: [Clang][OpenMP] Fix the issue that globalization doesn't work with byval struct function argument

2023-01-26 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. In D129008#4083185 , @ABataev wrote: > In D129008#4083150 , > @tianshilei1992 wrote: > >>> There are a bunch of places we do that for various language extensions >>> already, incl

[PATCH] D129008: [Clang][OpenMP] Fix the issue that globalization doesn't work with byval struct function argument

2023-01-26 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. @rjmccall @ABataev Thanks for the help. So the basic idea is to build the expressions in Sema for those captured decls and then emit them accordingly in code gen, right? > There are a bunch of places we do that for various language extensions > already, includin

[PATCH] D142297: [Clang][OpenMP] Find the type `omp_allocator_handle_t` from identifier table

2023-01-26 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. In D142297#4082242 , @mstorsjo wrote: > This change broke the `parallel/bug54082.c` testcase in the OpenMP runtime > test set, when running on Windows (both mingw and MSVC configurations, and > happening both in i386 and

[PATCH] D142569: [WIP][OpenMP] Introduce kernel argument

2023-01-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 492322. tianshilei1992 added a comment. fix bugs and add plugin support Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm.org/D142569 Files: clang/lib/CodeGen/CGOpenMPRunt

[PATCH] D142569: [WIP][OpenMP] Introduce kernel argument

2023-01-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 492316. tianshilei1992 added a comment. rebase, fix comments, added more code. features are finished now. time to move to tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews

[PATCH] D142569: [WIP][OpenMP] Introduce kernel argument

2023-01-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added inline comments. Comment at: openmp/libomptarget/DeviceRTL/src/Configuration.cpp:57 + return !__omp_rtl_assume_no_nested_parallelism || + state::getKernelEnvironment().Configuration.MayUseNestedParallelism; } jdoerfert wrote: > This

[PATCH] D142569: [WIP][OpenMP] Introduce kernel argument

2023-01-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added inline comments. Comment at: llvm/lib/Transforms/IPO/OpenMPOpt.cpp:2544 - ~AAExecutionDomainFunction() { -delete RPOT; - } + ~AAExecutionDomainFunction() { delete RPOT; } This will be removed properly later. Repository: rG LLVM

[PATCH] D142569: [WIP][OpenMP] Introduce kernel argument

2023-01-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 492278. tianshilei1992 marked 6 inline comments as done. tianshilei1992 added a comment. rebase, add more code, fix comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142569/new/ https://reviews.llvm

[PATCH] D142569: [WIP][OpenMP] Introduce kernel argument

2023-01-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added inline comments. Comment at: llvm/lib/Transforms/IPO/OpenMPOpt.cpp:3479-3486 + /// Return the IdentTy (ident_ty) corresponding to the associated kernel. + Constant *getKernelIdent(ConstantStruct *StructC) { +GlobalVariable *KernelEnvGV = getKernelEnviro

[PATCH] D142570: [nvptx-arch] Remove `find_package(CUDA)` as it has been deprecated.

2023-01-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 accepted this revision. tianshilei1992 added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142570/new/ https://reviews.llvm.org/D142570 _

[PATCH] D142569: [WIP][OpenMP] Introduce kernel argument

2023-01-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 created this revision. Herald added subscribers: kosarev, ormris, kerbowa, guansong, hiraditya, yaxunl, jvesely. Herald added a project: All. tianshilei1992 requested review of this revision. Herald added a reviewer: jdoerfert. Herald added a reviewer: jdoerfert. Herald added a revi

[PATCH] D129008: [Clang][OpenMP] Fix the issue that globalization doesn't work with byval struct function argument

2023-01-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. In D129008#4079892 , @ABataev wrote: > In D129008#4079872 , > @tianshilei1992 wrote: > >> In D129008#4079660 , >> @aaron.ballman wrote: >

[PATCH] D129008: [Clang][OpenMP] Fix the issue that globalization doesn't work with byval struct function argument

2023-01-25 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. In D129008#4079660 , @aaron.ballman wrote: > In D129008#3640194 , > @tianshilei1992 wrote: > >> `callCStructCopyConstructor` is actually for Objective-C…Cannot use it here. > > Is

[PATCH] D142297: [Clang][OpenMP] Find the type `omp_allocator_handle_t` from identifier table

2023-01-24 Thread Shilei Tian via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG5ba8ecb6cc7b: [Clang][OpenMP] Find the type `omp_allocator_handle_t` from identifier table (authored by tianshilei1992). Repository: rG LLVM Githu

[PATCH] D129008: [Clang][OpenMP] Fix the issue that globalization doesn't work with byval struct function argument

2023-01-24 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a subscriber: aaron.ballman. tianshilei1992 added inline comments. Comment at: clang/lib/CodeGen/CGDecl.cpp:2501 + LValue Src = MakeAddrLValue(Arg.getIndirectAddress(), Ty); + callCStructCopyConstructor(Dst, Src); + PushCleanupIfNeeded(Arg.getI

[PATCH] D142297: [Clang][OpenMP] Find the type `omp_allocator_handle_t` from identifier table

2023-01-24 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 491976. tianshilei1992 added a comment. use compiler builtin for types Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142297/new/ https://reviews.llvm.org/D142297 Files: clang/lib/Sema/SemaOpenMP.cpp

[PATCH] D142297: [Clang][OpenMP] Find the type `omp_allocator_handle_t` from identifier table

2023-01-24 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 marked an inline comment as done. tianshilei1992 added inline comments. Comment at: clang/test/OpenMP/target_uses_allocators.c:108 // CHECK-NEXT: store i32 %[[#R1]], ptr %.x..void.addr, align 4 -// CHECK-NEXT: call void @__kmpc_free(i32 %[[#R0]], ptr %.x..void.add

[PATCH] D142297: [Clang][OpenMP] Find the type `omp_allocator_handle_t` from identifier table

2023-01-24 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 491972. tianshilei1992 added a comment. rebase and fix comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142297/new/ https://reviews.llvm.org/D142297 Files: clang/lib/Sema/SemaOpenMP.cpp clang/

[PATCH] D142297: [Clang][OpenMP] Find the type `omp_allocator_handle_t` from identifier table

2023-01-21 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 created this revision. tianshilei1992 added reviewers: jdoerfert, ABataev. Herald added subscribers: guansong, yaxunl. Herald added a project: All. tianshilei1992 requested review of this revision. Herald added subscribers: openmp-commits, cfe-commits, sstefan1. Herald added projects

[PATCH] D142233: [Clang][OpenMP] Bail out early if `Scope` is nullptr in case of any crash

2023-01-20 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. In D142233#4070572 , @vitalybuka wrote: > Fails on this bot > https://lab.llvm.org/buildbot/#/builders/5/builds/30884/steps/13/logs/stdio It's been fixed by https://github.com/llvm/llvm-project/commit/b561c5c149467c9809

[PATCH] D142233: [Clang][OpenMP] Bail out early if `Scope` is nullptr in case of any crash

2023-01-20 Thread Shilei Tian via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. tianshilei1992 marked an inline comment as done. Closed by commit rG2ebda47619d7: [Clang][OpenMP] Bail out early if `Scope` is nullptr in case of any crash (authored by

[PATCH] D142233: [Clang][OpenMP] Bail out early if `Scope` is nullptr in case of any crash

2023-01-20 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 490896. tianshilei1992 added a comment. fix comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142233/new/ https://reviews.llvm.org/D142233 Files: clang/lib/Sema/SemaOpenMP.cpp clang/test/OpenMP/

[PATCH] D142233: [Clang][OpenMP] Bail out early if `Scope` is nullptr in case of any crash

2023-01-20 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:7249 // checking for any calls inside an Order region if (Scope->isOpenMPOrderClauseScope()) Diag(LParenLoc, diag::err_omp_unexpected_call_to_omp_runtime_api); ABatae

[PATCH] D142233: [Clang][OpenMP] Bail out early if `Scope` is nullptr in case of any crash

2023-01-20 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 created this revision. tianshilei1992 added reviewers: jdoerfert, ABataev, sandeepkosuri, cchen, jyu2. Herald added subscribers: guansong, yaxunl. Herald added a project: All. tianshilei1992 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1. Herald ad

[PATCH] D142075: [Clang][OpenMP] Allow `f16` literal suffix when compiling OpenMP target offloading for NVPTX

2023-01-19 Thread Shilei Tian via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG9c2cfaaada66: [Clang][OpenMP] Allow `f16` literal suffix when compiling OpenMP target… (authored by tianshilei1992). Repository: rG LLVM Github Mo

[PATCH] D142075: [Clang][OpenMP] Allow `f16` literal suffix when compiling OpenMP target offloading for NVPTX

2023-01-18 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 updated this revision to Diff 490375. tianshilei1992 added a comment. fix comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142075/new/ https://reviews.llvm.org/D142075 Files: clang/lib/Lex/LiteralSupport.cpp clang/test/Ope

[PATCH] D142075: [Clang][OpenMP] Allow `f16` literal suffix when compiling OpenMP target offloading for NVPTX

2023-01-18 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 created this revision. tianshilei1992 added reviewers: jdoerfert, jhuber6, yaxunl, rjmccall, tra. Herald added subscribers: mattd, gchakrabarti, asavonic, guansong. Herald added a project: All. tianshilei1992 requested review of this revision. Herald added subscribers: cfe-commits, s

[PATCH] D141935: [OpenMP] Make `-Xarch_host` and `-Xarch_device` work for OpenMP offloading

2023-01-17 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 accepted this revision. tianshilei1992 added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141935/new/ https://reviews.llvm.org/D141935 ___

[PATCH] D141873: [Clang][OpenMP] Fix the issue that a functor is not captured properly in a task region

2023-01-16 Thread Shilei Tian via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGae53c7f4a211: [Clang][OpenMP] Fix the issue that a functor is not captured properly in a task… (authored by tianshilei1992). Repository: rG LLVM G

[PATCH] D141873: [Clang][OpenMP] Fix the issue that a functor is not captured properly in a task region

2023-01-16 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 created this revision. tianshilei1992 added reviewers: ABataev, jdoerfert. Herald added subscribers: guansong, yaxunl. Herald added a project: All. tianshilei1992 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1. Herald added a project: clang. This

[PATCH] D141861: [nvptx-arch] Dynamically load the CUDA runtime if not found during the build

2023-01-16 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 accepted this revision. tianshilei1992 added a comment. This revision is now accepted and ready to land. Yeah, otherwise I suppose there will be some errors when compiling OpenMP program when there is no CUDA installed. Comment at: clang/tools/nvptx-arch/NVPTXAr

[PATCH] D141627: [Clang][OpenMP] Fix the issue that list items in `has_device_addr` are still mapped to the target device

2023-01-13 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. In D141627#4052323 , @abhinavgaba wrote: >> In target data we already put a and b in use_device_addr. That indicates all >> use of a and b will be the corresponding device addresses. Therefore, in >> target directive, we

[PATCH] D141627: [Clang][OpenMP] Fix the issue that list items in `has_device_addr` are still mapped to the target device

2023-01-13 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. In D141627#4051851 , @jyu2 wrote: > That part of code is original add for is_device_address, so I just wonder, if > the change could break is_device_address? Now I kinda think it is not right to mix `is_device_address` an

[PATCH] D141627: [Clang][OpenMP] Fix the issue that list items in `has_device_addr` are still mapped to the target device

2023-01-12 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. FWIW, I think `has_device_addr(b[0])` is not trying to take the value of `b[0]` in this case. Instead, it's just to take the address of the first element of `b`. Only pointer arithmetic will be involved. It's not necessarily illegal to do it in that way. Reposi

[PATCH] D141627: [Clang][OpenMP] Fix the issue that list items in `has_device_addr` are still mapped to the target device

2023-01-12 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. I agree that b is not right here, but that doesn’t matter because I stepped into the runtime library and it crashed when processing a. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141627/new/ https://reviews.llvm.o

[PATCH] D134268: [Clang][OpenMP] Codegen generation for has_device_addr claues.

2023-01-12 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:9098 + CombinedInfo.Types.push_back( + (Cap->capturesVariable() ? OMP_MAP_TO : OMP_MAP_LITERAL) | + OMP_MAP_TARGET_PARAM); tianshilei1992 wrote: > The v

[PATCH] D141627: [Clang][OpenMP] Fix the issue that list items in `has_device_addr` are still mapped to the target device

2023-01-12 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 created this revision. tianshilei1992 added reviewers: ABataev, jdoerfert, abhinavgaba, jyu2. Herald added subscribers: guansong, yaxunl. Herald added a project: All. tianshilei1992 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1. Herald added a pro

[PATCH] D134268: [Clang][OpenMP] Codegen generation for has_device_addr claues.

2023-01-12 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added a comment. Hi there, I'm trying to fix https://github.com/llvm/llvm-project/issues/59160. The faulty case is basically like following: cpp void xoo() { short a[10], b[10]; a[1] = 111; b[1] = 111; #pragma omp target data map(to : a[0 : 2], b[0 : 2]) use_devi

[PATCH] D141545: [OpenMP] Implement `omp_get_mapped_ptr`

2023-01-11 Thread Shilei Tian via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG6e18277a5118: [OpenMP] Implement `omp_get_mapped_ptr` (authored by tianshilei1992). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D141545: [OpenMP] Implement `omp_get_mapped_ptr`

2023-01-11 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 added inline comments. Comment at: openmp/libomptarget/src/api.cpp:355 + bool IsHostPtr = false; + auto &Device = *PM->Devices[DeviceNum]; + TargetPointerResultTy TPR = jdoerfert wrote: > And this needs to be (shared) locked too. > > @carlo.be

  1   2   3   4   5   6   >