[PATCH] D124220: [OpenMP] Add options to only compile the host or device when offloading

2022-04-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 424449. jhuber6 added a comment. Moving some stuff. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124220/new/ https://reviews.llvm.org/D124220 Files: clang/include/clang/Driver/Options.td clang/lib/Driver/

[PATCH] D124253: [Clang][OpenMP] Fix the issue that one temp cubin file is not removed after compilation

2022-04-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Is this really the cause? `nvptx::assemble` should call `createOutputFile` which makes a temp file to output to that is added to `TempFiles`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124253/new/ https://reviews.llvm.o

[PATCH] D120272: [CUDA] Add driver support for compiling CUDA with the new driver

2022-04-22 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/D120272/new/ https://reviews.llvm.org/D120272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D120272: [CUDA] Add driver support for compiling CUDA with the new driver

2022-04-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6223-6224 if (IsCuda || IsHIP) { -if (Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false)) +if (Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false) || +

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

2022-04-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 424534. jhuber6 added a comment. Herald added a subscriber: MaskRay. Adding warning for using both `-fno-gpu-rdc` and `-foffload-new-driver`. I think this is a good warning to have for now while this is being worked in as opt-in. Once this has matured I plan

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

2022-04-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 424536. jhuber6 added a comment. Applied changes to wrong commit, whoops. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123812/new/ https://reviews.llvm.org/D123812 Files: clang/test/Driver/linker-wrapper-im

[PATCH] D120272: [CUDA] Add driver support for compiling CUDA with the new driver

2022-04-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 424537. jhuber6 added a comment. Adding warning for using both -fno-gpu-rdc and -foffload-new-driver. I think this is a good warning to have for now while this is being worked in as opt-in. Once this has matured I plan on adding the necessary logic to handle

[PATCH] D120272: [CUDA] Add driver support for compiling CUDA with the new driver

2022-04-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6223-6224 if (IsCuda || IsHIP) { -if (Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false)) +if (Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false) || +

[PATCH] D120272: [CUDA] Add driver support for compiling CUDA with the new driver

