[PATCH] D154036: [libc] Add support for creating wrapper headers for offloading in clang

2023-07-06 Thread Joseph Huber 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 rGa4a26374aa11: [libc] Add support for creating wrapper headers for offloading in clang (authored by jhuber6). Repository: rG LLVM Github Monorepo

[PATCH] D154036: [libc] Add support for creating wrapper headers for offloading in clang

2023-07-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 537787. jhuber6 added a comment. Changing this to only apply to OpenMP for now. It breaks CUDA / HIP builds because they already have forward declarations of things like `malloc` or `memcpy` on the GPU that conflict. We'll need to clean those up later. Repos

[PATCH] D154036: [libc] Add support for creating wrapper headers for offloading in clang

2023-07-06 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert accepted this revision. jdoerfert added a comment. If it compiles, ship it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154036/new/ https://reviews.llvm.org/D154036 ___ cfe-commits mailing li

[PATCH] D154036: [libc] Add support for creating wrapper headers for offloading in clang

2023-07-06 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield accepted this revision. JonChesterfield added a comment. This revision is now accepted and ready to land. OK, let's go with this. It's a fairly alarming mess localised quite closely to the language that requires the complexity, minimal damage to libc itself. Repository: rG LLV

[PATCH] D154036: [libc] Add support for creating wrapper headers for offloading in clang

2023-07-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: libc/include/CMakeLists.txt:8 +if(LIBC_TARGET_ARCHITECTURE_IS_GPU) + include(GetClangResourceDir) +endif() sivachandra wrote: > Where does this come from? It's a global CMake module that LLVM provides in `cmake/Modules

[PATCH] D154036: [libc] Add support for creating wrapper headers for offloading in clang

2023-07-06 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added a comment. The libc specific changes are really minimal straightforward. The GPU side, the clang driver changes etc. need a review by a GPU expert. Comment at: libc/include/CMakeLists.txt:8 +if(LIBC_TARGET_ARCHITECTURE_IS_GPU) + include(GetClangResourceDir)

[PATCH] D154036: [libc] Add support for creating wrapper headers for offloading in clang

2023-07-05 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 537535. jhuber6 added a comment. Fix guard on the headers for offloading languages Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154036/new/ https://reviews.llvm.org/D154036 Files: clang/lib/Driver/ToolChain

[PATCH] D154036: [libc] Add support for creating wrapper headers for offloading in clang

2023-06-29 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 535983. jhuber6 added a comment. Add some checks to `stdlib.h` to ensure ABI compatibility for `div` functions. Because this patch makes us always include the LLVM libc repo when offloading, we mask off the wrappers if they were not installed by `libc`, so th

[PATCH] D154036: [libc] Add support for creating wrapper headers for offloading in clang

2023-06-29 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 535835. jhuber6 added a comment. Semi-fix hack for `string.h` and fix `ctype.h`. `string.h` required undefining C++ mode so we didn't use weird GNU C++ handling, which we then still need the `extern "C"` for. The cytpe problems come from GNU defining everythin

[PATCH] D154036: [libc] Add support for creating wrapper headers for offloading in clang

2023-06-28 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 535600. jhuber6 added a comment. Hack around the `string` problem. GNU likes to provide different prototypes for C++. Manually disable this for now. Unsure if this will have reasonable fallout, but it seems bizarre that `string.h` would define C++ constructs

[PATCH] D154036: [libc] Add support for creating wrapper headers for offloading in clang

2023-06-28 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. For reference, here is what one of the newly generated headers looks like that is used. #ifndef __LLVM_LIBC_DECLARATIONS_STDIO_H #define __LLVM_LIBC_DECLARATIONS_STDIO_H #ifndef __LIBC_ATTRS #define __LIBC_ATTRS #endif #ifdef __cplusplus extern "C" {

[PATCH] D154036: [libc] Add support for creating wrapper headers for offloading in clang

2023-06-28 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, tianshilei1992, sivachandra, lntue, michaelrj, tra, JonChesterfield. Herald added projects: libc-project, All. Herald added a subscriber: libc-commits. jhuber6 requested review of this revision. Herald added subscribers: cfe-commit