[clang] [llvm] [LLVM] Add `__builtin_readsteadycounter` intrinsic and builtin for realtime clocks (PR #81331)

2024-02-12 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > New intrinsic sounds right - a constant frequency counter is a different > thing to a variable frequency counter. > > "Steady" implies unchanging, so I'd agree with `readfixedfreqtimer` or > similar. I think `steady` has sufficient context here, (i.e.

[clang] f5fd0de - [LinkerWrapper][NFC] Rename 'all' to 'generic' for architecture agnostic IR

2024-02-12 Thread Joseph Huber via cfe-commits
Author: Joseph Huber Date: 2024-02-12T08:15:48-06:00 New Revision: f5fd0deb2371d0bae3bef2563f50e005a140fc6d URL: https://github.com/llvm/llvm-project/commit/f5fd0deb2371d0bae3bef2563f50e005a140fc6d DIFF: https://github.com/llvm/llvm-project/commit/f5fd0deb2371d0bae3bef2563f50e005a140fc6d.diff

[clang] [llvm] [LLVM] Add `__builtin_readsteadycounter` intrinsic and builtin for realtime clocks (PR #81331)

2024-02-12 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81331 >From 30341079e795c2668588b791f2c97b44006e7a04 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 9 Feb 2024 16:13:42 -0600 Subject: [PATCH] [WIP][LLVM] Add `__builtin_readsteadycounter` intrinsic and

[clang] [llvm] [LLVM] Add `__builtin_readsteadycounter` intrinsic and builtin for realtime clocks (PR #81331)

2024-02-12 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Are we assuming any particular relationship to __builtin_readcyclecounter in > terms of scales etc? > > __builtin_readsteadycounter could be used to access x86 MPERF clock counters, > but to access the corresponding APERF clock we'd then need a >

[clang] [llvm] [LLVM] Add `__builtin_readsteadycounter` intrinsic and buiiltin for realtime clocks (PR #81331)

2024-02-10 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81331 >From 30341079e795c2668588b791f2c97b44006e7a04 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 9 Feb 2024 16:13:42 -0600 Subject: [PATCH] [WIP][LLVM] Add `__builtin_readsteadycounter` intrinsic and

[clang] [llvm] [LLVM] Add `__builtin_readsteadycounter` intrinsic and buiiltin for realtime clocks (PR #81331)

2024-02-10 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81331 >From 109939223e7944472363134d72a223524e1e3f0a Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 9 Feb 2024 16:13:42 -0600 Subject: [PATCH] [WIP][LLVM] Add `__builtin_readsteadycounter` intrinsic and

[clang] [llvm] [LLVM] Add `__builtin_readsteadycounter` intrinsic and buiiltin for realtime clocks (PR #81331)

2024-02-10 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Added clang test and renamed to `readsteadycounter` as I think it's more descriptive and matches the existing `readcyclecounter` better. https://github.com/llvm/llvm-project/pull/81331 ___ cfe-commits mailing list

[clang] [llvm] [LLVM] Add `__builtin_readsteadycounter` intrinsic and buiiltin for realtime clocks (PR #81331)

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

[clang] [llvm] [LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin for realtime clocks (PR #81331)

2024-02-10 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81331 >From 164d9775046d273fa45e9934cea1db07fdd2ca79 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 9 Feb 2024 16:13:42 -0600 Subject: [PATCH] [WIP][LLVM] Add `__builtin_readsteadycounter` intrinsic and

[clang] [llvm] [LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin for realtime clocks (PR #81331)

2024-02-10 Thread Joseph Huber via cfe-commits
@@ -312,6 +312,12 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { CI->replaceAllUsesWith(ConstantInt::get(Type::getInt64Ty(Context), 0)); break; } + case Intrinsic::readfixedtimer: { +errs() << "WARNING: this target does not support the

[clang] [llvm] [LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin for realtime clocks (PR #81331)

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

[clang] [llvm] LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin for realtime clocks (PR #81331)

2024-02-09 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Generally looks good to me. Just not sure about the name. "fixed timer" > sounds pretty confusing to me. probably `readfixedfreqtimer`? Naming is the hard part. I was also thinking about `readrealtimecounter` or something. Maybe `readsteadycounter`?

[clang] [llvm] LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin for realtime clocks (PR #81331)

2024-02-09 Thread Joseph Huber via cfe-commits
@@ -312,6 +312,12 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { CI->replaceAllUsesWith(ConstantInt::get(Type::getInt64Ty(Context), 0)); break; } + case Intrinsic::readfixedtimer: { +errs() << "WARNING: this target does not support the

[clang] [llvm] LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin for realtime clocks (PR #81331)

2024-02-09 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Formatting is expected to fail to preserve local style. https://github.com/llvm/llvm-project/pull/81331 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin for realtime clocks (PR #81331)

2024-02-09 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 ready_for_review https://github.com/llvm/llvm-project/pull/81331 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin for realtime clocks (PR #81331)

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

[clang] [llvm] LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin for realtime clocks (PR #81331)

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

[clang] [llvm] [WIP][LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin (PR #81331)

2024-02-09 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81331 >From 6b85d8edfe35d3952fc4e67e249175d9f8f734c6 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 9 Feb 2024 16:13:42 -0600 Subject: [PATCH] [WIP][LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin

[clang] [llvm] [WIP][LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin (PR #81331)

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

[clang] [llvm] [WIP][LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin (PR #81331)

2024-02-09 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81331 >From 4008cb94b59ea1be8aa6936c4dc6b5b7ad4e749a Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 9 Feb 2024 16:13:42 -0600 Subject: [PATCH] [WIP][LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin

[clang] [llvm] [WIP][LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin (PR #81331)

2024-02-09 Thread Joseph Huber via cfe-commits
jhuber6 wrote: This is a draft, I'm trying to get this to map to either `s_memtime` or `s_sendmsg_rtn(0x83)` depending on the target for AMDGPU. Currently, it will recognize the new intrinsic but just lower it to `i64 0`. I'm not overly familiar with the backend, so any suggestions would be

[clang] [llvm] [WIP][LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin (PR #81331)

2024-02-09 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/81331 Summary: This patch adds a new intrinsic and builtin function mirroring the existing `__builtin_readcyclecounter`. The difference is that this implementation targets a separate counter that some targets have

[clang] [llvm] [NVPTX] Add clang builtin for `__nvvm_reflect` intrinsic (PR #81277)

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

[clang] [llvm] [NVPTX] Add clang builtin for `__nvvm_reflect` intrinsic (PR #81277)

2024-02-09 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81277 >From 5c9bc83db318d5c8608108942e494d6f0c1a27d5 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 9 Feb 2024 10:50:20 -0600 Subject: [PATCH] [NVPTX] Add clang builtin for `__nvvm_reflect` intrinsic Summary:

[clang] [llvm] [NVPTX][Draft] Make `__nvvm_nanosleep` a no-op if unsupported (PR #81033)

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

[clang] [llvm] [NVPTX] Add builtin support for 'globaltimer' (PR #79765)

2024-02-09 Thread Joseph Huber via cfe-commits
@@ -140,6 +140,17 @@ define void @test_exit() { ret void } +; CHECK-LABEL: test_globaltimer +define i64 @test_globaltimer() { +; CHECK: mov.u64 %r{{.*}}, %globaltimer; + %a = tail call i64 @llvm.nvvm.read.ptx.sreg.globaltimer() jhuber6 wrote: Done

[clang] [llvm] [NVPTX] Add builtin support for 'globaltimer' (PR #79765)

2024-02-09 Thread Joseph Huber via cfe-commits
@@ -140,6 +140,17 @@ define void @test_exit() { ret void } +; CHECK-LABEL: test_globaltimer +define i64 @test_globaltimer() { +; CHECK: mov.u64 %r{{.*}}, %globaltimer; + %a = tail call i64 @llvm.nvvm.read.ptx.sreg.globaltimer() jhuber6 wrote:

[clang] [llvm] [NVPTX] Add clang builtin for `__nvvm_reflect` intrinsic (PR #81277)

2024-02-09 Thread Joseph Huber via cfe-commits
@@ -1624,8 +1624,9 @@ def int_nvvm_compiler_error : def int_nvvm_compiler_warn : Intrinsic<[], [llvm_anyptr_ty], [], "llvm.nvvm.compiler.warn">; -def int_nvvm_reflect : - Intrinsic<[llvm_i32_ty], [llvm_anyptr_ty], [IntrNoMem], "llvm.nvvm.reflect">; +def int_nvvm_reflect

[clang] [llvm] [NVPTX] Add clang builtin for `__nvvm_reflect` intrinsic (PR #81277)

2024-02-09 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81277 >From 7b97388a5f251684cf4ae69c3b0cae0ff6fe1397 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 9 Feb 2024 10:50:20 -0600 Subject: [PATCH 1/2] [NVPTX] Add clang builtin for `__nvvm_reflect` intrinsic

[clang] [llvm] [NVPTX] Add clang builtin for `__nvvm_reflect` intrinsic (PR #81277)

2024-02-09 Thread Joseph Huber via cfe-commits
@@ -1624,8 +1624,9 @@ def int_nvvm_compiler_error : def int_nvvm_compiler_warn : Intrinsic<[], [llvm_anyptr_ty], [], "llvm.nvvm.compiler.warn">; -def int_nvvm_reflect : - Intrinsic<[llvm_i32_ty], [llvm_anyptr_ty], [IntrNoMem], "llvm.nvvm.reflect">; +def int_nvvm_reflect

[clang] [llvm] [NVPTX] Add clang builtin for `__nvvm_reflect` intrinsic (PR #81277)

2024-02-09 Thread Joseph Huber via cfe-commits
@@ -1624,8 +1624,9 @@ def int_nvvm_compiler_error : def int_nvvm_compiler_warn : Intrinsic<[], [llvm_anyptr_ty], [], "llvm.nvvm.compiler.warn">; -def int_nvvm_reflect : - Intrinsic<[llvm_i32_ty], [llvm_anyptr_ty], [IntrNoMem], "llvm.nvvm.reflect">; +def int_nvvm_reflect

[clang] [llvm] [NVPTX] Add clang builtin for `__nvvm_reflect` intrinsic (PR #81277)

2024-02-09 Thread Joseph Huber via cfe-commits
@@ -159,6 +159,7 @@ BUILTIN(__nvvm_read_ptx_sreg_pm3, "i", "n") BUILTIN(__nvvm_prmt, "UiUiUiUi", "") BUILTIN(__nvvm_exit, "v", "r") +BUILTIN(__nvvm_reflect, "UicC*", "r") jhuber6 wrote: It's in the `NVPTXUsage.rst`, and

[clang] [llvm] [NVPTX] Add clang builtin for `__nvvm_reflect` intrinsic (PR #81277)

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

[clang] [llvm] [NVPTX] Add clang builtin for `__nvvm_reflect` intrinsic (PR #81277)

2024-02-09 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/81277 Summary: Some recent support made usage of `__nvvm_reflect` more consistent. We should expose it as an intrinsic rather than forcing users to externally define the function. >From

[clang] [llvm] [LinkerWrapper] Allow 'all' as a generic bundled architecture (PR #81193)

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

[clang] [llvm] [LinkerWrapper] Allow 'all' as a generic bundled architecture (PR #81193)

2024-02-08 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/81193 Summary: Currently, the linker wrapper sourts input files into different link jobs according to their architectures. Here we assume each architecture is a unique and incompatible link job unless they are

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,698 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// 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:

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,698 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// 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:

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,698 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// 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:

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,698 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// 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:

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,698 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// 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:

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,698 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// 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:

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,698 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// 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:

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,698 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// 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:

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: Some more comments https://github.com/llvm/llvm-project/pull/81058 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

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

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,716 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// 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:

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,716 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// 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:

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,716 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// 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:

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,716 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// 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:

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,716 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// 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:

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: Thanks for working on this. A few quick nits, overall looks like lots of straightforward testing with a beefy new pass. https://github.com/llvm/llvm-project/pull/81058 ___ cfe-commits mailing list

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

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

[clang] [llvm] [NVPTX][Draft] Make `__nvvm_nanosleep` a no-op if unsupported (PR #81033)

2024-02-07 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Okay, `__nvvm_reflect` doesn't work fully here because the `nanosleep` builtin I added requires `sm_70` at the clang level. Either means I'd need to go back to inline assembly or remove that requirement at least from clang so it's a backend failure.

[clang] [llvm] [NVPTX][Draft] Make `__nvvm_nanosleep` a no-op if unsupported (PR #81033)

2024-02-07 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > This patch, which simply makes it legal on all architectures but do nothing > > is it's older than sm_70. > > I do not think this is the right thing to do. "do nothing" is not what one > would expect from a `nanosleep`. Thanks, I made this a draft because I figured it

[clang] [llvm] [NVPTX][Draft] Make `__nvvm_nanosleep` a no-op if unsupported (PR #81033)

2024-02-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/81033 Summary; The LLVM C library currently uses `nanosleep` in the RPC interface and for the C library `nanosleep` function. We build the LLVM C library for every single NVPTX architecture individually currently,

[clang] [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (PR #81015)

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

[clang] [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (PR #81015)

2024-02-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81015 >From ed6b669d7d427f2cb4d87f9d4a8063e1b919fc03 Mon Sep 17 00:00:00 2001 From: Sh0g0-1758 Date: Wed, 7 Feb 2024 21:11:58 +0530 Subject: [PATCH 1/5] Add a Null Check --- clang/lib/Sema/SemaOpenMP.cpp | 2 ++ 1

[clang] [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (PR #81015)

2024-02-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81015 >From c8ada809964eac64f6cb0c103593748b86932163 Mon Sep 17 00:00:00 2001 From: Sh0g0-1758 Date: Wed, 7 Feb 2024 21:11:58 +0530 Subject: [PATCH 1/5] Add a Null Check --- clang/lib/Sema/SemaOpenMP.cpp | 2 ++ 1

[clang] 347ab99 - [Clang][Docs] Fix trailing whitespace warnings

2024-02-07 Thread Joseph Huber via cfe-commits
Author: Joseph Huber Date: 2024-02-07T13:03:31-06:00 New Revision: 347ab99a5c6d096beb7378794c6255dca2a866e6 URL: https://github.com/llvm/llvm-project/commit/347ab99a5c6d096beb7378794c6255dca2a866e6 DIFF: https://github.com/llvm/llvm-project/commit/347ab99a5c6d096beb7378794c6255dca2a866e6.diff

[clang] [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (PR #81015)

2024-02-07 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > The build is failing because of a formatting error which I don't think is > related to the changes that I made. Any thoughts as to why it is failing? That's unrelated, I'll fix it. https://github.com/llvm/llvm-project/pull/81015 ___

[clang] [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (PR #81015)

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

[clang] [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (PR #81015)

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

[clang] [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (PR #81015)

2024-02-07 Thread Joseph Huber via cfe-commits
@@ -21124,6 +21124,8 @@ Sema::ActOnOpenMPDependClause(const OMPDependClause::DependDataTy , ExprTy = ATy->getElementType(); else ExprTy = BaseType->getPointeeType(); +if (ExprTy.isNull()) + continue;

[clang] [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (PR #81015)

2024-02-07 Thread Joseph Huber via cfe-commits
jhuber6 wrote: I'll merge it for you once the CI builder finishes without issue, thanks. https://github.com/llvm/llvm-project/pull/81015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][OpenMP] Fix `!isNull() && "Cannot retrieve a NULL type pointer"' fail. (PR #81015)

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

[clang] [llvm] [LinkerWrapper] Support relocatable linking for offloading (PR #80066)

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

[clang] [llvm] [LinkerWrapper] Support relocatable linking for offloading (PR #80066)

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

[clang] [AMDGPU] Add missing `__builtin_amdgcn_wavefrontsize` builtin (PR #80741)

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

[clang] [AMDGPU] Add missing `__builtin_amdgcn_wavefrontsize` builtin (PR #80741)

2024-02-05 Thread Joseph Huber via cfe-commits
@@ -832,6 +832,13 @@ void test_atomic_inc_dec(local uint *lptr, global uint *gptr, uint val) { res = __builtin_amdgcn_atomic_dec32((volatile global uint*)gptr, val, __ATOMIC_SEQ_CST, ""); } +// CHECK-LABEL test_wavefrontsize( +unsigned test_wavefrontsize() {

[clang] [AMDGPU] Add missing `__builtin_amdgcn_wavefrontsize` builtin (PR #80741)

2024-02-05 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/80741 Summary: The backend supports the wavefrontsize intrinsic, and suggests that it is tied to a corresponding clang builtin, but it is not actually present. This simply adds it in so it can be used from clang. This

[mlir] [clang] [llvm] [openmp] [OpenMP] Remove `register_requires` global constructor (PR #80460)

2024-02-05 Thread Joseph Huber via cfe-commits
@@ -6872,35 +6883,6 @@ void OpenMPIRBuilder::loadOffloadInfoMetadata(StringRef HostFilePath) { loadOffloadInfoMetadata(*M.get()); } -Function *OpenMPIRBuilder::createRegisterRequires(StringRef Name) { jhuber6 wrote: It was a very obvious problem. I mixed

[clang] d172286 - [Clang] Make AMDGPU OpenCL tests require AMD registered target

2024-02-05 Thread Joseph Huber via cfe-commits
Author: Joseph Huber Date: 2024-02-05T09:08:31-06:00 New Revision: d1722868d34a69df8466b72098176f54a7af8823 URL: https://github.com/llvm/llvm-project/commit/d1722868d34a69df8466b72098176f54a7af8823 DIFF: https://github.com/llvm/llvm-project/commit/d1722868d34a69df8466b72098176f54a7af8823.diff

[clang] [AMDGPU] Allow w64 ballot to be used on w32 targets (PR #80183)

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

[llvm] [openmp] [clang] [mlir] [OpenMP] Remove `register_requires` global constructor (PR #80460)

2024-02-05 Thread Joseph Huber via cfe-commits
@@ -6872,35 +6883,6 @@ void OpenMPIRBuilder::loadOffloadInfoMetadata(StringRef HostFilePath) { loadOffloadInfoMetadata(*M.get()); } -Function *OpenMPIRBuilder::createRegisterRequires(StringRef Name) { jhuber6 wrote: I encoded the fact that this is a

[clang] [llvm] [openmp] [mlir] [OpenMP] Remove `register_requires` global constructor (PR #80460)

2024-02-05 Thread Joseph Huber via cfe-commits
@@ -6872,35 +6883,6 @@ void OpenMPIRBuilder::loadOffloadInfoMetadata(StringRef HostFilePath) { loadOffloadInfoMetadata(*M.get()); } -Function *OpenMPIRBuilder::createRegisterRequires(StringRef Name) { jhuber6 wrote: That looks a little weird, the `i32`

[openmp] [clang] [llvm] [OpenMP] Remove `register_requires` global constructor (PR #80460)

2024-02-05 Thread Joseph Huber via cfe-commits
@@ -6872,35 +6883,6 @@ void OpenMPIRBuilder::loadOffloadInfoMetadata(StringRef HostFilePath) { loadOffloadInfoMetadata(*M.get()); } -Function *OpenMPIRBuilder::createRegisterRequires(StringRef Name) { jhuber6 wrote: Thanks for the heads up. Do you know if

[openmp] [clang] [llvm] [OpenMP] Remove `register_requires` global constructor (PR #80460)

2024-02-02 Thread Joseph Huber via cfe-commits
@@ -199,7 +199,7 @@ static int initLibrary(DeviceTy ) { Entry.size) != OFFLOAD_SUCCESS) REPORT("Failed to write symbol for USM %s\n", Entry.name); } -} else { +} else if (Entry.addr) {

[openmp] [clang] [llvm] [OpenMP] Remove `register_requires` global constructor (PR #80460)

2024-02-02 Thread Joseph Huber via cfe-commits
@@ -199,7 +199,7 @@ static int initLibrary(DeviceTy ) { Entry.size) != OFFLOAD_SUCCESS) REPORT("Failed to write symbol for USM %s\n", Entry.name); } -} else { +} else if (Entry.addr) {

[llvm] [openmp] [clang] [OpenMP] Remove `register_requires` global constructor (PR #80460)

2024-02-02 Thread Joseph Huber via cfe-commits
@@ -199,7 +199,7 @@ static int initLibrary(DeviceTy ) { Entry.size) != OFFLOAD_SUCCESS) REPORT("Failed to write symbol for USM %s\n", Entry.name); } -} else { +} else if (Entry.addr) {

[llvm] [openmp] [clang] [OpenMP] Remove `register_requires` global constructor (PR #80460)

2024-02-02 Thread Joseph Huber via cfe-commits
@@ -199,7 +199,7 @@ static int initLibrary(DeviceTy ) { Entry.size) != OFFLOAD_SUCCESS) REPORT("Failed to write symbol for USM %s\n", Entry.name); } -} else { +} else if (Entry.addr) {

[clang] [AMDGPU] Allow w64 ballot to be used on w32 targets (PR #80183)

2024-02-01 Thread Joseph Huber via cfe-commits
@@ -4,13 +4,10 @@ // RUN: %clang_cc1 -triple amdgcn-- -target-cpu gfx1010 -target-feature -wavefrontsize64 -verify -S -o - %s // RUN: %clang_cc1 -triple amdgcn-- -target-cpu gfx1010 -verify -S -o - %s +// expected-no-diagnostics + typedef unsigned long ulong; void

[clang] [AMDGPU] Allow w64 ballot to be used on w32 targets (PR #80183)

2024-02-01 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/80183 >From 26b75cdba1aebc881e52dc82ca61e1082ef67a5e Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 31 Jan 2024 13:18:04 -0600 Subject: [PATCH] [AMDGPU] Allow w64 ballot to be used on w32 targets Summary:

[clang] [AMDGPU] Allow w64 ballot to be used on w32 targets (PR #80183)

2024-02-01 Thread Joseph Huber via cfe-commits
@@ -4,13 +4,10 @@ // RUN: %clang_cc1 -triple amdgcn-- -target-cpu gfx1010 -target-feature -wavefrontsize64 -verify -S -o - %s // RUN: %clang_cc1 -triple amdgcn-- -target-cpu gfx1010 -verify -S -o - %s +// expected-no-diagnostics + typedef unsigned long ulong; void

[clang] [AMDGPU] Allow w64 ballot to be used on w32 targets (PR #80183)

2024-02-01 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > After this change is there any value in having two different builtins? You > could just have one that always return 64 bits. I personally think it would be better to just have the one, but I figured that decision was made earlier and it would break backwards compatibility.

[clang] [HIP] fix HIP detection for /usr (PR #80190)

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

[clang] [AMDGPU] Allow w64 ballot to be used on w32 targets (PR #80183)

2024-01-31 Thread Joseph Huber via cfe-commits
@@ -151,7 +151,7 @@ BUILTIN(__builtin_amdgcn_mqsad_u32_u8, "V4UiWUiUiV4Ui", "nc") //===--===// TARGET_BUILTIN(__builtin_amdgcn_ballot_w32, "ZUib", "nc", "wavefrontsize32")

[clang] [AMDGPU] Allow w64 ballot to be used on w32 targets (PR #80183)

2024-01-31 Thread Joseph Huber via cfe-commits
@@ -151,7 +151,7 @@ BUILTIN(__builtin_amdgcn_mqsad_u32_u8, "V4UiWUiUiV4Ui", "nc") //===--===// TARGET_BUILTIN(__builtin_amdgcn_ballot_w32, "ZUib", "nc", "wavefrontsize32")

[llvm] [clang] [LinkerWrapper] Support relocatable linking for offloading (PR #80066)

2024-01-31 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/80066 >From af382e03e41ef679c35a6126a1b131a7a8a28360 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 30 Jan 2024 15:34:22 -0600 Subject: [PATCH 1/5] [LinkerWrapper] Support relocatable linking for offloading

[llvm] [clang] [LinkerWrapper] Support relocatable linking for offloading (PR #80066)

2024-01-31 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/80066 >From af382e03e41ef679c35a6126a1b131a7a8a28360 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 30 Jan 2024 15:34:22 -0600 Subject: [PATCH 1/4] [LinkerWrapper] Support relocatable linking for offloading

[clang] [HIP] fix HIP detection for /usr (PR #80190)

2024-01-31 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. Do we have any tests for this kind of stuff? We really should have some mock ROCm installation in one of the `Inputs/` directories and then do `--rocm-path=` or something. https://github.com/llvm/llvm-project/pull/80190

[clang] [llvm] [LinkerWrapper] Support relocatable linking for offloading (PR #80066)

2024-01-31 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > the idea is that it would be the desired effect if someone went out of > > their way to do this GPU subset linking thing. > > That would only be true when someone owns the whole build. That will not be > the case in practice. A large enough project is usually a bunch of

[clang] [AMDGPU] Allow w64 ballot to be used on w32 targets (PR #80183)

2024-01-31 Thread Joseph Huber via cfe-commits
@@ -151,7 +151,7 @@ BUILTIN(__builtin_amdgcn_mqsad_u32_u8, "V4UiWUiUiV4Ui", "nc") //===--===// TARGET_BUILTIN(__builtin_amdgcn_ballot_w32, "ZUib", "nc", "wavefrontsize32")

[clang] [llvm] [LinkerWrapper] Support relocatable linking for offloading (PR #80066)

2024-01-31 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > I'm assuming you're talking about GPU-side constructors? I don't think the > > CUDA runtime supports those, but OpenMP runs them when the image is loaded, > > so it would handle both independantly. > > Yes. I'm thinking of the expectations from a C++ user standpoint, and

[clang] [AMDGPU] Allow w64 ballot to be used on w32 targets (PR #80183)

2024-01-31 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/80183 Summary: Currently we cannot compile `__builtin_amdgcn_ballot_w64` on non-wave64 targets even though it is valid. This is relevant for making library code that can handle both without needing to check the

[llvm] [clang] [LinkerWrapper] Support relocatable linking for offloading (PR #80066)

2024-01-31 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Supporting such mixed mode opens an interesting set of issues we may need to > consider going forward: > > who/where/how runs initializers in the fully linked parts? I'm assuming you're talking about GPU-side constructors? I don't think the CUDA runtime supports those, but

[clang] [llvm] [LinkerWrapper] Support relocatable linking for offloading (PR #80066)

2024-01-31 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/80066 >From af382e03e41ef679c35a6126a1b131a7a8a28360 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 30 Jan 2024 15:34:22 -0600 Subject: [PATCH 1/3] [LinkerWrapper] Support relocatable linking for offloading

[llvm] [clang] [LinkerWrapper] Support relocatable linking for offloading (PR #80066)

2024-01-31 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/80066 >From af382e03e41ef679c35a6126a1b131a7a8a28360 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 30 Jan 2024 15:34:22 -0600 Subject: [PATCH 1/2] [LinkerWrapper] Support relocatable linking for offloading

[llvm] [clang] [LinkerWrapper] Support relocatable linking for offloading (PR #80066)

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

[llvm] [clang] [LinkerWrapper] Support relocatable linking for offloading (PR #80066)

2024-01-31 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > So, the idea is to carry two separate embedded offloading sections -- one for > already fully linked GPU executables, and another for GPU objects to be > linked at the final link stage. > It's more or less doing `-fno-gpu-rdc` on a subset of files. So you can do GPU linking

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