Page MenuHomePhabricator

tianshilei1992 (Shilei Tian)
Ph.D. student at Stony Brook University

Projects

User does not belong to any projects.

User Details

User Since
Oct 12 2019, 11:44 AM (136 w, 6 d)

Recent Activity

Mon, May 23

tianshilei1992 accepted D123286: [Clang][OpenMP] Support for omp nothing.

LG

Mon, May 23, 2:46 PM · Restricted Project, Restricted Project, Restricted Project
tianshilei1992 accepted D123235: [OpenMP] atomic compare fail : Parser & AST support.

LGTM

Mon, May 23, 2:44 PM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
tianshilei1992 abandoned D126079: [NFC][LLVM] Merge shouldExpandAtomic*InIR into shouldExpandAtomicInstInIR.
Mon, May 23, 2:40 PM · Restricted Project, Restricted Project

Sun, May 22

tianshilei1992 retitled D126079: [NFC][LLVM] Merge shouldExpandAtomic*InIR into shouldExpandAtomicInstInIR from [NFC][LLVM] Rename all shouldExpandAtomic*InIR to shouldExpandAtomicInstInIR to [NFC][LLVM] Merge shouldExpandAtomic*InIR into shouldExpandAtomicInstInIR.
Sun, May 22, 10:34 AM · Restricted Project, Restricted Project
tianshilei1992 updated the summary of D126079: [NFC][LLVM] Merge shouldExpandAtomic*InIR into shouldExpandAtomicInstInIR.
Sun, May 22, 10:33 AM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D126079: [NFC][LLVM] Merge shouldExpandAtomic*InIR into shouldExpandAtomicInstInIR.

use one function

Sun, May 22, 10:33 AM · Restricted Project, Restricted Project

Fri, May 20

tianshilei1992 abandoned D125350: [RFC][Clang] Add a check if the target supports atomicrmw instruction with specific operator and type.

Do it in BE.

Fri, May 20, 2:36 PM · Restricted Project, Restricted Project
tianshilei1992 committed rGecf5b780538e: [NVPTX] Enable AtomicExpandPass for NVPTX (authored by tianshilei1992).
[NVPTX] Enable AtomicExpandPass for NVPTX
Fri, May 20, 2:26 PM · Restricted Project, Restricted Project
tianshilei1992 closed D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.
Fri, May 20, 2:25 PM · Restricted Project, Restricted Project
tianshilei1992 committed rGff60a0a364b4: [LLVM] Add a check if should cast atomic operations to integer type (authored by tianshilei1992).
[LLVM] Add a check if should cast atomic operations to integer type
Fri, May 20, 2:24 PM · Restricted Project, Restricted Project
tianshilei1992 closed D125652: [LLVM] Add a check if should cast atomic operations to integer type.
Fri, May 20, 2:24 PM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.

fix tests

Fri, May 20, 1:10 PM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.

fix return

Fri, May 20, 12:46 PM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.

setMinCmpXchgSizeInBits(32) should fix the i8/i16 testcases, I think.

Fri, May 20, 12:45 PM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.

use setMinCmpXchgSizeInBits(32)

Fri, May 20, 12:44 PM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D126079: [NFC][LLVM] Merge shouldExpandAtomic*InIR into shouldExpandAtomicInstInIR.

My original suggestion which resulted in this patch was to generalize the API to just one function accepting Instruction* and let the target deal with the details.
For many targets there's a fair amount of duplicated code across the per-instruction variant implementation of shouldExpandX and using single call would allow to consolidate the atomic expansion logic in fewer places.

Using overloads, indeed, only makes things more opaque without reducing the API surface.

Fri, May 20, 12:10 PM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.

add i128

Fri, May 20, 11:43 AM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D126079: [NFC][LLVM] Merge shouldExpandAtomic*InIR into shouldExpandAtomicInstInIR.

IMO, this change hurts the readability of the code, not improves it.

Fri, May 20, 11:38 AM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D123235: [OpenMP] atomic compare fail : Parser & AST support.

LGTM, but please fix the build error first.

Fri, May 20, 11:31 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
tianshilei1992 requested review of D126079: [NFC][LLVM] Merge shouldExpandAtomic*InIR into shouldExpandAtomicInstInIR.
Fri, May 20, 11:02 AM · Restricted Project, Restricted Project

Tue, May 17