2022-04-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6225 if (IsCuda || IsHIP) { -if (Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false)) +if (Args.hasArg(options::OPT_fno_gpu_rdc) && IsCudaDevice && +Args.hasArg(op

[PATCH] D120272: [CUDA] Add driver support for compiling CUDA with the new driver

2022-04-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 424543. jhuber6 added a comment. Making suggested changes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120272/new/ https://reviews.llvm.org/D120272 Files: clang/include/clang/Basic/Cuda.h clang/include/c

[PATCH] D124292: [OpenMP] Use CUDA's non-RDC mode when LTO has whole program visibility

2022-04-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, tianshilei1992, tra, JonChesterfield. Herald added subscribers: mattd, guansong, inglorion, yaxunl. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1. Herald adde

[PATCH] D124292: [OpenMP] Use CUDA's non-RDC mode when LTO has whole program visibility

2022-04-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 424587. jhuber6 added a comment. Add test line Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124292/new/ https://reviews.llvm.org/D124292 Files: clang/test/Driver/linker-wrapper.c clang/tools/clang-linker-

[PATCH] D124253: [Clang][OpenMP] Fix the issue that temp cubin files are not removed after compilation when using new OpenMP driver

2022-04-22 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 accepted this revision. jhuber6 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/D124253/new/ https://reviews.llvm.org/D124253 ___

[PATCH] D124292: [OpenMP] Use CUDA's non-RDC mode when LTO has whole program visibility

2022-04-23 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 rG3530c35c6609: [OpenMP] Use CUDA's non-RDC mode when LTO has whole program visibility (authored by jhuber6). Repository: rG LLVM Github Monorepo C

[PATCH] D124220: [OpenMP] Add options to only compile the host or device when offloading

2022-04-26 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 425214. jhuber6 added a comment. Small change, returning an empty action type should let us stop without an extra check. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124220/new/ https://reviews.llvm.org/D1242

[PATCH] D120272: [CUDA] Add driver support for compiling CUDA with the new driver

2022-04-26 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 425261. jhuber6 added a comment. Changing this to simply require that the user manually passes `-fgpu-rdc` in order to use the new driver. I think this makes more sense in the short term and we can move to make the new driver the default rdc approach later.

[PATCH] D120272: [CUDA] Add driver support for compiling CUDA with the new driver

2022-04-26 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6223-6224 if (IsCuda || IsHIP) { -if (Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false)) +if (Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false) || +

[PATCH] D123313: [OpenMP] Make clang argument handling for the new driver more generic

2022-04-26 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/D123313/new/ https://reviews.llvm.org/D123313 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D124220: [OpenMP] Add options to only compile the host or device when offloading

2022-04-26 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. ping Comment at: clang/include/clang/Driver/Options.td:2535-2538 +def foffload_device_only : Flag<["-"], "foffload-device-only">, + HelpText<"Only compile for the offloading device.">; +def foffload_host_only : Flag<["-"], "foffload-host-only">, + Hel

[PATCH] D124220: [OpenMP] Add options to only compile the host or device when offloading

2022-04-26 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/include/clang/Driver/Options.td:2535-2538 +def foffload_device_only : Flag<["-"], "foffload-device-only">, + HelpText<"Only compile for the offloading device.">; +def foffload_host_only : Flag<["-"], "foffload-host-only">, + Help

[PATCH] D124220: [OpenMP] Add options to only compile the host or device when offloading

2022-04-26 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 425301. jhuber6 added a comment. Adding `-fno` variants and replacing the uses of `--cuda-host-only` with and alias and this flag. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124220/new/ https://reviews.llvm

[PATCH] D124220: [OpenMP] Add options to only compile the host or device when offloading

2022-04-26 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 425336. jhuber6 added a comment. Updating to not use `-f/-fno` versions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124220/new/ https://reviews.llvm.org/D124220 Files: clang/include/clang/Driver/Options.t

[PATCH] D124220: [OpenMP] Add options to only compile the host or device when offloading

2022-04-26 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/include/clang/Driver/Options.td:2527 HelpText<"Use the static host OpenMP runtime while linking.">; +def offload_device_only : Flag<["-"], "offload-device-only">, + HelpText<"Only compile for the offloading device.">; -

[PATCH] D124220: [OpenMP] Add options to only compile the host or device when offloading

2022-04-26 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 425344. jhuber6 added a comment. Making suggested changes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124220/new/ https://reviews.llvm.org/D124220 Files: clang/include/clang/Driver/Options.td clang/lib/

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

2022-04-27 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp:1161 -LinkedImages.push_back(*ImageOrErr); +LinkedImages.emplace_back(TheArch, *ImageOrErr); } I'm doing something similar in D123810, I just used the

[PATCH] D124220: [OpenMP] Add options to only compile the host or device when offloading

2022-04-27 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/Driver/Driver.cpp:4215 Action *HostAction) const { - if (!isa(HostAction)) + if (Args.hasArg(options::OPT_offload_host_only)) return HostAction; tra wrote: > jhube

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

2022-04-28 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/tools/clang-linker-wrapper/OffloadWrapper.cpp:246 IRBuilder<> Builder(BasicBlock::Create(C, "entry", Func)); + // Create calls to __tgt_register_image_info for each image + auto *NullPtr = llvm::ConstantPointerNull::get(Builde

[PATCH] D123325: [Clang] Make enabling the new driver more generic

2022-04-28 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 425785. jhuber6 added a comment. Ping and update. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123325/new/ https://reviews.llvm.org/D123325 Files: clang/include/clang/Driver/Options.td clang/lib/Driver/Dr

[PATCH] D120273: [OpenMP] Allow CUDA to be linked with OpenMP using the new driver

2022-04-28 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 425807. jhuber6 added a comment. Ping and rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120273/new/ https://reviews.llvm.org/D120273 Files: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp In

[PATCH] D124624: [OpenMP] Add variant extension that applies to declarations

2022-04-28 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, tianshilei1992. Herald added subscribers: guansong, yaxunl. Herald added a reviewer: aaron.ballman. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: llvm-commits, cfe-commits, sstefan

[PATCH] D123325: [Clang] Make enabling the new driver more generic

2022-04-28 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/include/clang/Driver/Options.td:2535-2538 +def foffload_new_driver : Flag<["-"], "foffload-new-driver">, Flags<[CC1Option]>, Group, + HelpText<"Use the new driver for offloading compilation.">; +def fno_offload_new_driver : Flag<

[PATCH] D123325: [Clang] Make enabling the new driver more generic

2022-04-28 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/include/clang/Driver/Options.td:2535-2538 +def foffload_new_driver : Flag<["-"], "foffload-new-driver">, Flags<[CC1Option]>, Group, + HelpText<"Use the new driver for offloading compilation.">; +def fno_offload_new_driver : Flag<

[PATCH] D123325: [Clang] Make enabling the new driver more generic

2022-04-28 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 425879. jhuber6 added a comment. Changin `-f[no-]offload-new-driver` into `--[no-]offload-new-driver` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123325/new/ https://reviews.llvm.org/D123325 Files: clang/i

[PATCH] D123460: [OpenMP] Make generating offloading entries more generic

2022-04-29 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 rG643c9b22ef52: [OpenMP] Make generating offloading entries more generic (authored by jhuber6). Changed prior to commit: https://reviews.llvm.org/D1

[PATCH] D123313: [OpenMP] Make clang argument handling for the new driver more generic

2022-04-29 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 rGca6bbe008512: [OpenMP] Make clang argument handling for the new driver more generic (authored by jhuber6). Repository: rG LLVM Github Monorepo CH

[PATCH] D123325: [Clang] Make enabling the new driver more generic

2022-04-29 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 rG4e2b5a6693e2: [Clang] Make enabling the new driver more generic (authored by jhuber6). Changed prior to commit: https://reviews.llvm.org/D123325?v

[PATCH] D120272: [CUDA] Add driver support for compiling CUDA with the new driver

2022-04-29 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 rGc5e5b54350fe: [CUDA] Add driver support for compiling CUDA with the new driver (authored by jhuber6). Changed prior to commit: https://reviews.llv

[PATCH] D124220: [OpenMP] Add options to only compile the host or device when offloading

2022-04-29 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 426049. jhuber6 added a comment. Rebase after landing the cuda support for the new driver. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124220/new/ https://reviews.llvm.org/D124220 Files: clang/include/clan

[PATCH] D120273: [OpenMP] Allow CUDA to be linked with OpenMP using the new driver

2022-04-29 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 426050. jhuber6 added a comment. Adding test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120273/new/ https://reviews.llvm.org/D120273 Files: clang/test/Driver/linker-wrapper.c clang/tools/clang-linker-wr

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

2022-04-29 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 426051. jhuber6 added a comment. Herald added a subscriber: mattd. Rebase 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/LangOptio

[PATCH] D124220: [OpenMP] Add options to only compile the host or device when offloading

2022-04-29 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG47d66255701a: [OpenMP] Add options to only compile the host or device when offloading (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D12

[PATCH] D120273: [OpenMP] Allow CUDA to be linked with OpenMP using the new driver

2022-04-29 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd9c64d33b98b: [OpenMP] Allow CUDA to be linked with OpenMP using the new driver (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120273/n

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

2022-04-29 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 426150. jhuber6 added a comment. Fixed missing info flag for `--offload-new-driver`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123471/new/ https://reviews.llvm.org/D123471 Files: clang/include/clang/Basi

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

2022-04-30 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, JonChesterfield, yaxunl, saiislam, tianshilei1992, tra. Herald added subscribers: kerbowa, guansong, jvesely. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1,

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

2022-05-02 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/test/Driver/amdgpu-openmp-toolchain-new.c:6 // RUN: | FileCheck %s +// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa \ +// RUN: --offload-arch=gfx906 --libomptarget-a

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

2022-05-02 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/test/Driver/amdgpu-openmp-toolchain-new.c:6 // RUN: | FileCheck %s +// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa \ +// RUN: --offload-arch=gfx906 --libomptarget-a

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

2022-05-02 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/test/Driver/amdgpu-openmp-toolchain-new.c:6 // RUN: | FileCheck %s +// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa \ +// RUN: --offload-arch=gfx906 --libomptarget-a

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

2022-05-02 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 426404. jhuber6 added a comment. Fix test. 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/Dr

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

2022-05-02 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 426420. jhuber6 added a comment. Updating to use the `OffloadKind` enum rather than the string. I will also probably simplify some of the logic for handling multiple files here in a later patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACT

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

2022-05-02 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 426437. jhuber6 added a comment. Fix test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123810/new/ https://reviews.llvm.org/D123810 Files: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp clang/too

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

2022-05-02 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 426467. jhuber6 added a comment. Updating code generation. Previously we would seg-fault in the case that no offloading entries were created. To solve this we simply check that Begin != End before trying to register anything. Repository: rG LLVM Github M

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

2022-05-02 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 426521. jhuber6 added a comment. Changing slightly, I'm using the `getArgsForToolchain` to only get the `--offload-arch` options for that toolchain. This lets us quality it with options like `-Xopenmp-target=` so we can now specify architectures per-toolcha

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

2022-05-02 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/test/Driver/openmp-offload-gpu-new.c:56 + +// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-bindings -fopenmp \ +// RUN: -fopenmp-targets=nvptx64-nvidia-cuda,amdgcn-amd-amdhsa -Xopenmp-target=nvptx64-nvidia-

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

2022-05-04 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. I'm suggesting instead we define a new `__tgt_device_image` and a new `__tgt_register_lib` function to support this. This new `__tgt_device_image` will simply contain a pointer to an optional information struct. struct __tgt_device_image_v2 { void* ImageStar

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

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

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

2022-05-05 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/D124721/new/ https://reviews.llvm.org/D124721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

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

2022-05-05 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp:313 + if (BoundArch.empty()) +checkSystemForAMDGPU(Args, *this, Arch); DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_march_EQ), Arch); tra wrote:

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

2022-05-05 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 427496. jhuber6 added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125050/new/ https://reviews.llvm.org/D125050 Files: clang/include/clang/Basic/DiagnosticDriverKinds.td clang

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

2022-05-05 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked 3 inline comments as done. jhuber6 added inline comments. Comment at: clang/lib/Driver/Driver.cpp:788-789 + options::OPT_fno_openmp, false) && + (C.getInputArgs().hasArg(options::OPT_fopenmp_targets_EQ) || + C.getInputArgs()

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

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked an inline comment as done. jhuber6 added a comment. In D125050#3496289 , @saiislam wrote: > Looks good to me. > > Will it work with `-fno-openmp`? Sometimes `-fno-openmp` is used by the > end-user to override system provided `-fopenmp` fla

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

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 427599. jhuber6 added a comment. Add test for disabling openmp with `-fno-openmp` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125050/new/ https://reviews.llvm.org/D125050 Files: clang/include/clang/Basic/D

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

2022-05-06 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/D123812/new/ https://reviews.llvm.org/D123812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D125092: [OpenMP] Add basic support for properly handling static libraries

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

[PATCH] D125092: [OpenMP] Add basic support for properly handling static libraries

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe12905b4d5f9: [OpenMP] Add basic support for properly handling static libraries (authored by jhuber6). Changed prior to commit: https://reviews.llvm.org/D125092?vs=427618&id=427646#toc Repository: rG

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

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D123812#3496914 , @yaxunl wrote: > LGTM. Did you forget to accept the revision? D123810 and D123471 still need to be looked at, but these are mostly non-

[PATCH] D125092: [OpenMP] Add basic support for properly handling static libraries

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D125092#3497033 , @saiislam wrote: >> Ideally we could just put this on the linker itself, but nvlink doesn't seem >> to support .a files. > > Yes, nvlink does not support archives. So we used a wrapper to extract cubin > fil

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

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/Driver/Driver.cpp:789 + (C.getInputArgs().hasArg(options::OPT_fopenmp_targets_EQ) || + C.getInputArgs().hasArg(options::OPT_offload_arch_EQ)); + if (IsOpenMPOffloading) { yaxunl wrote: > probably sh

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

2022-05-06 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D123471#3497169 , @tra wrote: >> Type struct __tgt_offload_entry { >> >> void*addr; // Pointer to the offload entry info. >> // (function or global) >> char*name; // Name of the funct

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

[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:56-70 +enum OffloadRegionEntryKindFlag : uint32_t { + /// Mark the region entry as a kernel. + OffloadRegionKernelEntry = 0x0, +}; + +/// The kind flag of the global variable entry.

[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] 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] 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 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: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 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] 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] 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 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] D129435: [Clang] Parse toolchain-specific offloading arguments directly

