[clang] [llvm] [Offload] Change ELF machine type for SPIR-V OpenMP image (PR #159623)

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

[clang] [Clang] Assume type align in masked load / store builtins (PR #156063)

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

[clang] [Clang] Assume type align in masked load / store builtins (PR #156063)

2025-09-22 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Changed this to use the type's alignment. I can change the interface to use a `V *` instead of `vec *`. https://github.com/llvm/llvm-project/pull/156063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [Clang] Add vector gather / scatter builtins to clang (PR #157895)

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

[clang] [Clang] Add vector gather / scatter builtins to clang (PR #157895)

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

[clang] [llvm] [Offload] Change ELF machine type for SPIR-V OpenMP image (PR #159623)

2025-09-20 Thread Joseph Huber via cfe-commits
@@ -423,9 +423,10 @@ Error offloading::intel::containerizeOpenMPSPIRVImage( Header.Class = ELF::ELFCLASS64; Header.Data = ELF::ELFDATA2LSB; Header.Type = ELF::ET_DYN; - // Use an existing Intel machine type as there is not one specifically for - // Intel GPUs. - Header

[clang] [X86] Relax AVX ABI warning on internal functions (PR #157570)

2025-09-20 Thread Joseph Huber via cfe-commits
@@ -1513,12 +1513,17 @@ static void initFeatureMaps(const ASTContext &Ctx, static bool checkAVXParamFeature(DiagnosticsEngine &Diag, SourceLocation CallLoc, + const FunctionDecl &Callee,

[clang] [HIP][Clang] Remove __AMDGCN_WAVEFRONT_SIZE macros (PR #157463)

2025-09-20 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. LG on my end, the OpenMP and libc runtimes are already using the builtin for things that require the wavefront size. https://github.com/llvm/llvm-project/pull/157463 ___ cfe-commits mailing list c

[clang] [llvm] [OpenMP][clang] Register Vtables on device for indirect calls (PR #159856)

2025-09-19 Thread Joseph Huber via cfe-commits
@@ -112,13 +112,39 @@ setupIndirectCallTable(DeviceTy &Device, __tgt_device_image *Image, llvm::SmallVector> IndirectCallTable; for (const auto &Entry : Entries) { if (Entry.Kind != llvm::object::OffloadKind::OFK_OpenMP || -Entry.Size == 0 || !(Entry.Flags & OM

[clang] [llvm] [OpenMP][clang] Register Vtables on device for indirect calls (PR #159856)

2025-09-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: Needs a runtime test https://github.com/llvm/llvm-project/pull/159856 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMP][clang] Register Vtables on device for indirect calls (PR #159856)

2025-09-19 Thread Joseph Huber via cfe-commits
@@ -1771,12 +1771,126 @@ void CGOpenMPRuntime::emitDeclareTargetFunction(const FunctionDecl *FD, Addr->setVisibility(llvm::GlobalValue::ProtectedVisibility); } + // Register the indirect Vtable: + // This is similar to OMPTargetGlobalVarEntryIndirect, except that the

[clang] [llvm] [OpenMP][clang] Register Vtables on device for indirect calls (PR #159856)

2025-09-19 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,280 @@ +///==/// +// RUN: %clang_cc1 -DCK1 -verify -fopenmp -Wno-openmp-mapping -x c++ -triple x86_64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -fopenmp-cuda-mode -emit-llvm-bc %s -o %

[clang] [llvm] [OpenMP][clang] Register Vtables on device for indirect calls (PR #159856)

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

[clang] [llvm] [OpenMP][clang] Register Vtables on device for indirect calls (PR #159856)

2025-09-19 Thread Joseph Huber via cfe-commits
@@ -443,7 +444,9 @@ static int loadImagesOntoDevice(DeviceTy &Device) { // the device to point to the memory on the host. if ((PM->getRequirements() & OMP_REQ_UNIFIED_SHARED_MEMORY) || (PM->getRequirements() & OMPX_REQ_AUTO_ZERO_COPY)) { -

[clang] [llvm] [OpenMP][clang] Register Vtables on device for indirect calls (PR #159856)

2025-09-19 Thread Joseph Huber via cfe-commits
@@ -112,13 +112,39 @@ setupIndirectCallTable(DeviceTy &Device, __tgt_device_image *Image, llvm::SmallVector> IndirectCallTable; for (const auto &Entry : Entries) { if (Entry.Kind != llvm::object::OffloadKind::OFK_OpenMP || -Entry.Size == 0 || !(Entry.Flags & OM

[clang] [llvm] [Offload] Change ELF machine type for SPIR-V OpenMP image (PR #159623)

2025-09-19 Thread Joseph Huber via cfe-commits
@@ -423,9 +423,10 @@ Error offloading::intel::containerizeOpenMPSPIRVImage( Header.Class = ELF::ELFCLASS64; Header.Data = ELF::ELFDATA2LSB; Header.Type = ELF::ET_DYN; - // Use an existing Intel machine type as there is not one specifically for - // Intel GPUs. - Header

[clang] [libclc] [Clang] Rename elementwise builtins to `clzg` and `ctzg` (PR #157128)

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

[clang] [llvm] [Offload] Change ELF machine type for SPIR-V OpenMP image (PR #159623)

2025-09-18 Thread Joseph Huber via cfe-commits
@@ -423,9 +423,10 @@ Error offloading::intel::containerizeOpenMPSPIRVImage( Header.Class = ELF::ELFCLASS64; Header.Data = ELF::ELFDATA2LSB; Header.Type = ELF::ET_DYN; - // Use an existing Intel machine type as there is not one specifically for - // Intel GPUs. - Header

[clang] [llvm] [clang][CUDA] Avoid accounting for tail padding in LLVM offloading (PR #156229)

2025-09-18 Thread Joseph Huber via cfe-commits
@@ -3655,11 +3655,6 @@ Error AMDGPUKernelTy::launchImpl(GenericDeviceTy &GenericDevice, KernelArgsTy &KernelArgs, KernelLaunchParamsTy LaunchParams, AsyncInfoWrapperTy &AsyncInfo

[clang] [llvm] [clang][CUDA] Avoid accounting for tail padding in LLVM offloading (PR #156229)

2025-09-18 Thread Joseph Huber via cfe-commits
@@ -3655,11 +3655,6 @@ Error AMDGPUKernelTy::launchImpl(GenericDeviceTy &GenericDevice, KernelArgsTy &KernelArgs, KernelLaunchParamsTy LaunchParams, AsyncInfoWrapperTy &AsyncInfo

[clang] [Clang] Permit implicit conversion from integral to boolean vectors (PR #158369)

2025-09-17 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -triple x86_64 -fsyntax-only -verify %s + +typedef _Bool bool; + +typedef __attribute__((ext_vector_type(8))) int v8i; +typedef __attribute__((ext_vector_type(8))) bool v8b; +typedef __attribute__((ext_vector_type(4))) float v4f; +typedef __att

[clang] [OpenMP] Fix table indentation in clang documentation (PR #158724)

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

[clang] [OpenMP] Fix table indentation in clang documentation (PR #158724)

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

[clang] [HIP] Move HIP to the new driver by default (PR #123359)

2025-09-15 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/123359 >From 5123637a52d6575a5dce1344e5e465004f7bf6b7 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 17 Jan 2025 09:35:34 -0600 Subject: [PATCH] [HIP] Move HIP to the new driver by default Summary: This patch

[clang] [Clang] Add vector gather / scatter builtins to clang (PR #157895)

2025-09-15 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/157895 >From 8d5d1de75a8b97d060c6ee564ec6f74e6defb602 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 10 Sep 2025 11:41:25 -0500 Subject: [PATCH 1/4] [Clang] Add vector gather / scatter builtins to clang Summar

[clang] [Clang] Add vector gather / scatter builtins to clang (PR #157895)

2025-09-15 Thread Joseph Huber via cfe-commits
@@ -2361,6 +2363,101 @@ static ExprResult BuiltinMaskedStore(Sema &S, CallExpr *TheCall) { return TheCall; } +static ExprResult BuiltinMaskedGather(Sema &S, CallExpr *TheCall) { + if (S.checkArgCountRange(TheCall, 3, 4)) +return ExprError(); + + Expr *MaskArg = TheCal

[clang] [Clang] Add vector gather / scatter builtins to clang (PR #157895)

2025-09-15 Thread Joseph Huber via cfe-commits
jhuber6 wrote: ping https://github.com/llvm/llvm-project/pull/157895 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Permit implicit conversion from integral to boolean vectors (PR #158369)

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

[clang] [Clang] Add vector gather / scatter builtins to clang (PR #157895)

2025-09-13 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/157895 >From 105d21ef27d1993527924e1da5f181dc9a67eff1 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 10 Sep 2025 11:41:25 -0500 Subject: [PATCH 1/3] [Clang] Add vector gather / scatter builtins to clang Summar

[clang] [llvm] [openmp] [offload][OpenMP] Remove device code for num_threads strict (PR #157893)

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

[clang] [Clang] Add vector gather / scatter builtins to clang (PR #157895)

2025-09-13 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/157895 >From 4b91a54c49d6b87ef85e08dd94b553c807e14fe8 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 10 Sep 2025 11:41:25 -0500 Subject: [PATCH 1/2] [Clang] Add vector gather / scatter builtins to clang Summar

[clang] [Clang] Permit implicit conversion from integral to boolean vectors (PR #158369)

2025-09-12 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/158369 Summary: Clang supports boolean vectors as an extension to the vector model. These are commonly used to represent mask vectors in many vector ISAs. Currently, using these is quite difficult because all of the vec

[clang] [Clang] Add vector gather / scatter builtins to clang (PR #157895)

2025-09-12 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/157895 >From 105d21ef27d1993527924e1da5f181dc9a67eff1 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 10 Sep 2025 11:41:25 -0500 Subject: [PATCH 1/3] [Clang] Add vector gather / scatter builtins to clang Summar

[clang] [llvm] [openmp] [offload][OpenMP] Remove device code for num_threads strict (PR #157893)

2025-09-12 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: Can we keep the OMPKinds definitions? I figure we'll need those for the CPU side. https://github.com/llvm/llvm-project/pull/157893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [X86] Relax AVX ABI warning on internal functions (PR #157570)

2025-09-12 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Does this actually fix the linked bug report? That's about `always_inline` > functions, which still have default visibility. Right, forgot to do a check on that. Hopefully I can just check the attribute there. https://github.com/llvm/llvm-project/pull/157570 _

[clang] [Clang] Add vector gather / scatter builtins to clang (PR #157895)

2025-09-12 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/157895 >From 105d21ef27d1993527924e1da5f181dc9a67eff1 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 10 Sep 2025 11:41:25 -0500 Subject: [PATCH 1/3] [Clang] Add vector gather / scatter builtins to clang Summar

[clang] [X86] Relax AVX ABI warning on internal functions (PR #157570)

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

[clang] [X86] Relax AVX ABI warning on internal functions (PR #157570)

2025-09-12 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/157570 >From b8bf2ff118a39f1ef76b67e6e8dcba72f5b91e3e Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 8 Sep 2025 17:22:33 -0500 Subject: [PATCH 1/2] [X86] Relax AVX ABI warning on internal functions Summary: Th

[clang] [Clang] Assume unaligned in maksed load / store builtins (PR #156063)

2025-09-12 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Deferencing a pointer, __builtin_memcpy, and most other operations that > involve accessing pointers, currently assume pointers are naturally aligned. > The exact representation of this in LLVM IR varies, but the fundamental > assumption is that you're following normal C/C++ s

[clang] [clang][OpenMP][SPIR-V] Fix addrspace of pointer kernel arguments (PR #157172)

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

[clang] [X86] Relax AVX ABI warning on internal functions (PR #157570)

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

[clang] [libclc] [Clang] Rename elementwise builtins to `clzg` and `ctzg` (PR #157128)

2025-09-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/157128 >From 97ee7e3b1cfc06b434b71987b9b0a9fd8b14a236 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 5 Sep 2025 10:42:07 -0500 Subject: [PATCH 1/2] [Clang] Rename elementwise builtins to `clzg` and `ctzg` Summ

[clang] [libclc] [Clang] Rename elementwise builtins to `clzg` and `ctzg` (PR #157128)

2025-09-07 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > I don't really mind what they're called. As I said in the original RFC and PR > that introduced the builtins, I have no particular favourites. > > However, do note that the elementwise builtins are not _exactly_ like > clzg/ctzg in that they don't have _target-specific_ zero-i

[clang] [Clang] Rename elementwise builtins to `clzg` and `ctzg` (PR #157128)

2025-09-05 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > No objections, but only because we haven't had these builtins for very long. Yeah, they haven't made it into a release so it should be fair game. https://github.com/llvm/llvm-project/pull/157128 ___ cfe-commits mailing list cfe-commit

[clang] [Clang] Rename elementwise builtins to `clzg` and `ctzg` (PR #157128)

2025-09-05 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/157128 Summary: The added bit counting builtins for vectors used `cttz` and `ctlz`, which is consistent with the LLVM naming convention. However, these are clang builtins and implement exactly the `__builtin_ctzg` and `

[clang] [llvm] [clang][CUDA] Avoid accounting for tail padding in LLVM offloading (PR #156229)

2025-09-03 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. I'm not going to block this, but I think long term being divergent with CUDA code generation here is unwise. We should let both lower to the same but change the runtime calls, the runtime call then goes to `cuLaunchkernel` which expects a

[clang] [llvm] [SYCL] Add offload wrapping for SYCL kind. (PR #147508)

2025-09-03 Thread Joseph Huber via cfe-commits
@@ -620,6 +635,422 @@ void createRegisterFatbinFunction(Module &M, GlobalVariable *FatbinDesc, // Add this function to constructors. appendToGlobalCtors(M, CtorFunc, /*Priority=*/101); } + +/// SYCLWrapper helper class that creates all LLVM IRs wrapping given images. +stru

[clang] [llvm] [clang][SPIRV] Set program address space for Intel-flavored SPIR-V (PR #135251)

2025-09-03 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. Seems fine, though I do wonder what's the point of SPIR-V being generic if we hard-code behavior for different 'flavors' anyway. https://github.com/llvm/llvm-project/pull/135251 ___ cfe-commits ma

[clang] [clang-tools-extra] [compiler-rt] [flang] [libc] [libcxx] [lldb] [llvm] [mlir] [openmp] Fix typos and spelling errors across codebase (PR #156270)

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

[clang] [Clang] Permit half precision in `__builtin_complex` (PR #156479)

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

[clang] [llvm] [SYCL] Add offload wrapping for SYCL kind. (PR #147508)

2025-09-03 Thread Joseph Huber via cfe-commits
@@ -620,6 +635,422 @@ void createRegisterFatbinFunction(Module &M, GlobalVariable *FatbinDesc, // Add this function to constructors. appendToGlobalCtors(M, CtorFunc, /*Priority=*/101); } + +/// SYCLWrapper helper class that creates all LLVM IRs wrapping given images. +stru

[clang] [Clang] Permit half precision in `__builtin_complex` (PR #156479)

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

[clang] [llvm] [OMPIRBuilder] Use target global AS for SrcLocStr (PR #156520)

2025-09-03 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. Seems reasonable, guessing this is SPIR-V only? Sometimes default address spaces dependent on language cause issues when mixing IR. https://github.com/llvm/llvm-project/pull/156520 ___ cfe-commits

[clang] [llvm] [OMPIRBuilder] Use target global AS for SrcLocStr (PR #156520)

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

[clang] [Clang] Assume unaligned in maksed load / store builtins (PR #156063)

2025-09-02 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > In theory we can lower masked load/store on any target; it's just a question > of how terrible the resulting code is. And on a target that doesn't support > unaligned load/store, the answer is, pretty terrible. But basically > everything that supports vectors has unaligned acc

[clang] [Clang] Permit half precision in `__builtin_complex` (PR #156479)

2025-09-02 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/156479 Summary: This was forbidden previously even which made us divergent with the GCC implementation. Permit this by simply removing this Sema check. Fixes: https://github.com/llvm/llvm-project/issues/156463 >From

[clang] [llvm] [OMPIRBuilder] Use target global AS for SrcLocStr (PR #156520)

2025-09-02 Thread Joseph Huber via cfe-commits
@@ -955,8 +962,9 @@ Constant *OpenMPIRBuilder::getOrCreateSrcLocStr(StringRef LocStr, GV.getInitializer() == Initializer) return SrcLocStr = ConstantExpr::getPointerCast(&GV, Int8Ptr); -SrcLocStr = Builder.CreateGlobalString(LocStr, /* Name */ "", -

[clang] [llvm] [InstCombine] Strip leading zero indices from GEP (PR #155415)

2025-09-02 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > I finally got some IR and maybe some other info. With `-opt-bisect-limit` it > appears that the issue is coming from GVN on the function > `_ZN47LlvmLibcCharacterConverterUTF32To8Test_FourByte3RunEv`. After that the > particular tests fails at runtime. > > I attached the IR a

[clang] [llvm] [SYCL] Add offload wrapping for SYCL kind. (PR #147508)

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

[clang] [llvm] [SYCL] Add offload wrapping for SYCL kind. (PR #147508)

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

[clang] [llvm] [SYCL] Add offload wrapping for SYCL kind. (PR #147508)

2025-09-02 Thread Joseph Huber via cfe-commits
@@ -620,6 +635,422 @@ void createRegisterFatbinFunction(Module &M, GlobalVariable *FatbinDesc, // Add this function to constructors. appendToGlobalCtors(M, CtorFunc, /*Priority=*/101); } + +/// SYCLWrapper helper class that creates all LLVM IRs wrapping given images. +stru

[clang] [llvm] [SYCL] Add offload wrapping for SYCL kind. (PR #147508)

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

[clang] [Clang] Assume unaligned in maksed load / store builtins (PR #156063)

2025-08-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/156063 Summary: Right now these enformce alignment, which isn't convenient for the user on platforms that support unaligned accesses. The options are to either permit passing the alignment manually, or just assume it's

[clang] [Clang] Add masked vector builtins for expand and compress access (PR #156042)

2025-08-29 Thread Joseph Huber via cfe-commits
@@ -11016,7 +11016,7 @@ def err_sizeless_nonlocal : Error< def err_vec_masked_load_store_ptr : Error< "%ordinal0 argument must be a %1">; def err_vec_masked_load_store_size : Error< - "all arguments to %0 must have the same number of elements (was %1 and %2)">; + "all argument

[clang] [Clang] Add masked vector builtins for expand and compress access (PR #156042)

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

[clang] [Clang] Add masked vector builtins for expand and compress access (PR #156042)

2025-08-29 Thread Joseph Huber via cfe-commits
@@ -950,6 +950,11 @@ argument is always boolean mask vector. The ``__builtin_masked_load`` builtin takes an optional third vector argument that will be used for the result of the masked-off lanes. These builtins assume the memory is always aligned. +The ``__builtin_masked_exp

[clang] [Clang] Add masked vector builtins for expand and compress access (PR #156042)

2025-08-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/156042 >From 1221affdc11f757ced2303a894950badde4b9833 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 29 Aug 2025 09:57:19 -0500 Subject: [PATCH 1/3] [Clang] Add masked vector builtins for expand and compress a

[clang] [Clang] Add masked vector builtins for expand and compress access (PR #156042)

2025-08-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/156042 >From 1221affdc11f757ced2303a894950badde4b9833 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 29 Aug 2025 09:57:19 -0500 Subject: [PATCH 1/2] [Clang] Add masked vector builtins for expand and compress a

[clang] [Clang] Add masked vector builtins for expand and compress access (PR #156042)

2025-08-29 Thread Joseph Huber via cfe-commits
@@ -11016,7 +11016,7 @@ def err_sizeless_nonlocal : Error< def err_vec_masked_load_store_ptr : Error< "%ordinal0 argument must be a %1">; def err_vec_masked_load_store_size : Error< - "all arguments to %0 must have the same number of elements (was %1 and %2)">; + "all argument

[clang] [Clang] Add masked vector builtins for expand and compress access (PR #156042)

2025-08-29 Thread Joseph Huber via cfe-commits
@@ -950,6 +950,11 @@ argument is always boolean mask vector. The ``__builtin_masked_load`` builtin takes an optional third vector argument that will be used for the result of the masked-off lanes. These builtins assume the memory is always aligned. +The ``__builtin_masked_exp

[clang] [Clang] Add masked vector builtins for expand and compress access (PR #156042)

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

[clang] [Clang] Add masked vector builtins for expand and compress access (PR #156042)

2025-08-29 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/156042 Summary: The interface here is nearly indentical to the already added masked loads and stores. These bind to very similar intrinsics so we add them here. >From 1221affdc11f757ced2303a894950badde4b9833 Mon Sep 1

[clang] [Clang] Update `__builtin_masked_load` to accept passthrough argument (PR #155652)

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

[clang] [Clang] Update `__builtin_masked_load` to accept passthrough argument (PR #155652)

2025-08-27 Thread Joseph Huber via cfe-commits
@@ -946,7 +946,9 @@ Let ``VT`` be a vector type and ``ET`` the element type of ``VT``. Each builtin accesses memory according to a provided boolean mask. These are provided as ``__builtin_masked_load`` and ``__builtin_masked_store``. The first -argument is always boolean mask

[clang] [Clang] Update `__builtin_masked_load` to accept passthrough argument (PR #155652)

2025-08-27 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/155652 >From 3a62febbcf70485bc287f3ea713a8eff61cf215d Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 27 Aug 2025 11:35:56 -0500 Subject: [PATCH 1/3] [Clang] Update `__builtin_masked_load` to accept passthrough

[clang] [Clang] Update `__builtin_masked_load` to accept passthrough argument (PR #155652)

2025-08-27 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/155652 >From 3a62febbcf70485bc287f3ea713a8eff61cf215d Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 27 Aug 2025 11:35:56 -0500 Subject: [PATCH 1/2] [Clang] Update `__builtin_masked_load` to accept passthrough

[clang] [Clang] Support generic bit counting builtins on fixed boolean vectors (PR #154203)

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

[clang] [Clang] Support generic bit counting builtins on fixed boolean vectors (PR #154203)

2025-08-21 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/154203 >From cc9d2d9e4923bad0d904d251fa116ad388b0b6ac Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 18 Aug 2025 15:59:46 -0500 Subject: [PATCH 1/6] [Clang] Support generic bit counting builtins on fixed boole

[clang] [Clang] Fix incorrect return type for `__builtin_shufflevector` (PR #154817)

2025-08-21 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/154817 >From d2eceb10f6bb33c28f4891b0664e4978b7a76c88 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 21 Aug 2025 13:14:03 -0500 Subject: [PATCH] [Clang] Fix incorrect return type for `__builtin_shufflevector`

[clang] [Clang] Fix incorrect return type for `__builtin_shufflevector` (PR #154817)

2025-08-21 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/154817 Summary: The `__builtin_shufflevector` call would return a GCC vector in all cases where the vector type was increased. Change this to preserve whether or not this was an extended vector. Fixes: https://github.c

[clang] [Clang] Support generic bit counting builtins on fixed boolean vectors (PR #154203)

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

[clang] [Driver][Gnu] Auto-link libstdc++fs for GCC versions in [5.3, 9.2) (PR #154826)

2025-08-21 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: Do you know if gcc auto links these and this behavior matches? https://github.com/llvm/llvm-project/pull/154826 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [Clang] Fix incorrect return type for `__builtin_shufflevector` (PR #154817)

2025-08-21 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/154817 >From d2eceb10f6bb33c28f4891b0664e4978b7a76c88 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 21 Aug 2025 13:14:03 -0500 Subject: [PATCH] [Clang] Fix incorrect return type for `__builtin_shufflevector`

[clang] [Clang] Fix incorrect return type for `__builtin_shufflevector` (PR #154817)

2025-08-21 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/154817 >From d2eceb10f6bb33c28f4891b0664e4978b7a76c88 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 21 Aug 2025 13:14:03 -0500 Subject: [PATCH] [Clang] Fix incorrect return type for `__builtin_shufflevector`

[clang] [Clang] Support generic bit counting builtins on fixed boolean vectors (PR #154203)

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

[clang] [Clang] Support generic bit counting builtins on fixed boolean vectors (PR #154203)

2025-08-21 Thread Joseph Huber via cfe-commits
@@ -4213,7 +4213,7 @@ such as ``unsigned __int128`` and C23 ``unsigned _BitInt(N)``. ``__builtin_clzg`` (respectively ``__builtin_ctzg``) returns the number of leading (respectively trailing) 0 bits in the first argument. The first argument -can be of any unsigned integer ty

[clang] [Clang] Support generic bit counting builtins on fixed boolean vectors (PR #154203)

2025-08-21 Thread Joseph Huber via cfe-commits
@@ -4213,7 +4213,7 @@ such as ``unsigned __int128`` and C23 ``unsigned _BitInt(N)``. ``__builtin_clzg`` (respectively ``__builtin_ctzg``) returns the number of leading (respectively trailing) 0 bits in the first argument. The first argument -can be of any unsigned integer ty

[clang] [Clang] Support generic bit counting builtins on fixed boolean vectors (PR #154203)

2025-08-21 Thread Joseph Huber via cfe-commits
@@ -1693,6 +1693,22 @@ getBitTestAtomicOrdering(BitTest::InterlockingKind I) { llvm_unreachable("invalid interlocking"); } +static llvm::Value *EmitIntegerExpr(CodeGenFunction &CGF, const Expr *E) { + llvm::Value *ArgValue = CGF.EmitScalarExpr(E); + llvm::Type *ArgType = A

[clang] [Clang] Support generic bit counting builtins on fixed boolean vectors (PR #154203)

2025-08-21 Thread Joseph Huber via cfe-commits
@@ -13455,6 +13455,10 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, case Builtin::BI__lzcnt16: // Microsoft variants of count leading-zeroes case Builtin::BI__lzcnt: case Builtin::BI__lzcnt64: { +// TODO: Handle boolean vectors in constexpr conte

[clang] [Clang] Support generic bit counting builtins on fixed boolean vectors (PR #154203)

2025-08-21 Thread Joseph Huber via cfe-commits
@@ -4213,7 +4213,7 @@ such as ``unsigned __int128`` and C23 ``unsigned _BitInt(N)``. ``__builtin_clzg`` (respectively ``__builtin_ctzg``) returns the number of leading (respectively trailing) 0 bits in the first argument. The first argument -can be of any unsigned integer ty

[clang] [Clang] Support generic bit counting builtins on fixed boolean vectors (PR #154203)

2025-08-21 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Is the idea behind only supporting boolean vectors that the operation on > arbitrary integer vectors probably ought to be a vector-to-vector operation? > That seems reasonable, but are we going to regret having inconsistent > behavior between different vector types, then? Tha

[clang] [llvm] [Driver][AMDGPU][HIP][SPIRV] Disable optimizations for AMDGCN SPIR-V (PR #154765)

2025-08-21 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: This seems like a pretty massive work-around. Could you be more specific about what the issue is? I'd expect LLVM optimizations to preserve everything we need, and if they don't it's because we're breaking the rules / overriding symbols with `-mlink-builti

[clang] [llvm] [X86] Set .llvmbc and .llvmcmd to exclude sections (PR #151910)

2025-08-20 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > I think `-ffat-lto-objects` uses exclude metadata, but I'm not overly > > familiar with what that's intended to do. > > Effect of exclude kind: > https://discourse.llvm.org/t/end-to-end-fembed-bitcode-llvmbc-and-llvmcmd/56265/14?u=haohaiwen I know what the exclude option th

[clang] [Clang] Support generic bit counting builtins on fixed boolean vectors (PR #154203)

2025-08-20 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/154203 >From 6aee3cfe0db0602479e8d5fedcb3eb6b699e2db3 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 18 Aug 2025 15:59:46 -0500 Subject: [PATCH] [Clang] Support generic bit counting builtins on fixed boolean v

[clang] [Clang] Add builtins for masked vector loads / stores (PR #154464)

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

[clang] [Clang] Add queryable feature 'ext_vector_type_boolean' for SIMD masks (PR #154227)

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

[clang] [Clang] Support generic bit counting builtins on fixed boolean vectors (PR #154203)

2025-08-20 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/154203 >From c2f86a3591a4e44e875cd00967ed8679876de287 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 18 Aug 2025 15:59:46 -0500 Subject: [PATCH] [Clang] Support generic bit counting builtins on fixed boolean v

[clang] [clang] Introduce elementwise ctlz/cttz builtins (PR #131995)

2025-08-20 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > Dropping in after the fact, is there a reason we called this > > `__builtin_elementwise_ctlz` instead of `__builtin_elementwise_clzg`? The > > builtin is just `clzg` done on each element so the name is confusing me. > > It matches the llvm intrinsic name, and the second argu

[clang] [clang] Introduce elementwise ctlz/cttz builtins (PR #131995)

2025-08-20 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Dropping in after the fact, is there a reason we called this `__builtin_elementwise_ctlz` instead of `__builtin_elementwise_clzg`? The builtin is just `clzg` done on each element so the name is confusing me. https://github.com/llvm/llvm-project/pull/131995 __

[clang] [Clang] Add builtins for masked vector loads / stores (PR #154464)

2025-08-20 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/154464 >From 4d8e7e1b3602f3c6e40be994fe495d30523c9a5c Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 19 Aug 2025 23:01:03 -0500 Subject: [PATCH] [Clang] Add builtins for masked vector loads / stores Summary: C

  1   2   3   4   5   6   7   8   9   10   >