tianshilei1992 added inline comments to D125652: [LLVM] Add a check if should cast atomic operations to integer type.
Tue, May 17, 8:06 PM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D125652: [LLVM] Add a check if should cast atomic operations to integer type.

rebase and fix comment

Tue, May 17, 8:06 PM · Restricted Project, Restricted Project
tianshilei1992 added inline comments to D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.
Tue, May 17, 7:58 PM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.

fix comments

Tue, May 17, 7:56 PM · Restricted Project, Restricted Project
tianshilei1992 added inline comments to D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.
Tue, May 17, 9:17 AM · Restricted Project, Restricted Project

Mon, May 16

tianshilei1992 updated the diff for D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.

fix comments

Mon, May 16, 2:07 PM · Restricted Project, Restricted Project
tianshilei1992 added inline comments to D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.
Mon, May 16, 11:59 AM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D125698: [Libomptarget] Don't build the device runtime without a new Clang.

Are the llvm version variables defined for stand-alone builds? So, will stand-alone builds of OpenMP continue to work and include libomptarget code?

I'm always using standalone build. No problem. However, that might depend on how you build it. I always set the CMake compilers to what I just build. Actually I never use runtime or project build because they are less flexible.

Mon, May 16, 9:57 AM · Restricted Project, Restricted Project
tianshilei1992 added inline comments to D125698: [Libomptarget] Don't build the device runtime without a new Clang.
Mon, May 16, 9:56 AM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D125698: [Libomptarget] Don't build the device runtime without a new Clang.

LGTM.

We are using CMake's command to build the device runtime now. There is no way to tell CMake to use another compiler rather than CMake's compilers to build a specific target. As a result, we either disable it, or we are doomed.
Well, accurately speaking, there seems to be a way to do that, see https://stackoverflow.com/questions/27168094/cmake-how-to-change-compiler-for-individual-target, but I don't think manipulating CMake's internal variables is a good practice.

I didn't say to workaround CMake. I was saying it was working that clang builds DeviceRTL and gcc building all the rest and now it is broken. You can try it out yourself with the commit before D125315

I'll just guard the new code then. Even though it shouldn't break if you're using the standard builds it will probably make it less noisy for people currently using the other methods.

Eventually we will abandon the old method, no?

The old method actually work best in the current state. You thought the runtime route is better, more robust and correct. That maybe true for release but not main. I encountered clang from main miscompiling libomptarget host code and resulted in de-referencing nullptr. So right now LLVM_ENABLE_PROJECTS works best because only the DeviceLib is built by just-built Clang. This routine also doesn't require building Clang as a separate step.

Mon, May 16, 9:40 AM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D125698: [Libomptarget] Don't build the device runtime without a new Clang.

LGTM.

We are using CMake's command to build the device runtime now. There is no way to tell CMake to use another compiler rather than CMake's compilers to build a specific target. As a result, we either disable it, or we are doomed.
Well, accurately speaking, there seems to be a way to do that, see https://stackoverflow.com/questions/27168094/cmake-how-to-change-compiler-for-individual-target, but I don't think manipulating CMake's internal variables is a good practice.

I didn't say to workaround CMake. I was saying it was working that clang builds DeviceRTL and gcc building all the rest and now it is broken. You can try it out yourself with the commit before D125315

I'll just guard the new code then. Even though it shouldn't break if you're using the standard builds it will probably make it less noisy for people currently using the other methods.

Mon, May 16, 9:28 AM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D125698: [Libomptarget] Don't build the device runtime without a new Clang.

LGTM.

We are using CMake's command to build the device runtime now. There is no way to tell CMake to use another compiler rather than CMake's compilers to build a specific target. As a result, we either disable it, or we are doomed.
Well, accurately speaking, there seems to be a way to do that, see https://stackoverflow.com/questions/27168094/cmake-how-to-change-compiler-for-individual-target, but I don't think manipulating CMake's internal variables is a good practice.

I didn't say to workaround CMake. I was saying it was working that clang builds DeviceRTL and gcc building all the rest and now it is broken. You can try it out yourself with the commit before D125315

Mon, May 16, 9:27 AM · Restricted Project, Restricted Project
tianshilei1992 accepted D125698: [Libomptarget] Don't build the device runtime without a new Clang.