2022-07-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D129435#3642450 , @yaxunl wrote: > need a test There's a test `clang/test/Driver/openmp-offload-gpu-new.c` already making sure that the following works, so this patch should maintain the same functionality we had before.

[PATCH] D128914: [HIP] Add support for handling HIP in the linker wrapper

2022-07-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D128914#3642558 , @JonChesterfield wrote: > Code looks good to me. It's hard to be sure whether it works without running > a bunch of hip test cases through it, have you already done so? If it doesn't > work out of the box i

[PATCH] D128914: [HIP] Add support for handling HIP in the linker wrapper

2022-07-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D128914#3642869 , @yaxunl wrote: > In D128914#3642567 , @jhuber6 wrote: > >> In D128914#3642558 , >> @JonChesterfield wrote: >> >>> Code looks

[PATCH] D129435: [Clang] Parse toolchain-specific offloading arguments directly

2022-07-11 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG359e4a824731: [Clang] Parse toolchain-specific offloading arguments directly (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129435/new/

[PATCH] D128850: [HIP] Generate offloading entries for HIP with the new driver.

2022-07-11 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe88d53d25f3b: [HIP] Generate offloading entries for HIP with the new driver. (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128850/new/

[PATCH] D128914: [HIP] Add support for handling HIP in the linker wrapper

2022-07-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 rGce091eb3b91f: [HIP] Add support for handling HIP in the linker wrapper (authored by jhuber6). Changed prior to commit: https://reviews.llvm.org/D1

[PATCH] D128914: [HIP] Add support for handling HIP in the linker wrapper

2022-07-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D128914#3643451 , @yaxunl wrote: > If you only unregister fatbin once for the whole program, then it should be > safe -fgpu-rdc. I am not sure if that is the case. it should be here, the generated handle is private to the reg

[PATCH] D128914: [HIP] Add support for handling HIP in the linker wrapper

2022-07-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D128914#3643802 , @tra wrote: > For what it's worth, NCCL is the only > nontrivial library that needs RDC compilation that I'm aware of. > It's also self-contained for RDC purposes we only n

[PATCH] D127304: [LinkerWrapper] Embed OffloadBinaries for OpenMP offloading images

2022-07-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 443810. jhuber6 added a comment. Removing `.image` from section name. This was originally done to avoid it getting the `SHF_EXCLUDE` flag when it should not be removed by the linker. That behaviour was moved to the `!exclude` metadata in a previous patch.

[PATCH] D128914: [HIP] Add support for handling HIP in the linker wrapper

2022-07-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D128914#3644022 , @thakis wrote: > This breaks check-clang on mac: http://45.33.8.238/macm1/39907/step_7.txt > > Please take a look and revert for now if it takes a while to fix. I changed some of the argument formats in a pre

[PATCH] D128914: [HIP] Add support for handling HIP in the linker wrapper

2022-07-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D128914#3644022 , @thakis wrote: > This breaks check-clang on mac: http://45.33.8.238/macm1/39907/step_7.txt > > Please take a look and revert for now if it takes a while to fix. Let me know if rGfe6a391357fc

[PATCH] D129534: [OpenMP] Do not link static library with `-nogpulib`

2022-07-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, JonChesterfield, tianshilei1992, ABataev. 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] D129534: [OpenMP] Do not link static library with `-nogpulib`

2022-07-12 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd214bfe78d8d: [OpenMP] Do not link static library with `-nogpulib` (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129534/new/ https://

[PATCH] D129581: [Clang] Rework LTO argument handling in the linker wrapper

2022-07-12 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, JonChesterfield, MaskRay, tra, ABataev, yaxunl, tianshilei1992. Herald added subscribers: StephenFan, inglorion. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, sstefan

[PATCH] D129586: [LinkerWrapper] Support remarks files for device LTO

2022-07-12 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, tianshilei1992, JonChesterfield. Herald added subscribers: wenlei, inglorion. Herald added a project: All. jhuber6 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch

[PATCH] D128090: [Clang][OpenMP] Process multi-arch compilation options given via -march

2022-07-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Sorry never noticed this revision. The purpose of this patch seems to be supporting something like this clang input.c -fopenmp -fopenmp-targets=nvptx64 -Xopenmp-target=nvptx64 -march=sm_70 -Xopenmp-target=nvptx64 -march=sm_80 Right now the above works if you replace

[PATCH] D129655: [CUDA] Allow the new driver to compile CUDA in non-RDC mode

2022-07-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, tra, JonChesterfield, yaxunl. Herald added subscribers: mattd, carlosgalvezp. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, MaskRay. Herald added a project: clang. Th

[PATCH] D128090: [Clang][OpenMP] Process multi-arch compilation options given via -march

2022-07-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a subscriber: tra. jhuber6 added a comment. In D128090#3648879 , @saiislam wrote: > `-Xopenmp-target -march ` used to be the only option to target a specific sub > arch before `--offload-arch`. But, it doesn't support multiple archs. > This

[PATCH] D128090: [Clang][OpenMP] Process multi-arch compilation options given via -march

2022-07-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D128090#3648984 , @tra wrote: > At some point we should start consolidating the ways we can specify an > offload target and try to avoid adding new ones until then. Agreed, that was my intention with making `--offload-arch` w

[PATCH] D128090: [Clang][OpenMP] Process multi-arch compilation options given via -march

2022-07-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D128090#3649059 , @tra wrote: > In D128090#3648999 , @jhuber6 wrote: > >> Right now there's `CLANG_OPENMP_NVPTX_DEFAULT_ARCH`, which is defined by >> CMake to be the architecture of th

<    1   2   3   4   5   6   7   8   9   10   >