[clang] [Clang][OpenCL] Fix Missing `-fdeclare-opencl-builtins` When Using `--save-temps` (PR #131017)

2025-03-12 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. Makes sense, though I don't know why we have a special flag for what is essentially a header. https://github.com/llvm/llvm-project/pull/131017 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [libc][nfc] Include instantiations of gpuintrin.h in IR test case (PR #130956)

2025-03-12 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. Fine way to show the intrinsics that this generates. I originally kept it brief since I just assumed those were tested elsewhere. https://github.com/llvm/llvm-project/pull/130956 ___ cfe-commits m

[clang] [libc][nfc] Use common implementation of read_first_lane_u64 (PR #131027)

2025-03-12 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. This means that `nvptxintrin.h` and `amdgpuintrin.h` can't be included standalone, but I'm not sure it's a big deal since we already define a lot of the common functionality in the `gpurintrin.h` header. https://github.com/llvm/llvm-projec

[clang] [clang][NFCI] Fix getGridValues for unsupported targets (PR #131023)

2025-03-12 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. https://github.com/llvm/llvm-project/pull/131023 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][OpenCL] Fix Missing `-fdeclare-opencl-builtins` When Using `--save-temps` (PR #131017)

2025-03-12 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Yeah these are implemented in bitcode file, therefore it needs the front end > to be able to recognize it instead of treating it as an unknown symbol. In a normal world they would just be in a header and then the library would get linked in later. https://github.com/llvm/llvm

[clang] [llvm] [OpenMP] Remove 'libomptarget.devicertl.a' fatbinary and use static library (PR #126143)

2025-02-13 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/126143 >From 43bb8a63bf008bf08bae03e4e64cf76e32e77ea5 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 6 Feb 2025 15:54:19 -0600 Subject: [PATCH] [OpenMP] Remove 'libomptarget.devicertl.a' fatbinary and use stat

[clang] [llvm] [OpenMP] Remove 'libomptarget.devicertl.a' fatbinary and use static library (PR #126143)

2025-02-13 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/126143 >From 923b58bec55e1956b1ef9379cb1053e060bcb2e4 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 6 Feb 2025 15:54:19 -0600 Subject: [PATCH] [OpenMP] Remove 'libomptarget.devicertl.a' fatbinary and use stat

[clang] [Clang] Disable RTTI for offloading at the frontend level (PR #127082)

2025-02-13 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/127082 Summary: Currently we force this to be off in `-cc1`, but I feel like this should be something the driver informs the compiler of. It's not *inconcievable* that RTTI might 'work' on the GPU some day, but mostly I

[clang] [Clang] Disable RTTI for offloading at the frontend level (PR #127082)

2025-02-13 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/127082 >From 508e938558ac3fb73f0e5389da362b18bef56ce0 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 13 Feb 2025 09:27:24 -0600 Subject: [PATCH] [Clang] Disable RTTI for offloading at the frontend level Summar

[clang] [Clang] Disable RTTI for offloading at the frontend level (PR #127082)

2025-02-13 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/127082 >From 337ac857a8139eb0ee24effba0fa1d8fa8eaca28 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 13 Feb 2025 09:27:24 -0600 Subject: [PATCH] [Clang] Disable RTTI for offloading at the frontend level Summar

[clang] [Clang] Disable RTTI for offloading at the frontend level (PR #127082)

2025-02-13 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/127082 >From 1484f19a1b959981b89187cc0edc7bc370427fe3 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 13 Feb 2025 09:27:24 -0600 Subject: [PATCH] [Clang] Disable RTTI for offloading at the frontend level Summar

[clang] [Clang] Disable RTTI for offloading at the frontend level (PR #127082)

2025-02-13 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/127082 >From b17f35541bb5de23389afe0af61cda2cac749e81 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 13 Feb 2025 09:27:24 -0600 Subject: [PATCH] [Clang] Disable RTTI for offloading at the frontend level Summar

[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

2025-02-14 Thread Joseph Huber via cfe-commits
jhuber6 wrote: @AlexVlx I found this breaks my clang build, reduced the C++ source to the following reproducer https://godbolt.org/z/jGnvKeqvr. Please verify that it breaks for you as well and revert or fix. https://github.com/llvm/llvm-project/pull/114062 _

[clang] [Clang][Docs] Document -Xarch_ better (PR #127890)

2025-02-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/127890 >From d5efc8e10fabb0f2258e0bf5d2e4ce9c0686b911 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 19 Feb 2025 14:01:56 -0600 Subject: [PATCH 1/4] [Clang][Docs] Document -Xarch_ better Summary: This argument

[clang] [Clang][Docs] Document -Xarch_ better (PR #127890)

2025-02-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/127890 >From d5efc8e10fabb0f2258e0bf5d2e4ce9c0686b911 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 19 Feb 2025 14:01:56 -0600 Subject: [PATCH 1/2] [Clang][Docs] Document -Xarch_ better Summary: This argument

[clang] [Clang][Docs] Document -Xarch_ better (PR #127890)

2025-02-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/127890 >From d5efc8e10fabb0f2258e0bf5d2e4ce9c0686b911 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 19 Feb 2025 14:01:56 -0600 Subject: [PATCH 1/3] [Clang][Docs] Document -Xarch_ better Summary: This argument

[clang] [libc] [Clang] Fix cross-lane scan when given divergent lanes (PR #127703)

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

[clang] [Clang][Docs] Document -Xarch_ better (PR #127890)

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

[clang] [Clang][Docs] Document -Xarch_ better (PR #127890)

2025-02-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/127890 Summary: This argument is esoteric and previously didn't even work consistently across the targets. Now that's fixed we should document it better. >From a7be26f70a9ba9a381e91b4c6257dc173444c6ef Mon Sep 17 00:00

[clang] [Clang][Docs] Document -Xarch_ better (PR #127890)

2025-02-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/127890 >From d5efc8e10fabb0f2258e0bf5d2e4ce9c0686b911 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 19 Feb 2025 14:01:56 -0600 Subject: [PATCH] [Clang][Docs] Document -Xarch_ better Summary: This argument is

[clang] [Clang][Docs] Document -Xarch_ better (PR #127890)

2025-02-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/127890 >From d5efc8e10fabb0f2258e0bf5d2e4ce9c0686b911 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 19 Feb 2025 14:01:56 -0600 Subject: [PATCH 1/5] [Clang][Docs] Document -Xarch_ better Summary: This argument

[clang] [OpenMP] Silently accept `neon_vector_type` for the offloading device (PR #127439)

2025-02-19 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > While I was working on the tests, I realised I can no longer replicate this > issue in main. I guess it got fixed by someone, somewhere. I'm gonna close > this now. I'm not aware of any changes in this area, but if it doesn't fail anymore I guess that's fine. https://github.

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-21 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > As for next steps, I think we need a broader community discussion on this, so > I would recommend an RFC proposing an approach. I don't know whether that's > changing the behavior of `__has_builtin`, proposing `__can_use_builtin` and > deprecating `__has_builtin`, or something

[clang] [Clang][ARM] Only try to redefine builtins for non-CUDA (PR #128222)

2025-02-21 Thread Joseph Huber via cfe-commits
@@ -27,6 +27,8 @@ extern "C" { #endif +#if !defined(__CUDA__) jhuber6 wrote: We'd want this to compile for the CUDA host, you should be able to check `__CUDA_ARCH__` for the CUDA device only. https://github.com/llvm/llvm-project/pull/128222

[clang] [Clang][ARM] Only try to redefine builtins for non-CUDA (PR #128222)

2025-02-21 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. Maybe a comment for why we need to check for the CUDA arch, but I'll defer to @Artem-B for the final +1. https://github.com/llvm/llvm-project/pull/128222 ___ cfe-commits mailing list cfe-commits@l

[clang] [clang][CodeGen] Additional fixes for #114062 (PR #128166)

2025-02-21 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,38 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --include-generated-funcs --version 5 +// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-t

[clang] [clang][CodeGen] Additional fixes for #114062 (PR #128166)

2025-02-21 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,38 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --include-generated-funcs --version 5 +// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-t

[clang] [libc] [Clang] Fix cross-lane scan when given divergent lanes (PR #127703)

2025-02-20 Thread Joseph Huber via cfe-commits
jhuber6 wrote: /cherry-pick https://github.com/llvm/llvm-project/commit/6cc7ca084a5bbb7ccf606cab12065604453dde59 https://github.com/llvm/llvm-project/pull/127703 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [spirv][amdgpu] Set atomic size in the clang target info (PR #128569)

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

[clang] [libc] [lld] [llvm] Ugly example of building libc to spirv (PR #128585)

2025-02-24 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > @JonChesterfield even if you distinguish spirv64 from amdgpu in cmake clang > doesn't make that distinction. A common pattern for spriv64 is to return null > if its not AMDGPU. General question, what's the expected way to access things like thread IDs and such from SPIR-V? Th

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-20 Thread Joseph Huber via cfe-commits
jhuber6 wrote: I'd vote for fixing the CUDA on Arm case that failed in the meantime, then make a decision as to whether or not we should go back to `__has_builtin` only returning the current compilation target once that's gone. https://github.com/llvm/llvm-project/pull/126324 _

[clang] [Clang][Docs] Document -Xarch_ better (PR #127890)

2025-02-19 Thread Joseph Huber via cfe-commits
@@ -932,9 +932,18 @@ def W_Joined : Joined<["-"], "W">, Group, def Xanalyzer : Separate<["-"], "Xanalyzer">, HelpText<"Pass to the static analyzer">, MetaVarName<"">, Group; -def Xarch__ : JoinedAndSeparate<["-"], "Xarch_">, Flags<[NoXarchOption]>, - HelpText<"Pass to th

[clang] [clang][CodeGen] Additional fixes for #114062 (PR #128166)

2025-02-25 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. I think it's reasonable and we should probably get this in before the release window. https://github.com/llvm/llvm-project/pull/128166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [clang][CodeGen] Additional fixes for #114062 (PR #128166)

2025-02-25 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 milestoned https://github.com/llvm/llvm-project/pull/128166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Improve diagnostics for vector builtins (PR #125673)

2025-02-25 Thread Joseph Huber via cfe-commits
@@ -2266,8 +2266,10 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { if (CheckVectorElementCallArgs(&SemaRef, TheCall)) return true; if (SemaRef.BuiltinElementwiseTernaryMath( -TheCall, /*CheckForFloatArgs*/ -

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-03-31 Thread Joseph Huber via cfe-commits
@@ -515,17 +515,19 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, // // 1. On Linux, link only when actually needed. // - // 2. Prefer libm functions over libamath. + // 2. Prefer libm functions over libamath (when

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-03-31 Thread Joseph Huber via cfe-commits
@@ -116,11 +116,17 @@ /// Verify that vectorized routines library is being linked in. // RUN: %clang -### --target=aarch64-pc-windows-msvc -fveclib=ArmPL %s 2>&1 | FileCheck --check-prefix=CHECK-LINKING-ARMPL-MSVC %s // RUN: %clang -### --target=aarch64-linux-gnu -fveclib=ArmP

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-03-31 Thread Joseph Huber via cfe-commits
@@ -515,17 +515,19 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, // // 1. On Linux, link only when actually needed. // - // 2. Prefer libm functions over libamath. + // 2. Prefer libm functions over libamath (when

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-03-31 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. I guessing we pass `-lm` twice here to work around `ld.bfd` not handling static libraries in a pleasant way? https://github.com/llvm/llvm-project/pull/133578 ___ cfe-commits mailing list cfe-commi

[clang] [HIP] use offload wrapper for non-device-only non-rdc (PR #132869)

2025-04-04 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: So, the main benefit of this is that is can parallelize the linker jobs? Doing that requires a special flag passed to the linker wrapper. https://github.com/llvm/llvm-project/pull/132869 ___ cfe-commits mailing li

[clang] [clang-sycl-linker] Replace llvm-link with API calls (PR #133797)

2025-04-04 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: Shouldn't we be able to just use LTO after the SPIR-V backend left experimental? https://github.com/llvm/llvm-project/pull/133797 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [llvm] [clang][OpenMP][SPIR-V] Fix addrspace of globals and global constants (PR #134399)

2025-04-04 Thread Joseph Huber via cfe-commits
@@ -5384,6 +5384,11 @@ LangAS CodeGenModule::GetGlobalVarAddressSpace(const VarDecl *D) { LangAS AS; if (OpenMPRuntime->hasAllocateAttributeForGlobalVar(D, AS)) return AS; +if (LangOpts.OpenMPIsTargetDevice && getTriple().isSPIRV()) jhuber6 w

[clang] [llvm] [clang][OpenMP][SPIR-V] Fix addrspace of globals and global constants (PR #134399)

2025-04-04 Thread Joseph Huber via cfe-commits
@@ -5384,6 +5384,11 @@ LangAS CodeGenModule::GetGlobalVarAddressSpace(const VarDecl *D) { LangAS AS; if (OpenMPRuntime->hasAllocateAttributeForGlobalVar(D, AS)) return AS; +if (LangOpts.OpenMPIsTargetDevice && getTriple().isSPIRV()) + // SPIR-V globals s

[clang] [Docs] Document freestanding requirements (PR #132232)

2025-04-04 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: I think this should be more specific on what `-ffreestanding` actually does. Namely, removed implicit search paths, link libraries, passes `-fno-builtin` and lets `int main` function as a normal function. For the `libc` side, I don't think this makes much

[clang] [Docs] Document freestanding requirements (PR #132232)

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

[clang] [Offload] Handle `BoundArchitecture` for non-GPU targets (PR #132037)

2025-03-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/132037 >From 181315ce22b47a9b75cd60f584dfbcf359659a11 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 19 Mar 2025 09:12:55 -0500 Subject: [PATCH 1/2] [Offload] Handle `BoundArchitecture` for non-GPU targets Sum

[clang] [NFC][clang] Split clang/lib/CodeGen/CGBuiltin.cpp into target-specific files (PR #132252)

2025-03-20 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. LG, thanks https://github.com/llvm/llvm-project/pull/132252 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][clang] Split clang/lib/CodeGen/CGBuiltin.cpp into target-specific files (PR #132252)

2025-03-20 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Seems something with AArch64 has made the CI unhappy as well. https://github.com/llvm/llvm-project/pull/132252 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PGO][Offload] Disable PGO on NVPTX (PR #133522)

2025-03-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. https://github.com/llvm/llvm-project/pull/133522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [flang] [libc] [libcxx] [llvm] [Clang][AMDGPU] Remove special handling for COV4 libraries (PR #132870)

2025-03-28 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/132870 >From e2bd8c7e4f741fa29f24bdee9073ccf4afecf381 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 24 Mar 2025 22:36:04 -0500 Subject: [PATCH] [Clang][AMDGPU] Remove special handling for COV4 libraries Summa

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-04-02 Thread Joseph Huber via cfe-commits
@@ -585,6 +597,23 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID, llvm::Value *Env = EmitScalarExpr(E->getArg(0)); return Builder.CreateCall(F, {Env}); } + case AMDGPU::BI__builtin_amdgcn_processor_is: { +assert(CGM.getTriple().isSPIRV() &&

[clang] [clang] Add SPIR-V to some OpenMP clang tests (PR #133503)

2025-04-02 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. Alright, LG. Unrelated, but it would be nice if someone who knows SPIR-V better could look at adding similar builtins for the ones we need to get it working through OpenMP. I've landed some merges that should make that work, but it seems t

[clang] [compiler-rt] [libc] [llvm] [Clang][AMDGPU] Remove special handling for COV4 libraries (PR #132870)

2025-03-25 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > I'm confused about where this leaves the device library build. It's still > using the none code object version flag, and IIRC it had a mix of its own > reimplementation of this plus use of some of the builtins. Hm, you're probably right that the ROCm DL was relying on the spli

[clang] [libc] [Clang] Make `--lto-partitions` only default for HIP (PR #133164)

2025-03-27 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/133164 >From 8c8885d486ac72145d7fd7ba003db7ea9ab17a1f Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 26 Mar 2025 16:03:20 -0500 Subject: [PATCH 1/3] [Clang] Make `--lto-partitions` only default for HIP Summary

[clang] [libc] [Clang] Make `--lto-partitions` only default for HIP (PR #133164)

2025-03-27 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/133164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AMDGPU] Remove outdated COV6 warning (PR #132814)

2025-03-25 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. https://github.com/llvm/llvm-project/pull/132814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-03-25 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 edited https://github.com/llvm/llvm-project/pull/129347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][clang] Split clang/lib/CodeGen/CGBuiltin.cpp into target-specific files (PR #132252)

2025-03-27 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Would it be ok if we prefixed all of these files in `TargetBuiltins` with CG? > #133199 > > Building using AppleClang seems to be upset that a cpp file with this name > already exists. I'm assuming its talking about all the files in > `clang/lib/Basic/Targets/`. For example t

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-04-02 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,64 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals all --version 5 +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -target-cpu gfx900 -emit-llvm %s -o - | FileCheck --check-prefix=AMDGCN-GFX900 %s +// RUN: %cla

[clang] [Offload] Handle `BoundArchitecture` for non-GPU targets (PR #132037)

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

[clang] [HIP] Claim `--offload-compress` for `-M` (PR #133456)

2025-04-04 Thread Joseph Huber via cfe-commits
@@ -1026,6 +1026,12 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, CmdArgs.push_back("-dependency-file"); CmdArgs.push_back(DepFile); } +// Cmake generates dependency files using all compilation options specified +// by user

[clang] [compiler-rt] [llvm] [PGO][Offload] Allow PGO flags to be used on GPU targets (PR #94268)

2025-04-04 Thread Joseph Huber via cfe-commits
jhuber6 wrote: I *really* wish someone from NVIDIA would just fix this stupid limitation already. @EthanLuisMcDonough This type of stuff shows up for things like this. Any way we can modify the source code to work around this? It's fine to put it in a separate global. ``` int arr[] = {1, arr[0

[clang] [CMAKE][AMDGPU] fix build failure caused by PR #133619 (PR #133776)

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

[clang] [CUDA] fix wrapper cmath header to match #136101 (PR #139164)

2025-05-12 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. Right now this checks for `libc++` less than 14. Is that still relevant following that change? https://github.com/llvm/llvm-project/pull/139164 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang] [CUDA] fix wrapper cmath header to match #136101 (PR #139164)

2025-05-12 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. https://github.com/llvm/llvm-project/pull/139164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP] Fix crash when diagnosing dist_schedule (PR #139277)

2025-05-09 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. https://github.com/llvm/llvm-project/pull/139277 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HIP] change default offload archs (PR #139281)

2025-05-09 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > @jhuber6 do you think can we use `native` instead? I think it would be a > somewhat better option here. If we have to choose a GPU variant by default, > we may as well choose the actual GPU, rather than a conditional choice > between generic SPIR-V or an old GPU, which has the

[clang] [NFC][Clang][CodeGen] Remove vestigial assertion (PR #127528)

2025-05-10 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > @jhuber6 Was the follow-up for this backported too? I don't remember, sorry. I think the whole thing got reverted or something? https://github.com/llvm/llvm-project/pull/127528 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] [HIP] change default offload archs (PR #139281)

2025-05-13 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > The main obstacle of letting clang emit error when `--offload-arch` is not > > specified is HIP apps using hipcc as CMAKE_CXX_COMPILER. hipcc adds -xhip > > by default for .cpp programs. This is a known and long existing issue. > > Another option is to have multiple `--offloa

[clang] [HIP] change default offload archs (PR #139281)

2025-05-13 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > It's just the AMDGCN target without any `+features`, right? The only issue > > I was aware of was assuming w64 when unspecified but you fixed that > > previously. > > Almost, but it's problematic in several ways. The problems multiply once you > start adding in manually spe

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-05-27 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. The changes make sense for just adding it, but does it actually work? The CMake I've seen in `libclc` does multiple compilations and some with `--target=amdgcn` for example, which is a little different from how the runtimes builds handle i

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-05-27 Thread Joseph Huber via cfe-commits
@@ -35,7 +35,7 @@ list(INSERT CMAKE_MODULE_PATH 0 # We order libraries to mirror roughly how they are layered, except that compiler-rt can depend # on libc++, so we put it after. -set(LLVM_DEFAULT_RUNTIMES "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;offload") +s

[clang] [Clang][OpenCL][AMDGPU] Allow a kernel to call another kernel (PR #115821)

2025-05-27 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Also, if you're compiling C++26, why is it enabling OpenCL language features? You can already do this pretty easily with `clang --target=spirv64` so long as you're okay with using vendor intrinsic extensions in SPIR-V. That's pretty much what the HIP support for SPIR-V does anyw

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-05-27 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 edited https://github.com/llvm/llvm-project/pull/141574 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][OpenCL][AMDGPU] Allow a kernel to call another kernel (PR #115821)

2025-05-27 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > This commit breaks a critical optimization for us. We have a project that > compiles most of the C++26 language features to Vulkan SPIRV. I've thought about doing that, since I've spent a few years just using normal C++ to write GPU runtimes. The main issue right now is that t

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-05-27 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > That said, I don't believe it "works" in the way it's supposed to. It still > grabs the host tools using `get_host_tool_path` in CMake, and custom commands > to build with that. I take it we're supposed to use `CMAKE_C_COMPILER` as if > we were a regular CMake project? Are we

[clang] [OpenMP] Fix atomic compare handling with overloaded operators (PR #141142)

2025-05-27 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/141142 >From a45dc43315631f28ced9cf5a14890e46e011e6d2 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 22 May 2025 16:21:34 -0500 Subject: [PATCH] [OpenMP] Fix atomic compare handling with overloaded operators

[clang] [OpenMP] Fix atomic compare handling with overloaded operators (PR #141142)

2025-05-28 Thread Joseph Huber via cfe-commits
@@ -12062,32 +12154,56 @@ bool OpenMPAtomicCompareCaptureChecker::checkForm3(IfStmt *S, X = BO->getLHS(); D = BO->getRHS(); - auto *Cond = dyn_cast(S->getCond()); - if (!Cond) { + if (auto *Cond = dyn_cast(S->getCond())) { +C = Cond; +if (Cond->getOpcode() != B

[clang] [OpenMP] Fix atomic compare handling with overloaded operators (PR #141142)

2025-05-28 Thread Joseph Huber via cfe-commits
@@ -991,3 +991,34 @@ int mixed() { // expected-note@+1 {{in instantiation of function template specialization 'mixed' requested here}} return mixed(); } + +#ifdef OMP51 +struct U {}; +struct U operator<(U, U); +struct U operator>(U, U); +struct U operator==(U, U); + +templ

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-05-28 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > I'll need to look into that - maybe we can talk offline. Since `libclc` is > used by downstream toolchains I feel it'll be hard to significantly change > how it's built or presented to the host. We could support two methods of > building but that would get sticky pretty quickl

[clang] [OpenMP] Fix atomic compare handling with overloaded operators (PR #141142)

2025-05-28 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/141142 >From f2c18ba64744320a8e2a63938b17137a1b6e74d7 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 22 May 2025 16:21:34 -0500 Subject: [PATCH] [OpenMP] Fix atomic compare handling with overloaded operators

[clang] [OpenMP] Fix atomic compare handling with overloaded operators (PR #141142)

2025-05-28 Thread Joseph Huber via cfe-commits
@@ -12062,32 +12154,56 @@ bool OpenMPAtomicCompareCaptureChecker::checkForm3(IfStmt *S, X = BO->getLHS(); D = BO->getRHS(); - auto *Cond = dyn_cast(S->getCond()); - if (!Cond) { + if (auto *Cond = dyn_cast(S->getCond())) { +C = Cond; +if (Cond->getOpcode() != B

[clang] [OpenMP] Fix atomic compare handling with overloaded operators (PR #141142)

2025-05-28 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/141142 >From 07caec33a1113602f3d6ba79357edeae6b66647c Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 22 May 2025 16:21:34 -0500 Subject: [PATCH] [OpenMP] Fix atomic compare handling with overloaded operators

[clang] [CUDA][HIP] add option -gpuinc (PR #140106)

2025-05-15 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > Hmm, in what cases is `-nogpuinc` added when we don't actually want it? I > > think we should avoid adding `-nogpuinc` if it's not needed, if possible. > > comgr is the JIT compiler for HIP on ROCm. comgr uses -nogpuinc by default. > However, some users of comgr need to over

[clang] [CUDA][HIP] add option -gpuinc (PR #140106)

2025-05-15 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > but there is other comgr user expecting comgr to have -nogpuinc by default. > changing that will cause regressions. If `comgr` can have custom flags then you could just pass the 'do not pass `-nogpuinc` by default' flag presumably. https://github.com/llvm/llvm-project/pull/14

[clang] [CUDA][HIP] add option -gpuinc (PR #140106)

2025-05-15 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > > > Hmm, in what cases is `-nogpuinc` added when we don't actually want it? > > > > I think we should avoid adding `-nogpuinc` if it's not needed, if > > > > possible. > > > > > > > > > comgr is the JIT compiler for HIP on ROCm. comgr uses -nogpuinc by > > > default. Howev

[clang] [XRay] Fix argument parsing with offloading (#140748) (PR #141043)

2025-05-22 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. We'll now be creating the XRayArgs class when we do this every time, but I don't think it's expensive enough or done enough times to be an issue. Thanks. https://github.com/llvm/llvm-project/pull/141043 _

[clang] [XRay] Fix argument parsing with offloading (#140748) (PR #141043)

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

[clang] [OpenMP] Fix atomic compare handling with overloaded operators (PR #141142)

2025-05-22 Thread Joseph Huber via cfe-commits
@@ -11762,52 +11762,98 @@ bool OpenMPAtomicCompareChecker::checkCondUpdateStmt(IfStmt *S, X = BO->getLHS(); - auto *Cond = dyn_cast(S->getCond()); - if (!Cond) { -ErrorInfo.Error = ErrorTy::NotABinaryOp; -ErrorInfo.ErrorLoc = ErrorInfo.NoteLoc = S->getCond()->get

[clang] [OpenMP] Fix atomic compare handling with overloaded operators (PR #141142)

2025-05-22 Thread Joseph Huber via cfe-commits
@@ -11762,52 +11762,98 @@ bool OpenMPAtomicCompareChecker::checkCondUpdateStmt(IfStmt *S, X = BO->getLHS(); - auto *Cond = dyn_cast(S->getCond()); - if (!Cond) { -ErrorInfo.Error = ErrorTy::NotABinaryOp; -ErrorInfo.ErrorLoc = ErrorInfo.NoteLoc = S->getCond()->get

[clang] [Driver][LTO] Move common code for LTO to addLTOOptions() (PR #74178)

2025-05-23 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. Looks like a nice cleanup https://github.com/llvm/llvm-project/pull/74178 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver][OpenMP][SPIR-V] Fix SPIR-V OpenMP DeviceRTL expected file name (PR #141855)

2025-05-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. The `.bc` file for AMDGPU is unused, I'd imagine SPIR-V is as well since its compilation flow is like AMDGPU. https://github.com/llvm/llvm-project/pull/141855 ___ cfe-commits mailing list cfe-comm

[clang] [Clang] Always pass the detected CUDA path to the linker wrapper (PR #142021)

2025-05-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/142021 Summary: This patch identifies the CUDA path that clang used and forwards it to the linker wrapper. This should make sure that we're using a consistent CUDA path, but the behavior should be the same for normal us

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-05-29 Thread Joseph Huber via cfe-commits
@@ -72,7 +72,7 @@ else() # Note that we check this later (for both build types) but we can provide a # more useful error message when built in-tree. We assume that LLVM tools are # always available so don't warn here. - if( NOT clang IN_LIST LLVM_ENABLE_PROJECTS ) + if(

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

2025-06-02 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/125744 >From ce7701b7c95ee1e59c7942b23833a7a7336abfb7 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 4 Feb 2025 12:06:34 -0600 Subject: [PATCH] Reapply "[AMDGPU] Use the AMDGPUToolChain when targeting C/C++ di

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

2025-06-03 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/125744 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    22   23   24   25   26   27