We are using CMake's command to build the device runtime now. There is no way to tell CMake to use another compiler rather than CMake's compilers to build a specific target. As a result, we either disable it, or we are doomed.
Well, accurately speaking, there is a way to do that, see https://stackoverflow.com/questions/27168094/cmake-how-to-change-compiler-for-individual-target, but I don't think manipulating CMake's internal variables is a good practice.

Mon, May 16, 9:09 AM · Restricted Project, Restricted Project

Sun, May 15

tianshilei1992 updated the summary of D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.
Sun, May 15, 6:09 PM · Restricted Project, Restricted Project
tianshilei1992 abandoned D125512: [NVPTX] Enable atomic expansion of atomicrmw for NVPTX.

Move to D125639

Sun, May 15, 6:08 PM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.

add test

Sun, May 15, 6:08 PM · Restricted Project, Restricted Project
tianshilei1992 updated the summary of D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.
Sun, May 15, 6:07 PM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.

rebase

Sun, May 15, 6:04 PM · Restricted Project, Restricted Project
tianshilei1992 requested review of D125652: [LLVM] Add a check if should cast atomic operations to integer type.
Sun, May 15, 5:45 PM · Restricted Project, Restricted Project
tianshilei1992 retitled D125512: [NVPTX] Enable atomic expansion of atomicrmw for NVPTX from [NVPTX] Enable AtomicExpandPass for NVPTX, and add the check for atomicrmw to [NVPTX] Enable atomic expansion of atomicrmw for NVPTX.
Sun, May 15, 11:33 AM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D125512: [NVPTX] Enable atomic expansion of atomicrmw for NVPTX.

add test

Sun, May 15, 11:32 AM · Restricted Project, Restricted Project
tianshilei1992 added inline comments to D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.
Sun, May 15, 11:25 AM · Restricted Project, Restricted Project
tianshilei1992 requested review of D125639: [NVPTX] Enable AtomicExpandPass for NVPTX.
Sun, May 15, 11:23 AM · Restricted Project, Restricted Project

Sat, May 14

tianshilei1992 added a comment to D123235: [OpenMP] atomic compare fail : Parser & AST support.

I have tried on x64 RH and x64 SuSe. I could not reproduce the failures seen on x64 debian. https://reviews.llvm.org/D118550 also has similar failures on x64 debian. There is a comment " I think the test failures are spurious (but not 100% sure)" So, are these failures pre-existing before the changes in the current support for "atomic compare fail: Parser & Support" were done?

Sat, May 14, 1:40 PM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
tianshilei1992 added a comment to D123286: [Clang][OpenMP] Support for omp nothing.

Can we have test for right usage?

Sat, May 14, 1:34 PM · Restricted Project, Restricted Project, Restricted Project
tianshilei1992 retitled D123286: [Clang][OpenMP] Support for omp nothing from Patch for : omp nothing to [Clang][OpenMP] Support for omp nothing.
Sat, May 14, 5:18 AM · Restricted Project, Restricted Project, Restricted Project

Fri, May 13

tianshilei1992 accepted D125315: [Libomptarget] Build the device runtime as a static library.

LGTM

Fri, May 13, 10:23 AM · Restricted Project, Restricted Project
tianshilei1992 accepted D125563: [Libomptarget] Remove global include directory from libomptarget.

LGTM. Thanks!

Fri, May 13, 10:21 AM · Restricted Project, Restricted Project

Thu, May 12

tianshilei1992 added a comment to D125512: [NVPTX] Enable atomic expansion of atomicrmw for NVPTX.

The test is on the way.

Thu, May 12, 7:33 PM · Restricted Project, Restricted Project
tianshilei1992 requested review of D125512: [NVPTX] Enable atomic expansion of atomicrmw for NVPTX.
Thu, May 12, 7:33 PM · Restricted Project, Restricted Project

Tue, May 10

tianshilei1992 updated the summary of D125350: [RFC][Clang] Add a check if the target supports atomicrmw instruction with specific operator and type.
Tue, May 10, 8:38 PM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D125350: [RFC][Clang] Add a check if the target supports atomicrmw instruction with specific operator and type.

As for the test, here is a simple code snippet:

#pragma omp begin declare target device_type(nohost)
void foo() {
  double x, y;
#pragma omp atomic update
  x += y;
}
#pragma omp end declare target

sm_35 doesn't support FAdd with double type, then it emits:

