[PATCH] D127246: [LinkerWrapper] Rework the linker wrapper and use owning binaries

2022-06-08 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 435124. jhuber6 added a comment. Sorry for this noise. This is a pretty large change but shouldn't affect any functionality and passes all the tests I know of, so this should be good to land. Let me know if you have any objections to how I've structured this

[PATCH] D127246: [LinkerWrapper] Rework the linker wrapper and use owning binaries

2022-06-08 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 435122. jhuber6 added a comment. Add use of bitcode libraries so this works on AMD. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127246/new/ https://reviews.llvm.org/D127246 Files: clang/tools/clang-linker-

[PATCH] D127246: [LinkerWrapper] Rework the linker wrapper and use owning binaries

2022-06-08 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 435118. jhuber6 added a comment. There was a problem where the Triple and Arch data would be deallocated when the LTO pass took ownership of every single file. Add a UniqueStringSaver to make sure they are still accessible after linking. Repository: rG L

[PATCH] D127246: [LinkerWrapper] Rework the linker wrapper and use owning binaries

2022-06-07 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, tianshilei1992, JonChesterfield, tra, yaxunl. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1. Herald added a project: clang. The linker wrapper currently eag

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-06-03 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125165#3557441 , @MaskRay wrote: > Add openmp to `LLVM_ENABLE_PROJECTS` to trigger the issue: > > cmake -GNinja -Sllvm -B/tmp/out/play -DCMAKE_BUILD_TYPE=Release > -DLLVM_ENABLE_PROJECTS='clang;openmp' > -DCMAKE_CXX_COMPIL

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-06-03 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125165#3557015 , @tra wrote: > @jhuber6 -- @MaskRay has found that `ninja install` is failing in a clean > build with: > > clang: error: unable to execute command: Executable > "clang-offload-packager" doesn't exist! > >

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-06-03 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125165#3557015 , @tra wrote: > @jhuber6 -- @MaskRay has found that `ninja install` is failing in a clean > build with: > > clang: error: unable to execute command: Executable > "clang-offload-packager" doesn't exist! > >

[PATCH] D126812: [Binary] Promote OffloadBinary to inherit from Binary

2022-06-01 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 rGafd2f7e99197: [Binary] Promote OffloadBinary to inherit from Binary (authored by jhuber6). Changed prior to commit: https://reviews.llvm.org/D1268

[PATCH] D126812: [Binary] Promote OffloadBinary to inherit from Binary

2022-06-01 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 433534. jhuber6 added a comment. Addressing comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126812/new/ https://reviews.llvm.org/D126812 Files: clang/lib/CodeGen/BackendUtil.cpp llvm/include/llvm-c

[PATCH] D126812: [Binary] Promote OffloadBinary to inherit from Binary

2022-06-01 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Thanks for the comments, I'll address them real quick. Comment at: llvm/include/llvm/Object/OffloadBinary.h:121 const Entry *TheEntry) - : Buffer(Buffer), TheHeader(TheHeader), TheEntry(TheEntry) { - + : Binary(Binary::ID_Offl

[PATCH] D126812: [Binary] Promote OffloadBinary to inherit from Binary

2022-06-01 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 433504. jhuber6 added a comment. Fix test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126812/new/ https://reviews.llvm.org/D126812 Files: clang/lib/CodeGen/BackendUtil.cpp llvm/include/llvm-c/Object.h

[PATCH] D126812: [Binary] Promote OffloadBinary to inherit from Binary

2022-06-01 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, tra, JonChesterfield, MaskRay. Herald added a reviewer: deadalnix. Herald added subscribers: ormris, StephenFan, hiraditya. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: llvm-commi

[PATCH] D124525: [OpenMP][ClangLinkerWrapper] Extending linker wrapper to embed metadata for multi-arch fat binaries

2022-05-30 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Also I probably should've discussed this earlier, but another potential solution is to use the binary format that we use to embed the object files for the images as well. This is m

[PATCH] D124525: [OpenMP][ClangLinkerWrapper] Extending linker wrapper to embed metadata for multi-arch fat binaries

