[clang] [NVPTX] Correctly forward the PTX feature to the nvlink wrapper (PR #100607)

2024-07-25 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/100607 >From 0cc36f8aa42c1b673b1d239bf1518990582c5479 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 25 Jul 2024 12:31:09 -0500 Subject: [PATCH] [NVPTX] Correctly forward the PTX feature to the nvlink wrapper

[clang] [NVPTX] Correctly forward the PTX feature to the nvlink wrapper (PR #100607)

2024-07-25 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > The patch seems to change only the test file. Should there be more changes in > the patch? I think I somehow accidentally merged it with another patch and then lost it when I made a new branch.. https://github.com/llvm/llvm-project/pull/100607

[clang] [OpenMP] Defaultmap: fixes scalar issue, adds all variable category (PR #99315)

2024-07-25 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/99315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Suppress missing architecture error when doing LTO (PR #100652)

2024-07-25 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/100652 Summary: The `nvlink-wrapper` can do LTO now, which means we can still create some LLVM-IR without needing an architecture. In the case that we try to invoke `nvlink` internally, that will still fail. This patch

[clang] [LinkerWrapper] Forward `-mllvm` and `--offload-opt` arguments to device (PR #100424)

2024-07-25 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/100424 >From da623e1f8259a42aee469dc99f05e8cd24caf511 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 24 Jul 2024 11:44:22 -0500 Subject: [PATCH 1/2] [LinkerWrapper] Forward `-mllvm` and `--offload-opt` argumen

[clang] e603df0 - [NvlinkWrapper] Add relocatable link support to LTO pass

2024-07-26 Thread Joseph Huber via cfe-commits
Author: Joseph Huber Date: 2024-07-26T09:51:25-05:00 New Revision: e603df083be3d41680c6289bce549b022dcfe7d5 URL: https://github.com/llvm/llvm-project/commit/e603df083be3d41680c6289bce549b022dcfe7d5 DIFF: https://github.com/llvm/llvm-project/commit/e603df083be3d41680c6289bce549b022dcfe7d5.diff

[clang] [Clang] Do not pass `-shared` when using `-r` for AMDGPU (PR #100760)

2024-07-26 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/100760 Summary: We can use `-r` and `--lto-emit-llvm` to get the LTO pass to optimize + link LLVM-IR. Currently this doesn't work on AMDGPU because it always passes `-shared` which is incompatible with `-r`. Fix that so

[clang] [Clang] Do not pass `-shared` when using `-r` for AMDGPU (PR #100760)

2024-07-26 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/100760 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [llvm] [OpenMP][libc] Remove special handling for OpenMP printf (PR #98940)

2024-07-26 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Do we have the varargs handling pass run even with O0? Yes, it's a mandatory pass for NVPTX and AMDGPU. I added an extra pass in LTO recently just to let vararg functions be inlined, it's not necessary for correctness. https://github.com/llvm/llvm-project/pull/98940 _

[clang] [libc] [llvm] [OpenMP][libc] Remove special handling for OpenMP printf (PR #98940)

2024-07-26 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/98940 >From 9195ed11dde78e04c831a5bcb6f9c1cc0e6f0304 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 15 Jul 2024 12:42:09 -0500 Subject: [PATCH] [OpenMP][libc] Remove special handling for OpenMP printf Summary:

[clang] [libc] [llvm] [OpenMP][libc] Remove special handling for OpenMP printf (PR #98940)

2024-07-26 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/98940 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fea5914 - Revert "[OpenMP][libc] Remove special handling for OpenMP printf (#98940)"

2024-07-26 Thread Joseph Huber via cfe-commits
Author: Joseph Huber Date: 2024-07-26T16:39:12-05:00 New Revision: fea5914c926e2f013a8b5e27eaa74c7047fb2c71 URL: https://github.com/llvm/llvm-project/commit/fea5914c926e2f013a8b5e27eaa74c7047fb2c71 DIFF: https://github.com/llvm/llvm-project/commit/fea5914c926e2f013a8b5e27eaa74c7047fb2c71.diff

[clang] [libc] [Clang] Suppress missing architecture error when doing LTO (PR #100652)

2024-07-26 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/100652 >From 5017fe0cc33af9b7731786122c21602258b51c9a Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 25 Jul 2024 15:40:40 -0500 Subject: [PATCH 1/2] [Clang] Suppress missing architecture error when doing LTO

[clang] dbb8b7a - Reapply "[OpenMP][libc] Remove special handling for OpenMP printf (#98940)"

2024-07-26 Thread Joseph Huber via cfe-commits
Author: Joseph Huber Date: 2024-07-26T17:21:56-05:00 New Revision: dbb8b7a0f4eea1aa333cec9a38aa6eb7ecf6c1dc URL: https://github.com/llvm/llvm-project/commit/dbb8b7a0f4eea1aa333cec9a38aa6eb7ecf6c1dc DIFF: https://github.com/llvm/llvm-project/commit/dbb8b7a0f4eea1aa333cec9a38aa6eb7ecf6c1dc.diff

[clang] [flang] [Flang-new][OpenMP] Add bitcode files for AMD GPU OpenMP (PR #96742)

2024-07-28 Thread Joseph Huber via cfe-commits
jhuber6 wrote: What are we relying on `-mlink-builtin-bitcode` for right now? IIUC it's mostly just math, right? https://github.com/llvm/llvm-project/pull/96742 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-07-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/99687 >From 59901100a2c11d37947938dfb9db5dd1164cbbf5 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 19 Jul 2024 14:07:18 -0500 Subject: [PATCH 1/3] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directl

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-07-29 Thread Joseph Huber via cfe-commits
@@ -29,6 +29,9 @@ // RUN: -fuse-ld=ld %s 2>&1 | FileCheck -check-prefixes=LD %s // LD: ld.lld +// RUN: %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx906 %s 2>&1 | FileCheck -check-prefix=ROCM %s +// ROCM-NOT: -mlink-builtin-bitcode + // RUN: %clang -### --target=amdgcn-a

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-07-29 Thread Joseph Huber via cfe-commits
@@ -29,6 +29,9 @@ // RUN: -fuse-ld=ld %s 2>&1 | FileCheck -check-prefixes=LD %s // LD: ld.lld +// RUN: %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx906 %s 2>&1 | FileCheck -check-prefix=ROCM %s +// ROCM-NOT: -mlink-builtin-bitcode + // RUN: %clang -### --target=amdgcn-a

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-07-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/99687 >From 59901100a2c11d37947938dfb9db5dd1164cbbf5 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 19 Jul 2024 14:07:18 -0500 Subject: [PATCH 1/4] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directl

[clang] [lld] [llvm] Add debug options to clang-linker-wrapper (PR #101008)

2024-07-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: `lld` changes need to be separate, forwarding `-mllvm` is https://github.com/llvm/llvm-project/pull/100424 but I forgot to merge it so I'll do that. https://github.com/llvm/llvm-project/pull/101008 ___ cfe-commit

[clang] [LinkerWrapper] Forward `-mllvm` and `--offload-opt` arguments to device (PR #100424)

2024-07-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/100424 >From 88b8b4fc649dd9c900fc941f1e03cd5fc097acc1 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 24 Jul 2024 11:44:22 -0500 Subject: [PATCH] [LinkerWrapper] Forward `-mllvm` and `--offload-opt` arguments t

[clang] [LinkerWrapper] Forward `-mllvm` and `--offload-opt` arguments to device (PR #100424)

2024-07-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/100424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] Add debug options to clang-linker-wrapper (PR #101008)

2024-07-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 edited https://github.com/llvm/llvm-project/pull/101008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LinkerWrapper] Make `-Xoffload-linker` match `-Xlinker` semantics (PR #101032)

2024-07-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/101032 Summary: `-Xlinker` is supposed to pass options to the linker, while `-Xoffload-linker` instead passes it to the `clang` job. This is unintuitive and results in unnecessarily complex command lines. Because passin

[clang] [LinkerWrapper] Make `-Xoffload-linker` match `-Xlinker` semantics (PR #101032)

2024-07-29 Thread Joseph Huber via cfe-commits
@@ -1236,6 +1238,23 @@ DerivedArgList getLinkerArgs(ArrayRef Input, Args.MakeArgString(Value)); } + // Forward '-Xoffload-compiler' options to the appropriate backend. + for (StringRef Arg : Args.getAllArgValues(OPT_device_compiler_args_EQ)) { +a

[clang] [LinkerWrapper] Make `-Xoffload-linker` match `-Xlinker` semantics (PR #101032)

2024-07-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/101032 >From 19d0d5622fbc5b7df07e2fc907b8e7c50216bcde Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 29 Jul 2024 10:36:12 -0500 Subject: [PATCH] [LinkerWrapper] Make `-Xoffload-linker` match `-Xlinker` semanti

[clang] [AMDGPU] Correctly pass the target-id to `ld.lld` (PR #101037)

2024-07-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/101037 Summary: The `ld.lld` linker handles LTO, but it does not understand the target-id syntax some AMDGPU targets use. This patch parses the target-id and passes the processor name in `-mcpu` and features in `-mattr`

[clang] [AMDGPU] Correctly pass the target-id to `ld.lld` (PR #101037)

2024-07-29 Thread Joseph Huber via cfe-commits
@@ -634,7 +634,17 @@ void amdgpu::Linker::ConstructJob(Compilation &C, const JobAction &JA, C.getDriver().getLTOMode() == LTOK_Thin); else if (Args.hasArg(options::OPT_mcpu_EQ)) CmdArgs.push_back(Args.MakeArgString( -"-plugin-opt=mcpu=" + Args.g

[clang] [AMDGPU] Correctly pass the target-id to `ld.lld` (PR #101037)

2024-07-29 Thread Joseph Huber via cfe-commits
@@ -634,7 +634,17 @@ void amdgpu::Linker::ConstructJob(Compilation &C, const JobAction &JA, C.getDriver().getLTOMode() == LTOK_Thin); else if (Args.hasArg(options::OPT_mcpu_EQ)) CmdArgs.push_back(Args.MakeArgString( -"-plugin-opt=mcpu=" + Args.g

[clang] [AMDGPU] Correctly pass the target-id to `ld.lld` (PR #101037)

2024-07-29 Thread Joseph Huber via cfe-commits
@@ -634,7 +634,17 @@ void amdgpu::Linker::ConstructJob(Compilation &C, const JobAction &JA, C.getDriver().getLTOMode() == LTOK_Thin); else if (Args.hasArg(options::OPT_mcpu_EQ)) CmdArgs.push_back(Args.MakeArgString( -"-plugin-opt=mcpu=" + Args.g

[clang] [AMDGPU] Correctly pass the target-id to `ld.lld` (PR #101037)

2024-07-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/101037 >From 3ff8ea9a35e8949e53e4947d6fa0688e6d5b3939 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 29 Jul 2024 11:29:45 -0500 Subject: [PATCH] [AMDGPU] Correctly pass the target-id to `ld.lld` Summary: The `

[clang] [AMDGPU] Correctly pass the target-id to `ld.lld` (PR #101037)

2024-07-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/101037 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LinkerWrapper] Make `-Xoffload-linker` match `-Xlinker` semantics (PR #101032)

2024-07-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/101032 >From 19d0d5622fbc5b7df07e2fc907b8e7c50216bcde Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 29 Jul 2024 10:36:12 -0500 Subject: [PATCH 1/2] [LinkerWrapper] Make `-Xoffload-linker` match `-Xlinker` sem

[clang] [LinkerWrapper] Make `-Xoffload-linker` match `-Xlinker` semantics (PR #101032)

2024-07-29 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Do we have some sort of documentation where this change of behavior needs to > be communicated? Could probably specify it more in the docs. https://github.com/llvm/llvm-project/pull/101032 ___ cfe-commits mailing list cfe-commits@lis

[clang] Add debug options to clang-linker-wrapper (PR #101008)

2024-07-29 Thread Joseph Huber via cfe-commits
@@ -781,6 +791,8 @@ bool isValidCIdentifier(StringRef S) { Error linkBitcodeFiles(SmallVectorImpl &InputFiles, SmallVectorImpl &OutputFiles, const ArgList &Args) { + if (Verbose) +llvm::errs() << "Linking bitcode files\n";

[clang] Add debug options to clang-linker-wrapper (PR #101008)

2024-07-29 Thread Joseph Huber via cfe-commits
@@ -581,8 +581,16 @@ Expected clang(ArrayRef InputFiles, const ArgList &Args) { if (SaveTemps) CmdArgs.push_back("-save-temps"); - if (SaveTemps && linkerSupportsLTO(Args)) -CmdArgs.push_back("-Wl,--save-temps"); + if (linkerSupportsLTO(Args)) { +if (SaveTemps

[clang] Add debug options to clang-linker-wrapper (PR #101008)

2024-07-29 Thread Joseph Huber via cfe-commits
@@ -581,8 +581,16 @@ Expected clang(ArrayRef InputFiles, const ArgList &Args) { if (SaveTemps) CmdArgs.push_back("-save-temps"); - if (SaveTemps && linkerSupportsLTO(Args)) -CmdArgs.push_back("-Wl,--save-temps"); + if (linkerSupportsLTO(Args)) { +if (SaveTemps

[clang] [libc] [Clang] Suppress missing architecture error when doing LTO (PR #100652)

2024-07-31 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Ping, would like to remove the hacky code from `libc`. https://github.com/llvm/llvm-project/pull/100652 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-15 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Ping https://github.com/llvm/llvm-project/pull/96561 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-15 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,64 @@ + +Clang nvlink Wrapper + + +.. contents:: + :local: + +.. _clang-nvlink-wrapper: + +Introduction + + +This tools works as a wrapper around the NVIDIA ``nvlink`` linker. The purpose +of this wrapper is to prov

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-15 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,64 @@ + +Clang nvlink Wrapper + + +.. contents:: + :local: + +.. _clang-nvlink-wrapper: + +Introduction + + +This tools works as a wrapper around the NVIDIA ``nvlink`` linker. The purpose +of this wrapper is to prov

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-15 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,776 @@ +//===-- clang-nvlink-wrapper/ClangNVLinkWrapper.cpp - NVIDIA linker util --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-15 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,776 @@ +//===-- clang-nvlink-wrapper/ClangNVLinkWrapper.cpp - NVIDIA linker util --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-15 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,776 @@ +//===-- clang-nvlink-wrapper/ClangNVLinkWrapper.cpp - NVIDIA linker util --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-15 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > First batch of comments on the patch -- I only got till about the middle of > ClangNVLinkWrapper.cpp. Will continue reviewing tomorrow. Appreciate it. Sorry about dropping a huge patch like this on you. https://github.com/llvm/llvm-project/pull/96561 __

[clang] [OpenMP][AMDGPU] Do not attach -fcuda-is-device (PR #99002)

2024-07-16 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. https://github.com/llvm/llvm-project/pull/99002 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [libcxx] [libc][libcxx] Support for building libc++ against LLVM libc (PR #99287)

2024-07-17 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: I was just about to do something similar, so I'm glad you got to it before me. I think we'll need a CMake check on whether or not `libc` was enabled as a runtime if this option is enabled in `libcxx`, but beyond that it looks very reasonable. All we're doi

[clang] [libc] [libcxx] [libc][libcxx] Support for building libc++ against LLVM libc (PR #99287)

2024-07-17 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. I tested this locally and it worked quite well thanks. My nit is that we should add a check that mirrors the already existing `LIBCXXABI_USE_LLVM_UNWINDER` flag, which prints an error if `libunwind` isn't in the runtimes list. After that L

[clang] [ClangLinkerWrapper] Fix intermediate file naming for multi-arch compilation (PR #99325)

2024-07-17 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. https://github.com/llvm/llvm-project/pull/99325 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [libcxx] [libc][libcxx] Support for building libc++ against LLVM libc (PR #99287)

2024-07-17 Thread Joseph Huber via cfe-commits
@@ -293,6 +293,7 @@ option(LIBCXX_ENABLE_THREADS "Build libc++ with support for threads." ON) option(LIBCXX_ENABLE_MONOTONIC_CLOCK "Build libc++ with support for a monotonic clock. This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON) +option(LIBCXX_USE_

[clang] [libc] [libcxx] [libc][libcxx] Support for building libc++ against LLVM libc (PR #99287)

2024-07-17 Thread Joseph Huber via cfe-commits
@@ -293,6 +293,7 @@ option(LIBCXX_ENABLE_THREADS "Build libc++ with support for threads." ON) option(LIBCXX_ENABLE_MONOTONIC_CLOCK "Build libc++ with support for a monotonic clock. This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON) +option(LIBCXX_USE_

[clang] [libc] [libcxx] [libc][libcxx] Support for building libc++ against LLVM libc (PR #99287)

2024-07-17 Thread Joseph Huber via cfe-commits
@@ -293,6 +293,7 @@ option(LIBCXX_ENABLE_THREADS "Build libc++ with support for threads." ON) option(LIBCXX_ENABLE_MONOTONIC_CLOCK "Build libc++ with support for a monotonic clock. This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON) +option(LIBCXX_USE_

[clang] [libc] [libcxx] [libc][libcxx] Support for building libc++ against LLVM libc (PR #99287)

2024-07-17 Thread Joseph Huber via cfe-commits
@@ -293,6 +293,7 @@ option(LIBCXX_ENABLE_THREADS "Build libc++ with support for threads." ON) option(LIBCXX_ENABLE_MONOTONIC_CLOCK "Build libc++ with support for a monotonic clock. This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON) +option(LIBCXX_USE_

[clang] [libc] [llvm] [OpenMP][libc] Remove special handling for OpenMP printf (PR #98940)

2024-07-17 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Do we have tests that cover these cases? There's already `printf` related tests AFAIK, this just changes the implementation. I could add more if needed. https://github.com/llvm/llvm-project/pull/98940 ___ cfe-commits mailing list cfe

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-18 Thread Joseph Huber via cfe-commits
jhuber6 wrote: The CI seems to fail because it's not building the tool yet, the patch should enable that dependency but maybe the bot doesn't know how to pick it up until it lands. https://github.com/llvm/llvm-project/pull/96561 ___ cfe-commits maili

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-07-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/99687 Summary: The `getToolChain` pass uses the triple to determine which toolchain to create. Currently the `amdgcn-amd-amdhsa` triple maps to the `ROCmToolChain` which uses things expected to be provided by `ROCm`. Th

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-07-19 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Needs test. I also would assume you shouldn't have to reinvent language > detection code There's an existing function for getting the inputs, but it takes the `ToolChain` as input so it makes a circular dependency. The implementation doesn't seem to need _that_ much from the

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-07-19 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Also, apparently there's some driver tests that expect `--target=amdgcn-amd-amdhsa-opencl` as the environment type. Is that the expected way to specify OpenCL? I'm not overly familiar. https://github.com/llvm/llvm-project/pull/99687 __

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-07-19 Thread Joseph Huber via cfe-commits
jhuber6 wrote: There's a test that's `.cl` that doesn't pass `-opencl` so probably can't rely on it. https://github.com/llvm/llvm-project/pull/99687 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-07-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/99687 >From 59901100a2c11d37947938dfb9db5dd1164cbbf5 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 19 Jul 2024 14:07:18 -0500 Subject: [PATCH] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly S

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-07-19 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Okay, so the only user of the toolchain is `Darwin`. So I'd need to somehow rework that logic to make it work. https://github.com/llvm/llvm-project/pull/99687 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-07-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/99687 >From 59901100a2c11d37947938dfb9db5dd1164cbbf5 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 19 Jul 2024 14:07:18 -0500 Subject: [PATCH 1/2] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directl

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-07-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/99687 >From 59901100a2c11d37947938dfb9db5dd1164cbbf5 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 19 Jul 2024 14:07:18 -0500 Subject: [PATCH 1/2] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directl

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-07-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/99687 >From 59901100a2c11d37947938dfb9db5dd1164cbbf5 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 19 Jul 2024 14:07:18 -0500 Subject: [PATCH 1/3] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directl

[clang] [Clang] Fix C library wrappers for offloading (PR #99716)

2024-07-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/99716 Summary: This block of code wraps around the standard C library includes. However, the order C library includes are presented is actually important. If they are visible before the `libc++` headers then it will cau

[clang] [Clang] Fix C library wrappers for offloading (PR #99716)

2024-07-19 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Yeah, rewriting the function signature is gonna be quite a hassle. LG for now. > > If we change the function signature, does it make easier to set default > argument? It'll be similar code, but it would allow us to use the same helpers that the other targets use. https://git

[clang] [Clang] Fix C library wrappers for offloading (PR #99716)

2024-07-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/99716 >From 02012a704c4ad0c666d38bf2b2a7bf74c7f3b2c1 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 19 Jul 2024 17:33:08 -0500 Subject: [PATCH] [Clang] Fix C library wrappers for offloading Summary: This block

[clang] [Clang] Fix C library wrappers for offloading (PR #99716)

2024-07-20 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/99716 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-07-22 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > Also, apparently there's some driver tests that expect > > `--target=amdgcn-amd-amdhsa-opencl` as the environment type. Is that the > > expected way to specify OpenCL? I'm not overly familiar. > > That was a mistake from long ago we shouldn't continue. A language is not an

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-22 Thread Joseph Huber via cfe-commits
jhuber6 wrote: ping https://github.com/llvm/llvm-project/pull/96561 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMP] Ensure the actual kernel is annotated with launch bounds (PR #99927)

2024-07-22 Thread Joseph Huber via cfe-commits
@@ -4569,7 +4569,17 @@ OpenMPIRBuilder::createTargetInit(const LocationDescription &Loc, bool IsSPMD, Constant *MayUseNestedParallelismVal = ConstantInt::getSigned(Int8, true); Constant *DebugIndentionLevelVal = ConstantInt::getSigned(Int16, 0); - Function *Kernel = Buil

[clang] [llvm] [OpenMP] Ensure the actual kernel is annotated with launch bounds (PR #99927)

2024-07-22 Thread Joseph Huber via cfe-commits
@@ -4569,7 +4569,17 @@ OpenMPIRBuilder::createTargetInit(const LocationDescription &Loc, bool IsSPMD, Constant *MayUseNestedParallelismVal = ConstantInt::getSigned(Int8, true); Constant *DebugIndentionLevelVal = ConstantInt::getSigned(Int16, 0); - Function *Kernel = Buil

[clang] [llvm] [OpenMP] Ensure the actual kernel is annotated with launch bounds (PR #99927)

2024-07-22 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. I guess we did this debugging stuff before, so nothing really changed here. https://github.com/llvm/llvm-project/pull/99927 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-22 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,778 @@ +//===-- clang-nvlink-wrapper/ClangNVLinkWrapper.cpp - NVIDIA linker util --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-22 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,778 @@ +//===-- clang-nvlink-wrapper/ClangNVLinkWrapper.cpp - NVIDIA linker util --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-22 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,778 @@ +//===-- clang-nvlink-wrapper/ClangNVLinkWrapper.cpp - NVIDIA linker util --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-22 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,778 @@ +//===-- clang-nvlink-wrapper/ClangNVLinkWrapper.cpp - NVIDIA linker util --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-22 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,778 @@ +//===-- clang-nvlink-wrapper/ClangNVLinkWrapper.cpp - NVIDIA linker util --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-22 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/96561 >From 455513d5ca8983443d3ec69919ff9a80eabc8fe3 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 24 Jun 2024 15:14:52 -0500 Subject: [PATCH] [Clang] Introduce 'clang-nvlink-wrappaer' to work around 'nvlink'

[clang] [LinkerWrapper] Pass all files to the device linker (PR #97573)

2024-07-22 Thread Joseph Huber via cfe-commits
@@ -504,18 +511,23 @@ Expected clang(ArrayRef InputFiles, const ArgList &Args) { llvm::copy(LinkerArgs, std::back_inserter(CmdArgs)); } - // Pass on -mllvm options to the clang invocation. - for (const opt::Arg *Arg : Args.filtered(OPT_mllvm)) { -CmdArgs.push_back

[clang] [LinkerWrapper] Pass all files to the device linker (PR #97573)

2024-07-22 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,64 @@ + +Clang nvlink Wrapper + + +.. contents:: + :local: + +.. _clang-nvlink-wrapper: + +Introduction + + +This tools works as a wrapper around the NVIDIA ``nvlink`` linker. The purpose +of this wrapper is to prov

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-22 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/96561 >From 9cd5a58f63621f1707895dcc563bc18bf995c85e Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 24 Jun 2024 15:14:52 -0500 Subject: [PATCH] [Clang] Introduce 'clang-nvlink-wrappaer' to work around 'nvlink'

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-22 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/96561 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] e391ba0 - [Clang] Fix incorrect value assignment in nvlink wrapper

2024-07-22 Thread Joseph Huber via cfe-commits
Author: Joseph Huber Date: 2024-07-22T18:23:02-05:00 New Revision: e391ba07fabd3990edb9be9f3d715abba7e43343 URL: https://github.com/llvm/llvm-project/commit/e391ba07fabd3990edb9be9f3d715abba7e43343 DIFF: https://github.com/llvm/llvm-project/commit/e391ba07fabd3990edb9be9f3d715abba7e43343.diff

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-22 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > @jhuber6 this change seems to be causing build failures on some bots: > > * https://lab.llvm.org/buildbot/#/builders/174/builds/2129 > > * https://lab.llvm.org/buildbot/#/builders/190/builds/2383 > > > Can you take a look? Gah, sorry forgot to suppress that error whe

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-07-22 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > https://lab.llvm.org/buildbot/#/builders/174/builds/2130 > > Actually I noticed (and I think you already did as well), that there seems to > be a test failure of nvwrapper.c after you fixed the build error. Just wanted > to let you know in case you were not already aware. Yep

[clang] [AMDGPU] Correctly determine the toolchain linker (PR #89803)

2024-04-23 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/89803 Summary: The AMDGPU toolchain simply took the short name to get the link job instead of using the common utilities that respect options like `-fuse-ld`. Any linker that isn't `ld.lld` will fail, however we should

[clang] [AMDGPU] Correctly determine the toolchain linker (PR #89803)

2024-04-23 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Note that this doesn't affect OpenMP or HIP. The former uses the `clang-linker-wrapper` while the latter calls `lld` directly. https://github.com/llvm/llvm-project/pull/89803 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-23 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: How much of this is actually different from the existing target info for AMDGCN? Seems like we're doing a lot of redundant stuff like defining macros or features. https://github.com/llvm/llvm-project/pull/89796 _

[clang] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-23 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > How much of this is actually different from the existing target info for > > AMDGCN? Seems like we're doing a lot of redundant stuff like defining > > macros or features. > > That's part of the point, it's not actually supposed to differ in those > particular regards, up to

[clang] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-23 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > That's not a bad idea but I _suspect_ we'll run into a physical design issue > since there doesn't seem to be a natural place to put the shared base - > unless you were thinking about a place in particular? We'd probably have to > relocate this to the AMDGCN side, and then dup

[clang] [AMDGPU] Correctly determine the toolchain linker (PR #89803)

2024-04-24 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/89803 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] eaa2eac - [AMDGPU] Fix linker test on platforms without BFD

2024-04-24 Thread Joseph Huber via cfe-commits
Author: Joseph Huber Date: 2024-04-24T07:03:51-05:00 New Revision: eaa2eac8ec73a0473655f2da73f347906d14b00f URL: https://github.com/llvm/llvm-project/commit/eaa2eac8ec73a0473655f2da73f347906d14b00f DIFF: https://github.com/llvm/llvm-project/commit/eaa2eac8ec73a0473655f2da73f347906d14b00f.diff

[clang] [CMake] Change GCC_INSTALL_PREFIX from warning to fatal error (PR #85891)

2024-04-24 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > I disagree, `--gcc-install-dir` is sure an improvement over > `--gcc-toolchain`, but they're both weaker than the compile time option > `GCC_INSTALL_PREFIX` because of runtimes. > > You're looking to remove `GCC_INSTALL_PREFIX`, then give a clear alternative > that's equivale

[clang] bfd269d - [AMDGPU] Fix test failing on Windows for `ld.lld.exe`

2024-04-28 Thread Joseph Huber via cfe-commits
Author: Joseph Huber Date: 2024-04-28T06:36:09-05:00 New Revision: bfd269d0d0d6cb58235a838eb659eef97e4f2ebf URL: https://github.com/llvm/llvm-project/commit/bfd269d0d0d6cb58235a838eb659eef97e4f2ebf DIFF: https://github.com/llvm/llvm-project/commit/bfd269d0d0d6cb58235a838eb659eef97e4f2ebf.diff

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
@@ -673,8 +673,12 @@ std::unique_ptr AllocateTarget(const llvm::Triple &Triple, } case llvm::Triple::spirv64: { if (os != llvm::Triple::UnknownOS || -Triple.getEnvironment() != llvm::Triple::UnknownEnvironment) +Triple.getEnvironment() != llvm::Triple::

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
@@ -54,3 +56,77 @@ void SPIRV64TargetInfo::getTargetDefines(const LangOptions &Opts, BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder); DefineStd(Builder, "SPIRV64", Opts); } + +namespace { +const AMDGPUTargetInfo AMDGPUTI(llvm::Triple("amdgcn-amd-amdhsa"), {}); + +} //

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
@@ -54,3 +56,77 @@ void SPIRV64TargetInfo::getTargetDefines(const LangOptions &Opts, BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder); DefineStd(Builder, "SPIRV64", Opts); } + +namespace { +const AMDGPUTargetInfo AMDGPUTI(llvm::Triple("amdgcn-amd-amdhsa"), {}); + +} //

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
@@ -6088,6 +6088,9 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, StringRef Prefix = llvm::Triple::getArchTypePrefix(getTarget().getTriple().getArch()); if (!Prefix.empty()) { +if (Prefix == "spv" && +getTarget().getTr

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-28 Thread Joseph Huber via cfe-commits
@@ -6088,6 +6088,9 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, StringRef Prefix = llvm::Triple::getArchTypePrefix(getTarget().getTriple().getArch()); if (!Prefix.empty()) { +if (Prefix == "spv" && +getTarget().getTr

<    9   10   11   12   13   14   15   16   17   18   >