define protected void @foo() #0 {
entry:
  %x = alloca double, align 8
  %y = alloca double, align 8
  %atomic-temp = alloca double, align 8
  %0 = load double, ptr %y, align 8
  %atomic-load = load atomic i64, ptr %x monotonic, align 8
  br label %atomic_cont
Tue, May 10, 8:31 PM · Restricted Project, Restricted Project
tianshilei1992 retitled D125350: [RFC][Clang] Add a check if the target supports atomicrmw instruction with specific operator and type from [PoC][Clang] Add a check if the target supports atomicrmw instruction with specific operator and type to [RFC][Clang] Add a check if the target supports atomicrmw instruction with specific operator and type.
Tue, May 10, 8:25 PM · Restricted Project, Restricted Project
tianshilei1992 added inline comments to D125350: [RFC][Clang] Add a check if the target supports atomicrmw instruction with specific operator and type.
Tue, May 10, 8:24 PM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D125350: [RFC][Clang] Add a check if the target supports atomicrmw instruction with specific operator and type.

Feel free to add more reviewers

Tue, May 10, 8:23 PM · Restricted Project, Restricted Project
tianshilei1992 requested review of D125350: [RFC][Clang] Add a check if the target supports atomicrmw instruction with specific operator and type.
Tue, May 10, 8:23 PM · Restricted Project, Restricted Project
tianshilei1992 added inline comments to D125315: [Libomptarget] Build the device runtime as a static library.
Tue, May 10, 7:49 AM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D125315: [Libomptarget] Build the device runtime as a static library.

This design is much better because we don't need to have one bc file for each target. What's more, it uses CMake command to compile the library, which has better dependence tracking. Just one comment on the order stuff.

Tue, May 10, 7:43 AM · Restricted Project, Restricted Project
tianshilei1992 accepted D125260: [Libomptarget] Allow the device runtime to be compiled for the host.

LGTM. Just would be better to add comments for those forward declaration.

Tue, May 10, 7:28 AM · Restricted Project, Restricted Project

Mon, May 9

tianshilei1992 accepted D125256: [OpenMP] Add `__CUDA_ARCH__` definition when offloading with OpenMP.

LG

Mon, May 9, 1:00 PM · Restricted Project, Restricted Project

Thu, May 5

tianshilei1992 added inline comments to D120290: [Clang][OpenMP] Add the codegen support for `atomic compare capture`.
Thu, May 5, 5:42 AM · Restricted Project, Restricted Project

Wed, May 4

tianshilei1992 updated the diff for D120290: [Clang][OpenMP] Add the codegen support for `atomic compare capture`.

fix comments

Wed, May 4, 8:34 PM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D122764: [OpenMP][CUDA] Fix the issue that P2P memcpy doesn't work.

ping

Wed, May 4, 8:37 AM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D120290: [Clang][OpenMP] Add the codegen support for `atomic compare capture`.

ping

Wed, May 4, 8:37 AM · Restricted Project, Restricted Project

Tue, May 3

tianshilei1992 committed rG9c1085c7e20b: [Clang][OpenMP] Add the support for floating-point variables for specific… (authored by tianshilei1992).
[Clang][OpenMP] Add the support for floating-point variables for specific…
Tue, May 3, 8:31 AM · Restricted Project, Restricted Project
tianshilei1992 closed D124724: [Clang][OpenMP] Add the support for floating-point variables for specific atomic clauses.
Tue, May 3, 8:31 AM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D124724: [Clang][OpenMP] Add the support for floating-point variables for specific atomic clauses.

rebase

Tue, May 3, 8:30 AM · Restricted Project, Restricted Project

Mon, May 2

tianshilei1992 added inline comments to D123235: [OpenMP] atomic compare fail : Parser & AST support.
Mon, May 2, 6:01 PM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
tianshilei1992 updated the diff for D124724: [Clang][OpenMP] Add the support for floating-point variables for specific atomic clauses.

always use UIToFP because that is the only case that UpdateVal is a ConstantInt, where we created the constant integer for ++ or -- operation.

Mon, May 2, 3:36 PM · Restricted Project, Restricted Project
tianshilei1992 added inline comments to D124724: [Clang][OpenMP] Add the support for floating-point variables for specific atomic clauses.
Mon, May 2, 1:54 PM · Restricted Project, Restricted Project

Sat, Apr 30

tianshilei1992 requested review of D124724: [Clang][OpenMP] Add the support for floating-point variables for specific atomic clauses.
Sat, Apr 30, 7:13 PM · Restricted Project, Restricted Project

