[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-08-08 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
doru1004 added a comment. The changes in this patch do not actually work correctly with kernels that really need to be in Generic mode. The ExecMode value recovered in the kmpc_kernel_init function is 3 in the case where it needs to be 1. The problem lies with the OpenMPOpt changes since

[PATCH] D142569: [OpenMP] Introduce kernel environment

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

[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,

[PATCH] D142569: [OpenMP] Introduce kernel environment

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

[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:

[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:

[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:

[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,

[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 =

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-07-12 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment. How does a function find the corresponding kernel environment at runtime? 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-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

[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

[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

[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

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-04-22 Thread Ron Lieberman via Phabricator via cfe-commits
ronlieb added a comment. @tianshilei1992 this seems to have broken the amdgpu buildbot, could you please address quickly ? or revert and fix ? 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-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

[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

[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

[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

[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 ___

[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] 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/

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-02-22 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added inline comments. Comment at: openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp:583 + if (!KernelEnvOrError) +return KernelEnvOrError.takeError(); + tianshilei1992 wrote: > jdoerfert wrote: > > We used to default

[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

[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:

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-02-21 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 Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:3917 + + Twine DynamicEnvironmenttName = KernelName + "_dynamic_environment"; + Constant

[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

[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/

[PATCH] D142569: [OpenMP] Introduce kernel environment

2023-02-14 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added inline comments. Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:3888 + + Function *Kernel = Builder.GetInsertBlock()->getParent(); Function *Fn = getOrCreateRuntimeFunctionPtr( That is not the kernel, at least not when clang emits a