2022-05-26 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/tools/clang-linker-wrapper/OffloadWrapper.cpp:229-232 +// store value of these variables (i.e. offload archs) into a custom +// section which will be used by "offload-arch -f". It won't be +// removed during binary stri

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-26 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 rG1bae02b77335: [Cuda] Use fallback method to mangle externalized decls if no CUID given (authored by jhuber6). Repository: rG LLVM Github Monorepo

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-25 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 432146. jhuber6 added a comment. Add test for #line. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125904/new/ https://reviews.llvm.org/D125904 Files: clang/lib/CodeGen/CGCUDANV.cpp clang/lib/CodeGen/CodeG

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-25 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125904#3538714 , @tra wrote: > It would be great to have some compile-time checks for that, if possible. > Otherwise it will only manifest at run-time and the end user will have no > clue what's going on. Not sure how we co

[PATCH] D126398: [Clang] Introduce `--offload-link` option to perform offload device linking

2022-05-25 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb7c8c4d8cf07: [Clang] Introduce `--offload-link` option to perform offload device linking (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D126398: [Clang] Introduce `--offload-link` option to perform offload device linking

2022-05-25 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 432071. jhuber6 added a comment. Removing `-dlink` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126398/new/ https://reviews.llvm.org/D126398 Files: clang/docs/ClangCommandLineReference.rst clang/include/c

[PATCH] D126398: [Clang] Introduce `-dlink` option to perform offload device linking

2022-05-25 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/include/clang/Driver/Options.td:825-826 + HelpText<"Use the new offloading linker to perform the link job.">; +def device_link : Flag<["-"], "dlink">, Group, + Alias; def Xlinker : Separate<["-"], "Xlinker">, Flags<[LinkerInput,

[PATCH] D126398: [Clang] Introduce `-dlink` option to perform offload device linking

2022-05-25 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 432060. jhuber6 added a comment. Changing to use `--offload-link` and use `-dlink` as an alias. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126398/new/ https://reviews.llvm.org/D126398 Files: clang/docs/Cl

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-25 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125904#3537952 , @tra wrote: > How much work would it take to add cuid generation in the new driver, similar > to what the old driver does, using the same logic, however imperfect it is? > I'd be OK with that as a possibly p

[PATCH] D126398: [Clang] Introduce `-dl` option to perform offload device linking

2022-05-25 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D126398#3537942 , @tra wrote: > Naming, as usual, is hard. I would prefer a more explicit `--offload-link` > which would be in line with other --offload* options we have by now. > `-dl` is cryptic for uninitiated and is uncom

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-25 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125904#3537872 , @tra wrote: > Is this patch in its current form blocking any of your other work? no-cuid > approach, even if we figure out how to do it, will likely take some time. Do > you need an interim solution until th

[PATCH] D126398: [Clang] Introduce `-dl` option to perform offload device linking

2022-05-25 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: MaskRay, jdoerfert, yaxunl, tra. Herald added a subscriber: StephenFan. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1. Herald added a project: clang. The new driver use

[PATCH] D124525: [OpenMP][ClangLinkerWrapper] Extending linker wrapper to embed metadata for multi-arch fat binaries

2022-05-25 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Where is the code to change the target registration? We need a new initialization runtime call to use and change the old one to reallocate the `__tgt_device_image` array. Did you work around that some other way? Comment at: clang/tools/clang-linker-wr

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-25 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Also, for the OpenMP case, we already pass the host-IR as a dependency for the device compilation. So it would be relatively easy for us to just generate these names on the host and then read them from the IR for the device. The problem is that CUDA / HIP doesn't use th

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-24 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125904#3535905 , @jhuber6 wrote: > I can't think of a way to generate these new symbols, we'd need to somehow > have a list of all the static entries that need new symbols and then modify > the object file after its been mad

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-24 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125904#3535830 , @tra wrote: > I'm still itching to figure out a way to avoid CUID altogether and with the > new driver it may be possible. I would be 100% in favor of working around this if possible, it's proving to be one

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-24 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. A Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6836 + + // If the CUID is not specified we try to generate a unique postfix. + if (getLangOpts().CUID.empty()) { jhuber6 wrote: > tra wrote: > > jhuber6 wrote: > > > tra wrote: > > >

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-24 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6836 + + // If the CUID is not specified we try to generate a unique postfix. + if (getLangOpts().CUID.empty()) { tra wrote: > jhuber6 wrote: > > tra wrote: > > > > However, [CUID] i

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-24 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6836 + + // If the CUID is not specified we try to generate a unique postfix. + if (getLangOpts().CUID.empty()) { tra wrote: > > However, [CUID] is not always availible. > > The qu

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-24 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 431702. jhuber6 added a comment. Adding extra commentto mention the hidden requirement that the driver shuold not define a different `-D` option for the host and device. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-24 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6845-6846 +llvm::MD5::MD5Result Result; +for (const auto &Arg : PreprocessorOpts.Macros) + Hash.update(Arg.first); +Hash.final(Result); yaxunl wrote: > jhuber6 wrote:

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-24 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6845-6846 +llvm::MD5::MD5Result Result; +for (const auto &Arg : PreprocessorOpts.Macros) + Hash.update(Arg.first); +Hash.final(Result); yaxunl wrote: > Are these optio

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-24 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 431666. jhuber6 added a comment. Removing use of the line number, instead replacing it with an 8 character wide hash of the `-D` options passed to the front-end. This should make it sufficiently unique for users compiling the same file with different options

[PATCH] D126226: [OpenMP] Add `-Xoffload-linker` to forward input to the device linker

2022-05-24 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. jhuber6 marked an inline comment as done. Closed by commit rGf37101983fc9: [OpenMP] Add `-Xoffload-linker` to forward input to the device linker (authored by jhuber6). Changed prior to commit: https://reviews.llvm.org/D12

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-24 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125904#3532608 , @tra wrote: > That said, I would consider compiling the same source with different > preprocessor options to be a legitimate use case that we should support. > Explicitly passing cuid would work as a workaro

[PATCH] D126226: [OpenMP] Add `-Xoffload-linker` to forward input to the device linker

2022-05-23 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked 2 inline comments as done. jhuber6 added inline comments. Comment at: clang/include/clang/Driver/Options.td:827 +def Xoffload_linker : JoinedAndSeparate<["-"], "Xoffload-linker">, + HelpText<"Pass to the offload linker identified by ">, + MetaVarName<" ">, Grou

[PATCH] D126226: [OpenMP] Add `-Xoffload-linker` to forward input to the device linker

2022-05-23 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 431511. jhuber6 added a comment. Merging into a single argument and checking if the joined arg is empty. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126226/new/ https://reviews.llvm.org/D126226 Files: clan

[PATCH] D126226: [OpenMP] Add `-Xoffload-linker` to forward input to the device linker

2022-05-23 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/include/clang/Driver/Options.td:826 Group; +def Xoffload_linker : Separate<["-"], "Xoffload-linker">, + HelpText<"Pass to the offload linker">, MetaVarName<"">, tra wrote: > This option still stands out as a s

[PATCH] D126226: [OpenMP] Add `-Xoffload-linker` to forward input to the device linker

2022-05-23 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 431491. jhuber6 added a comment. Go back to old joined method and also change the name to remote `_EQ`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126226/new/ https://reviews.llvm.org/D126226 Files: clang

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-23 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125904#3532492 , @tra wrote: > This is a moderately serious issue. Some users care about the build > reproducibility. Recompiling the same sources and getting different results > will trigger all sorts of red flags that woul

[PATCH] D126226: [OpenMP] Add `-Xoffload-linker` to forward input to the device linker

2022-05-23 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D126226#3532423 , @tra wrote: > We keep running into the same old underlying issue that we do not have a good > way to name/reference specific parts of the compilation pipeline. -Xfoo used > to work OK for the linear 'standar

[PATCH] D126226: [OpenMP] Add `-Xoffload-linker` to forward input to the device linker

2022-05-23 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 431475. jhuber6 added a comment. Updating to use @MaskRay's suggestion. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126226/new/ https://reviews.llvm.org/D126226 Files: clang/include/clang/Driver/Options.td

[PATCH] D126226: [OpenMP] Add `-Xoffload-linker` to forward input to the device linker

2022-05-23 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D126226#3532257 , @MaskRay wrote: > It's better to avoid `JoinedAndSeparate` for new options. It is for `--xxx > val` and `--xxxval` but not intended for the option this patch will add. So how should I pass these two argument

[PATCH] D126226: [OpenMP] Add `-Xoffload-linker` to forward input to the device linker

2022-05-23 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 431452. jhuber6 added a comment. Changing the `-Xoffload-linker=` to `-Xoffload-linker-`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126226/new/ https://reviews.llvm.org/D126226 Files: clang/include/clang

[PATCH] D126226: [OpenMP] Add `-Xoffload-linker` to forward input to the device linker

2022-05-23 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D126226#3532216 , @tra wrote: > You do not need to hardcode it. The idea of `JoinedAndSeparate` is that an > option `foo` assepts two argumants, one glued to it and another following > after a whitespace. > So, when you defin

[PATCH] D126226: [OpenMP] Add `-Xoffload-linker` to forward input to the device linker

2022-05-23 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D126226#3532127 , @tra wrote: > `-Xoffload-linker= ` > > The syntax is confusing. Normally only `triple` would be the argument for > `-Xoffload-linker` option. > Having both `-Xoffload-linker` and `-Xoffload-linker=` variants

[PATCH] D126226: [OpenMP] Add `-Xoffload-linker` to forward input to the device linker

2022-05-23 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: markdewing, jdoerfert, tianshilei1992, JonChesterfield. Herald added subscribers: guansong, yaxunl. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1, MaskRay. Herald added

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-23 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125904/new/ https://reviews.llvm.org/D125904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-18 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: yaxunl, tra. Herald added subscribers: mattd, carlosgalvezp. Herald added a project: All. jhuber6 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. CUDA requires that static variables be

[PATCH] D125705: [OpenMP] Don't build the offloading driver without a source input

2022-05-17 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125705#3519570 , @yaxunl wrote: > HIP toolchain allows clang driver to compile bundled bitcode or assembly for > mixed host/device compilation or device-only multi-GPU compilation. > > e.g. > > clang --offload-arch=gfx906 --o

[PATCH] D125705: [OpenMP] Don't build the offloading driver without a source input

2022-05-16 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 rGb653b409ff44: [OpenMP] Don't build the offloading driver without a source input (authored by jhuber6). Changed prior to commit: https://reviews.ll

[PATCH] D125705: [OpenMP] Don't build the offloading driver without a source input

2022-05-16 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, tianshilei1992, wsmoses. Herald added subscribers: guansong, yaxunl. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1, MaskRay. Herald added a project: clang. T

[PATCH] D125256: [OpenMP] Add `__CUDA_ARCH__` definition when offloading with OpenMP

2022-05-14 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125256#3513596 , @RKSimon wrote: > @jhuber6 I think this or one of your other openmp commits has caused the > Driver/cuda-openmp-driver.cu test failure here: > https://lab.llvm.org/buildbot/#/builders/214/builds/1274/steps/6

[PATCH] D125333: [OpenMP] Use the new OpenMP device static library when doing LTO

2022-05-13 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4638ae3a8575: [OpenMP] Use the new OpenMP device static library when doing LTO (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125333/ne

[PATCH] D125314: [OpenMP] Don't set device runtime debugging flags if using '-nogpulib'

2022-05-13 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGaf757f89806e: [OpenMP] Don't set device runtime debugging flags if using '-nogpulib' (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125

[PATCH] D125265: [OpenMP] Don't include the device wrappers if -nostdinc is used

2022-05-13 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5189f634a113: [OpenMP] Don't include the device wrappers if -nostdinc is used (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125265/new

[PATCH] D125256: [OpenMP] Add `__CUDA_ARCH__` definition when offloading with OpenMP

2022-05-13 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG002a63f937d9: [OpenMP] Add `__CUDA_ARCH__` definition when offloading with OpenMP (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125256

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-05-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/docs/ClangOffloadPackager.rst:31-32 +uint32_t Flags; +StringMap StringData; +MemoryBufferRef Image; + }; yaxunl wrote: > jhuber6 wrote: > > yaxunl wrote: > > > This makes the file format depend on LLVM

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-05-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/docs/ClangOffloadPackager.rst:31-32 +uint32_t Flags; +StringMap StringData; +MemoryBufferRef Image; + }; yaxunl wrote: > This makes the file format depend on LLVM version and potentially standard > C+

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-05-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125165#3506502 , @thakis wrote: > In D125165#3506477 , @yaxunl wrote: > >> In D125165#3506448 , @thakis wrote: >> >>> We could add a "clang-of

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-05-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125165#3506172 , @thakis wrote: > We now have clang-offload-bundler, clang-offload-packager, > clang-offload-wrapper. Do we really need that many distinct binaries for > offloading? Any chance we could combine some of those?

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-05-11 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 rG26eb04268f4c: [Clang] Introduce clang-offload-packager tool to bundle device files (authored by jhuber6). Herald added a subscriber: kosarev. Change

[PATCH] D123812: [CUDA] Add wrapper code generation for registering CUDA images

2022-05-11 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf49d576a882d: [CUDA] Add wrapper code generation for registering CUDA images (authored by jhuber6). Changed prior to commit: https://reviews.llvm.org/D123812?vs=426467&id=428622#toc Repository: rG LL

[PATCH] D123810: [Cuda] Add initial support for wrapping CUDA images in the new driver.

2022-05-11 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 rGe7858a9fab8c: [Cuda] Add initial support for wrapping CUDA images in the new driver. (authored by jhuber6). Repository: rG LLVM Github Monorepo C

[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

2022-05-11 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 rG0035f7154c2a: [CUDA] Create offloading entries when using the new driver (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D123812: [CUDA] Add wrapper code generation for registering CUDA images

2022-05-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/tools/clang-linker-wrapper/OffloadWrapper.cpp:351 +/// required for texture / surface / managed variables. +Function *createRegisterGlobalsFunction(Module &M) { + LLVMContext &C = M.getContext(); tra wrote:

[PATCH] D123810: [Cuda] Add initial support for wrapping CUDA images in the new driver.

2022-05-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Thanks for the review. Comment at: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp:193 + } + static unsigned getHashValue(const OffloadKind &Val) { return Val * 37U; } + tra wrote: > Is there a particular reason for multiplyin

[PATCH] D123810: [Cuda] Add initial support for wrapping CUDA images in the new driver.

2022-05-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 428517. jhuber6 added a comment. Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Addressing comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123810/new/ https://reviews.llvm.org/D12

[PATCH] D123810: [Cuda] Add initial support for wrapping CUDA images in the new driver.

2022-05-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp:726 + + if (Error Err = executeCommands(*FatBinaryPath, CmdArgs)) +return std::move(Err); tra wrote: > We should have a way to pass extra options to fatbinary,

[PATCH] D125333: [OpenMP] Use the new OpenMP device static library when doing LTO

2022-05-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, tianshilei1992, JonChesterfield, ABataev. Herald added subscribers: guansong, inglorion, yaxunl. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1, MaskRay. Heral

[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

2022-05-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Is this with D123810 and D123812 good to land? It would be nice to be able to test this upstream. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123471/n

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-05-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125165#3504252 , @tra wrote: > LGTM in principle. > > Given that we're introducing a new tool dependency we may want to get a stamp > from someone dealing with build and release. > @tstellar -- do we need to change anything

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-05-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 428443. jhuber6 added a comment. Adding some extra documentation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125165/new/ https://reviews.llvm.org/D125165 Files: clang/docs/ClangOffloadPackager.rst clang

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-05-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/docs/ClangOffloadBinary.rst:15 +metadata. We use a custom binary format for bundling all the device images +together. The image format is a small header wrapping around a string map. This +tool creates bundled binaries so that they

[PATCH] D125165: [Clang] Introduce clang-offload-binary tool to bundle device files

2022-05-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 428379. jhuber6 added a comment. Changing name from clang-offload-binary to clang-offload-packager and updating some help mesages. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125165/new/ https://reviews.llvm

[PATCH] D125314: [OpenMP] Don't set device runtime debugging flags if using '-nogpulib'

2022-05-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125314#3503453 , @jdoerfert wrote: > Not actually tested, is it? Should be, we already have a test for not emitting these when the host-or file path is empty, I just reused the same tests but set the flags to use `nogpulib`

[PATCH] D125314: [OpenMP] Don't set device runtime debugging flags if using '-nogpulib'

2022-05-10 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, tianshilei1992, ABataev, JonChesterfield. Herald added subscribers: guansong, yaxunl. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1, MaskRay. Herald added a p

[PATCH] D125165: [Clang] Introduce clang-offload-binary tool to bundle device files

2022-05-09 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Thanks for the comments. Comment at: clang/docs/ClangOffloadBinary.rst:8 + +.. _clang-offload-binary: + tra wrote: > Naming nit: `binary` may not be the best term for what we're trying to do > here. Perhaps something like `package`, `c

[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

2022-05-09 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 428188. jhuber6 added a comment. Clang format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123471/new/ https://reviews.llvm.org/D123471 Files: clang/include/clang/Basic/LangOptions.def clang/include/clang

[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

2022-05-09 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 428186. jhuber6 added a comment. Updating comments to desceibe usage of flags with zero size. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123471/new/ https://reviews.llvm.org/D123471 Files: clang/include/c

[PATCH] D125265: [OpenMP] Don't include the device wrappers if -nostdinc is used

2022-05-09 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 428181. jhuber6 added a comment. Fix using `nostdlib` instead of `nostdinc` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125265/new/ https://reviews.llvm.org/D125265 Files: clang/lib/Driver/ToolChains/Clang

[PATCH] D125265: [OpenMP] Don't include the device wrappers if -nostdinc is used

2022-05-09 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:1311 if (JA.isDeviceOffloading(Action::OFK_OpenMP) && + !Args.hasArg(options::OPT_nostdlib) && (getToolChain().getTriple().isNVPTX() || tra wrote: > Did you mean `nost

[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

2022-05-09 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/CodeGen/CGCUDARuntime.h:58 + /// Mark the entry as a global variable. + OffloadGlobalEntry = 0x0, + /// Mark the entry as a managed global variable. tra wrote: > jhuber6 wrote: > > tra wrote: > >

[PATCH] D125265: [OpenMP] Don't include the device wrappers if -nostdinc is used

2022-05-09 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, tianshilei1992, JonChesterfield, ABataev, tra. Herald added subscribers: guansong, yaxunl. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1, MaskRay. Herald add

[PATCH] D125256: [OpenMP] Add __CUDA_ARCH__ definition when offloading with OpenMP

2022-05-09 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, tra, tianshilei1992. Herald added subscribers: mattd, gchakrabarti, asavonic, guansong, yaxunl, jholewinski. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1. H

[PATCH] D125165: [Clang] Introduce clang-offload-binary tool to bundle device files

2022-05-07 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 427858. jhuber6 added a comment. Fix missing file in test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125165/new/ https://reviews.llvm.org/D125165 Files: clang/docs/ClangOffloadBinary.rst clang/include/

[PATCH] D125165: [Clang] Introduce clang-offload-binary tool to bundle device files

2022-05-07 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 427849. jhuber6 added a comment. Fix test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125165/new/ https://reviews.llvm.org/D125165 Files: clang/docs/ClangOffloadBinary.rst clang/include/clang/Basic/Code

[PATCH] D125165: [Clang] Introduce clang-offload-binary tool to bundle device files

2022-05-07 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, JonChesterfield, saiislam, yaxunl, tra. Herald added subscribers: ormris, kerbowa, mgorny, jvesely. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1, MaskRay. He

[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/CodeGen/CGCUDARuntime.h:58 + /// Mark the entry as a global variable. + OffloadGlobalEntry = 0x0, + /// Mark the entry as a managed global variable. tra wrote: > jhuber6 wrote: > > tra wrote: > >

[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/CodeGen/CGCUDARuntime.h:58 + /// Mark the entry as a global variable. + OffloadGlobalEntry = 0x0, + /// Mark the entry as a managed global variable. tra wrote: > We're still using the same numeri

[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 427766. jhuber6 added a comment. removing enum Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123471/new/ https://reviews.llvm.org/D123471 Files: clang/include/clang/Basic/LangOptions.def clang/include/clan

[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/CodeGen/CGCUDARuntime.h:56-70 +enum OffloadRegionEntryKindFlag : uint32_t { + /// Mark the region entry as a kernel. + OffloadRegionKernelEntry = 0x0, +}; + +/// The kind flag of the global variable entry.

[PATCH] D125050: [OpenMP] Try to Infer target triples using the offloading architecture

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG509b631f84e9: [OpenMP] Try to Infer target triples using the offloading architecture (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125

[PATCH] D124721: [OpenMP] Allow compiling multiple target architectures with OpenMP

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG8477a0d769a0: [OpenMP] Allow compiling multiple target architectures with OpenMP (authored by jhuber6). Changed prior to commit: https://reviews.llvm.org/D124721?vs=426521&id=427734#toc Repository: r

[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/CodeGen/CGCUDARuntime.h:56-70 +enum OffloadRegionEntryKindFlag : uint32_t { + /// Mark the region entry as a kernel. + OffloadRegionKernelEntry = 0x0, +}; + +/// The kind flag of the global variable entry.

[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 427701. jhuber6 added a comment. Changing enum values from a bitfield to simple enumeration. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123471/new/ https://reviews.llvm.org/D123471 Files: clang/include/cl

[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/CodeGen/CGCUDARuntime.h:58-70 + OffloadRegionKernelEntry = 0x0, +}; + +/// The kind flag of the global variable entry. +enum OffloadVarEntryKindFlag : uint32_t { + /// Mark the entry as a global variable.

<    4   5   6   7   8   9   10   11   12   13   >