Apr 27 2022

tianshilei1992 committed rGa6b355dd3164: [SLP] Fix a typo that causes redundant assertion and potential segment fault (authored by tianshilei1992).
[SLP] Fix a typo that causes redundant assertion and potential segment fault
Apr 27 2022, 7:08 AM · Restricted Project, Restricted Project
tianshilei1992 closed D124497: [SLP] Fix a typo that causes redundant assertion and potential segment fault.
Apr 27 2022, 7:08 AM · Restricted Project, Restricted Project

Apr 26 2022

tianshilei1992 requested review of D124497: [SLP] Fix a typo that causes redundant assertion and potential segment fault.
Apr 26 2022, 7:51 PM · Restricted Project, Restricted Project

Apr 25 2022

tianshilei1992 accepted D124381: [Libomptarget] Use entry name for global info.

LG

Apr 25 2022, 5:53 AM · Restricted Project, Restricted Project

Apr 22 2022

tianshilei1992 committed rG20a9fb953e46: [Clang][OpenMP] Fix the issue that temp cubin files are not removed after… (authored by tianshilei1992).
[Clang][OpenMP] Fix the issue that temp cubin files are not removed after…
Apr 22 2022, 3:07 PM · Restricted Project, Restricted Project
tianshilei1992 closed D124253: [Clang][OpenMP] Fix the issue that temp cubin files are not removed after compilation when using new OpenMP driver.
Apr 22 2022, 3:07 PM · Restricted Project, Restricted Project
tianshilei1992 retitled D124253: [Clang][OpenMP] Fix the issue that temp cubin files are not removed after compilation when using new OpenMP driver from [Clang][OpenMP] Fix the issue that one temp cubin file is not removed after compilation to [Clang][OpenMP] Fix the issue that temp cubin files are not removed after compilation when using new OpenMP driver.
Apr 22 2022, 1:17 PM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D124253: [Clang][OpenMP] Fix the issue that temp cubin files are not removed after compilation when using new OpenMP driver.

update

Apr 22 2022, 1:07 PM · Restricted Project, Restricted Project
tianshilei1992 planned changes to D124253: [Clang][OpenMP] Fix the issue that temp cubin files are not removed after compilation when using new OpenMP driver.

The issue is in clang/lib/Driver/ToolChains/Cuda.cpp.

Apr 22 2022, 6:14 AM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D124253: [Clang][OpenMP] Fix the issue that temp cubin files are not removed after compilation when using new OpenMP driver.

Is this really the cause? nvptx::assemble should call createOutputFile which makes a temp file to output to that is added to TempFiles.

Apr 22 2022, 5:50 AM · Restricted Project, Restricted Project
tianshilei1992 requested review of D124253: [Clang][OpenMP] Fix the issue that temp cubin files are not removed after compilation when using new OpenMP driver.
Apr 22 2022, 5:42 AM · Restricted Project, Restricted Project

Apr 18 2022

tianshilei1992 accepted D123446: [OpenMP][FIX] Remove shadow pointer map and introduce consistent locking.

LGTM. Like @ye-luo suggested, we need to update the documents of lock and unlock as they are being used in a different way now.

Apr 18 2022, 1:43 PM · Restricted Project, Restricted Project
tianshilei1992 added inline comments to D120290: [Clang][OpenMP] Add the codegen support for `atomic compare capture`.
Apr 18 2022, 12:14 PM · Restricted Project, Restricted Project

Apr 17 2022

tianshilei1992 updated the diff for D120007: [OMPIRBuilder] Add the support for compare capture.

rebase

Apr 17 2022, 12:49 PM · Restricted Project, Restricted Project
tianshilei1992 committed rW6bee15ba1267: Add more slides for LLVM-CGO 2022 (authored by tianshilei1992).
Add more slides for LLVM-CGO 2022
Apr 17 2022, 7:09 AM · Restricted Project

Apr 15 2022

tianshilei1992 updated the summary of D122764: [OpenMP][CUDA] Fix the issue that P2P memcpy doesn't work.
Apr 15 2022, 7:20 PM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D122764: [OpenMP][CUDA] Fix the issue that P2P memcpy doesn't work.

remove intermediate state

Apr 15 2022, 7:18 PM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D122764: [OpenMP][CUDA] Fix the issue that P2P memcpy doesn't work.

