[clang] [llvm] [openmp] [PGO][OpenMP] Instrumentation for GPU devices (PR #76587)

2024-02-16 Thread Joseph Huber via cfe-commits
@@ -2067,6 +2067,10 @@ Constant *ConstantExpr::getBitCast(Constant *C, Type *DstTy, Constant *ConstantExpr::getAddrSpaceCast(Constant *C, Type *DstTy, bool OnlyIfReduced) { + // Skip cast if types are identical jhuber

[clang] [Clang] Add 'CLANG_ALLOW_IMPLICIT_RPATH' to enable toolchain use of -rpath (PR #82004)

2024-02-16 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Could we have the upstream default be to install a clang.cfg file in bin/ > which has -fimplicit-openmp-rpath (or whatever the hoption is)? Configuration files as far as I'm aware can't do toolchain / language specific stuff, so it's a little weaker than being able to just res

[clang] [libc] [llvm] [openmp] [libc] Rework the GPU build to be a regular target (PR #81921)

2024-02-16 Thread Joseph Huber via cfe-commits
@@ -135,86 +147,20 @@ function(_get_common_test_compile_options output_var flags) # list(APPEND compile_options "-Wglobal-constructors") # endif() endif() - if (LIBC_TARGET_ARCHITECTURE_IS_GPU) -# TODO: Set these flags -# list(APPEND compile_options "-nogp

[clang] [libc] [llvm] [openmp] [libc] Rework the GPU build to be a regular target (PR #81921)

2024-02-16 Thread Joseph Huber via cfe-commits
@@ -135,86 +147,20 @@ function(_get_common_test_compile_options output_var flags) # list(APPEND compile_options "-Wglobal-constructors") # endif() endif() - if (LIBC_TARGET_ARCHITECTURE_IS_GPU) -# TODO: Set these flags -# list(APPEND compile_options "-nogp

[clang] [Clang] Add 'CLANG_ALLOW_IMPLICIT_RPATH' to enable toolchain use of -rpath (PR #82004)

2024-02-16 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > I believe right now the `rtlib-rpath` points to the path > > `${CLANG_BINARY}../lib/${HOST_TRIPLE}/`. I think it's definitely reasonable > > to not put this on system libraries if that's a solution, since we can > > generally assume it's a global installation and already cov

[clang] [Clang] Add 'CLANG_ALLOW_IMPLICIT_RPATH' to enable toolchain use of -rpath (PR #82004)

2024-02-16 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > We could make this logic more complicated by checking the system > > automatically `execute_command(lsb_release)` or something. > > I think this is too complicated and fragile. If we want to do something > specifically to support the distro use case, I think we should do thi

[clang] [Clang] Add 'CLANG_ALLOW_IMPLICIT_RPATH' to enable toolchain use of -rpath (PR #82004)

2024-02-16 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > Does Fedora only use default configurations when building its packages? > > We try to stick to the defaults as much as possible. Having an implicit rpath > by default causes issues when building other RPMs with clang, and typically, > if we need to change something in order

[clang] [Clang] Add 'CLANG_ALLOW_IMPLICIT_RPATH' to enable toolchain use of -rpath (PR #82004)

2024-02-16 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > I don't think a CMake option is the right way to go here. For example, I > doubt we would actually use this CMake option in Fedora if this patch is > committed. Does Fedora only use default configurations when building its packages? > Does gcc use rpath for libgomp? That's i

[clang] [Clang] Add 'CLANG_ALLOW_IMPLICIT_RPATH' to enable toolchain use of -rpath (PR #82004)

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

[clang] [Clang] Add 'CLANG_ALLOW_IMPLICIT_RPATH' to enable toolchain use of -rpath (PR #82004)

2024-02-16 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/82004 Summary: The original discussion in https://reviews.llvm.org/D118493 was that `clang` should not be adding `-rpath` implicitly for toolchains. The main motivation behind that change was the 'Fedora' toolchain disa

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

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

[clang] [libc] [llvm] [openmp] [libc] Rework the GPU build to be a regular target (PR #81921)

2024-02-15 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81921 >From 3c4a7ea70941fbf3c8a47c0715423ae38cc25a68 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 13 Feb 2024 21:08:02 -0600 Subject: [PATCH] [libc] Rework the GPU build to be a regular target Summary: This

[clang] [libc] [llvm] [openmp] [libc] Rework the GPU build to be a regular target (PR #81921)

2024-02-15 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81921 >From d0f782f4db249f6be08dba5060ee403974c95fdf Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 13 Feb 2024 21:08:02 -0600 Subject: [PATCH] [libc] Rework the GPU build to be a regular target Summary: This

[clang] [libc] [llvm] [openmp] [libc] Rework the GPU build to be a regular target (PR #81921)

2024-02-15 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81921 >From caf0ee274f353b6adb23c455121ec2102c260de0 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 13 Feb 2024 21:08:02 -0600 Subject: [PATCH] [libc] Rework the GPU build to be a regular target Summary: This

[clang] [libc] [llvm] [openmp] [libc] Rework the GPU build to be a regular target (PR #81921)

2024-02-15 Thread Joseph Huber via cfe-commits
@@ -1,12 +1,9 @@ set(libc_archive_targets "") + list(APPEND added_archive_targets ${archive_1}) jhuber6 wrote: Don't know how that got there, I'll fix it. https://github.com/llvm/llvm-project/pull/81921 ___ cfe-commi

[clang] [libc] [llvm] [openmp] [libc] Rework the GPU build to be a regular target (PR #81921)

2024-02-15 Thread Joseph Huber via cfe-commits
@@ -533,15 +542,14 @@ endfunction(add_integration_test) set(LIBC_HERMETIC_TEST_COMPILE_OPTIONS ${LIBC_COMPILE_OPTIONS_DEFAULT} jhuber6 wrote: Yeah there's a lot of logic that's moved and broken after rebasing. Trying to figure out what's changed. https://githu

[clang] [libc] [llvm] [openmp] [libc] Rework the GPU build to be a regular target (PR #81921)

2024-02-15 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81921 >From 613402be5f027c7f5494513772d0f17dd046a3e8 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 13 Feb 2024 21:08:02 -0600 Subject: [PATCH] [libc] Rework the GPU build to be a regular target Summary: This

[clang] [libc] [llvm] [openmp] [libc] Rework the GPU build to be a regular target (PR #81921)

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

[clang] [libc] [llvm] [openmp] [libc] Rework the GPU build to be a regular target (PR #81921)

2024-02-15 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/81921 >From 5fdaa384ebc962429950b79098dee0581c74f4f3 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 13 Feb 2024 21:08:02 -0600 Subject: [PATCH] [libc] Rework the GPU build to be a regular target Summary: This

[clang] [libc] [llvm] [openmp] [libc] Rework the GPU build to be a regular target (PR #81921)

2024-02-15 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/81921 Summary: This is a massive patch because it reworks the entire build and everything that depends on it. This is not split up because various bots would fail otherwise. I will attempt to describe the necessary chan

[clang] fa9e297 - [ClangPackager] Fix passing in multiple instances of `file`

2024-02-14 Thread Joseph Huber via cfe-commits
Author: Joseph Huber Date: 2024-02-14T22:11:21-06:00 New Revision: fa9e297b8b63dacb962d99814e698658ad71f946 URL: https://github.com/llvm/llvm-project/commit/fa9e297b8b63dacb962d99814e698658ad71f946 DIFF: https://github.com/llvm/llvm-project/commit/fa9e297b8b63dacb962d99814e698658ad71f946.diff

[clang] [HIP] Allow partial linking for `-fgpu-rdc` (PR #81700)

2024-02-14 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: This makes sense overall, though it's very complicated. Generally we just need to make sure these things are private to one group of files. There's a lot more to parse here compared to the `linker-wrapper`. Do any of these tests check when called with `-r`

[clang] [clang][CodeGen] Shift relink option implementation away from module cloning (PR #81693)

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

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

2024-02-13 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed 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_readsteadycounter` intrinsic and builtin for realtime clocks (PR #81331)

2024-02-12 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Add to release notes? Done 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_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 4a0ee4be9690e0665ca93d63ffdd2dea404fd72d Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 9 Feb 2024 16:13:42 -0600 Subject: [PATCH] [LLVM] Add `__builtin_readsteadycounter` intrinsic and buiiltin S

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

2024-02-12 Thread Joseph Huber via cfe-commits
@@ -104,6 +104,7 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const { case ISD::ATOMIC_STORE: return "AtomicStore"; case ISD::PCMARKER: return "PCMarker"; case ISD::READCYCLECOUNTER: return "ReadCycleCounter"; +

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

2024-02-12 Thread Joseph Huber via cfe-commits
@@ -2764,6 +2764,37 @@ Query for this feature with ``__has_builtin(__builtin_readcyclecounter)``. Note that even if present, its use may depend on run-time privilege or other OS controlled state. +``__builtin_readsteadycounter`` +-- + +``__builtin_

[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 50c0bacb8c33ff0c3caf5554bd198904839a2d2c 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 buiilt

[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. https://en.cppreference

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

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

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

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

[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 cfe-commits@lists.llvm

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

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

[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`? https://github.com/llvm/ll

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

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

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

[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: Okay,

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

[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 https://github.com/llvm/llvm-project/p

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

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

[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: Apache

[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: Apache

[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: Apache

[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: Apache

[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: Apache

[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: Apache

[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: Apache

[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: Apache

[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: Apache

[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: Apache

[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: Apache

[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: Apache

[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: Apache

[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 cfe-commits@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. https://github.com/llvm/llvm

[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 wasn'

[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, which

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

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

[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 &Data, 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 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 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 a

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