remove unnecessary changes

Apr 15 2022, 7:15 PM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D122764: [OpenMP][CUDA] Fix the issue that P2P memcpy doesn't work.

lazy initialization

Apr 15 2022, 7:13 PM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D120290: [Clang][OpenMP] Add the codegen support for `atomic compare capture`.

rebase

Apr 15 2022, 6:53 PM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D122667: llvm14 patch: hwloc include directory for libompd.

An add-up to this patch is, if both ompd and omp depend on hwloc (like including hwloc headers`), both should set target_link_libraries. The dependence should be:

omp---->hwloc
         ^
ompd-----|

The transitive dependence is bad practice.

Apr 15 2022, 6:51 PM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D122667: llvm14 patch: hwloc include directory for libompd.

This is the minimum fix for exporting ${LIBOMP_HWLOC_INSTALL_DIR}/include thru the omp target for import thru target_link_libraries.

--- openmp/runtime/src/CMakeLists.txt
+++ openmp/runtime/src/CMakeLists.txt
@@ -46,9 +46,6 @@
   ${LIBOMP_INC_DIR}
   ${LIBOMP_SRC_DIR}/thirdparty/ittnotify
 )
-if(${LIBOMP_USE_HWLOC})
-  include_directories(${LIBOMP_HWLOC_INSTALL_DIR}/include)
-endif()

 # Building with time profiling support requires LLVM directory includes.
 if(LIBOMP_PROFILING_SUPPORT)
@@ -157,6 +154,13 @@
   # libomp must be a C++ library such that it can link libLLVMSupport
   set(LIBOMP_LINKER_LANGUAGE CXX)
 endif()
+if(${LIBOMP_USE_HWLOC})
+  target_include_directories(omp
+                             PUBLIC
+                             "$<BUILD_INTERFACE:${LIBOMP_HWLOC_INSTALL_DIR}/include>"
+                             "$<INSTALL_INTERFACE:${LIBOMP_HWLOC_INSTALL_DIR}/include>"
+  )
+endif()


 if(OPENMP_MSVC_NAME_SCHEME)
--- openmp/libompd/src/CMakeLists.txt
+++ openmp/libompd/src/CMakeLists.txt
@@ -13,7 +13,7 @@

 add_library (ompd SHARED TargetValue.cpp omp-debug.cpp omp-state.cpp omp-icv.cpp)

-add_dependencies(ompd omp) # ensure generated import library is created first
+target_link_libraries(ompd omp) # ensure generated import library is created first

 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

This (by comparison) relatively modern cmake style is used in the llvm pstl and mlir libraries already, It is needed to attach the include path to the omp CMake target, so target_link_libraries can pick it up from the target to use ompis used by another target.

Apr 15 2022, 6:45 PM · Restricted Project, Restricted Project
tianshilei1992 committed rGe8760b51ee0f: [Clang][OpenMP] Use bitfields for flags in `OMPAtomicDirective` (authored by tianshilei1992).
[Clang][OpenMP] Use bitfields for flags in `OMPAtomicDirective`
Apr 15 2022, 6:35 PM · Restricted Project, Restricted Project
tianshilei1992 closed D123862: [Clang][OpenMP] Use bitfields for flags in `OMPAtomicDirective`.
Apr 15 2022, 6:34 PM · Restricted Project, Restricted Project
tianshilei1992 accepted D122667: llvm14 patch: hwloc include directory for libompd.

LG

Apr 15 2022, 12:57 PM · Restricted Project, Restricted Project
tianshilei1992 added a comment to D123862: [Clang][OpenMP] Use bitfields for flags in `OMPAtomicDirective`.

What about ASTStmtWriter?

Apr 15 2022, 11:13 AM · Restricted Project, Restricted Project
tianshilei1992 added inline comments to D120290: [Clang][OpenMP] Add the codegen support for `atomic compare capture`.
Apr 15 2022, 10:19 AM · Restricted Project, Restricted Project
tianshilei1992 updated the diff for D120290: [Clang][OpenMP] Add the codegen support for `atomic compare capture`.

rebase

Apr 15 2022, 10:17 AM · Restricted Project, Restricted Project
tianshilei1992 updated the summary of D123862: [Clang][OpenMP] Use bitfields for flags in `OMPAtomicDirective`.
Apr 15 2022, 10:03 AM · Restricted Project, Restricted Project