[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

[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 6861a2b2b142e9550ec9d0642f93471652a73901 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

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

2025-08-20 Thread Joseph Huber via cfe-commits
@@ -941,6 +941,24 @@ Let ``VT`` be a vector type and ``ET`` the element type of ``VT``. for the comparison. === ==

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

2025-08-20 Thread Joseph Huber via cfe-commits
@@ -1232,6 +1232,18 @@ def ConvertVector : Builtin { let Prototype = "void(...)"; } +def MaskedLoad : Builtin { + let Spellings = ["__builtin_masked_load"]; jhuber6 wrote: On second thought, I decided to leave it because it both matches the LLVM intrinsic

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

2025-08-20 Thread Joseph Huber via cfe-commits
@@ -2266,6 +2266,87 @@ static bool BuiltinCountZeroBitsGeneric(Sema &S, CallExpr *TheCall) { return false; } +static ExprResult BuiltinMaskedLoad(Sema &S, CallExpr *TheCall) { + if (S.checkArgCount(TheCall, 2)) +return ExprError(); + + Expr *MaskArg = TheCall->getArg(

[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 8e19054cf3888342fa853f9fae30032a60cd22d9 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

[clang] [Clang][Headers] Fix for SYCL (PR #152314)

2025-08-20 Thread Joseph Huber via cfe-commits
jhuber6 wrote: As far as I understand, numbered address spaces are intended to be a direct line into the LLVM-IR / backend's interpretation of them. Language AS's are intended to be a thin veneer over the semantics of that. For example `AS(3)` is LDS in AMDGPU if you compile to the AMDGPU back

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

2025-08-20 Thread Joseph Huber via cfe-commits
@@ -1232,6 +1232,18 @@ def ConvertVector : Builtin { let Prototype = "void(...)"; } +def MaskedLoad : Builtin { + let Spellings = ["__builtin_masked_load"]; jhuber6 wrote: I'll change it to `__builtin_masked_vector_[load|store]` and add documentation. htt

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

2025-08-20 Thread Joseph Huber via cfe-commits
@@ -2266,6 +2266,87 @@ static bool BuiltinCountZeroBitsGeneric(Sema &S, CallExpr *TheCall) { return false; } +static ExprResult BuiltinMaskedLoad(Sema &S, CallExpr *TheCall) { + if (S.checkArgCount(TheCall, 2)) +return ExprError(); + + Expr *MaskArg = TheCall->getArg(

[clang] [Clang] Support using boolean vectors in ternary operators (PR #154145)

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

[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 f95f62320b3fb7525a34e49571e2519ec0b78ccd Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 19 Aug 2025 23:01:03 -0500 Subject: [PATCH 1/3] [Clang] Add builtins for masked vector loads / stores Summar

[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 f95f62320b3fb7525a34e49571e2519ec0b78ccd Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 19 Aug 2025 23:01:03 -0500 Subject: [PATCH 1/3] [Clang] Add builtins for masked vector loads / stores Summar

[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 f95f62320b3fb7525a34e49571e2519ec0b78ccd Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 19 Aug 2025 23:01:03 -0500 Subject: [PATCH 1/3] [Clang] Add builtins for masked vector loads / stores Summar

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

2025-08-20 Thread Joseph Huber via cfe-commits
@@ -1232,6 +1232,18 @@ def ConvertVector : Builtin { let Prototype = "void(...)"; } +def MaskedLoad : Builtin { + let Spellings = ["__builtin_masked_load"]; + let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr]; jhuber6 wrote: Whoops, forgot

[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 f95f62320b3fb7525a34e49571e2519ec0b78ccd Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 19 Aug 2025 23:01:03 -0500 Subject: [PATCH 1/2] [Clang] Add builtins for masked vector loads / stores Summar

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

2025-08-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/154464 >From f95f62320b3fb7525a34e49571e2519ec0b78ccd 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

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

2025-08-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/154464 Summary: Clang has support for boolean vectors, these builtins expose the LLVM instruction of the same name. This differs from a manual load and select by potentially suppressing traps from deactivated lanes. Fi

[clang] [llvm] [LLVM] Introduce 'llvm-offload-wrapper' tool (PR #153504)

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

[clang] [llvm] [LLVM] Introduce 'llvm-offload-wrapper' tool (PR #153504)

2025-08-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/153504 >From eff0af357efd323f26f9188745681132d122253a Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 13 Aug 2025 17:31:18 -0500 Subject: [PATCH 1/2] [LLVM] Introduce 'llvm-offload-wrapper' tool Summary: This i

[clang] [llvm] [LLVM] Introduce 'llvm-offload-wrapper' tool (PR #153504)

2025-08-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/153504 >From eff0af357efd323f26f9188745681132d122253a Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 13 Aug 2025 17:31:18 -0500 Subject: [PATCH] [LLVM] Introduce 'llvm-offload-wrapper' tool Summary: This is a

[clang] [llvm] [LLVM] Introduce 'llvm-offload-wrapper' tool (PR #153504)

2025-08-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/153504 >From 5d9b3c0ea9c1aa7683995b3e8f69191c497bf247 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 13 Aug 2025 17:31:18 -0500 Subject: [PATCH 1/2] [LLVM] Introduce 'llvm-offload-wrapper' tool Summary: This i

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

2025-08-19 Thread Joseph Huber via cfe-commits
jhuber6 wrote: I'm looking into how to make this `constexpr`, could we just do bit packing if we encounter a vector of booleans to treat it as an integer here? https://github.com/llvm/llvm-project/pull/154203 ___ cfe-commits mailing list cfe-commits@l

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

2025-08-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 edited 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] Add queryable feature 'boolean_vectors' for SIMD masks (PR #154227)

2025-08-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/154227 >From fb6fc11a3f4687e45207f43e867b6cb46bf7b1cf Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 18 Aug 2025 18:36:57 -0500 Subject: [PATCH] [Clang] Add queryable feature 'boolean_vectors' for SIMD masks

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

2025-08-19 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > I clicked accept, but not sure I'm super in favor of the name? Maybe see if > folks will bikeshed it for you? I'm a bit concerned it is too close to other > things (vector is ambiguous of course). > > Maybe: > > `boolean_gnu_vector_type` and `boolean_ext_vector_type` > > WDY

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

2025-08-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/154227 >From 9e4dc9de57df323534b90b5c790401468b8c094d Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 18 Aug 2025 18:36:57 -0500 Subject: [PATCH 1/2] [Clang] Add queryable feature 'boolean_vectors' for SIMD mas

[clang] [Clang][Headers] Fix for SYCL (PR #152314)

2025-08-19 Thread Joseph Huber via cfe-commits
jhuber6 wrote: That PR totally disables the OpenCL generic AS, it seems weird that C/C++ can use it fine but SYCL can't. https://github.com/llvm/llvm-project/pull/152314 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [Clang][Headers] Fix for SYCL (PR #152314)

2025-08-19 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 commented: This function was a little weird because the intrinsic specifies the address space I think. Do you know explicitly why we can't cast here? Seems weird that the compiler would fall over on this. https://github.com/llvm/llvm-project/pull/152314 _

[clang] [llvm] [LLVM] Introduce 'llvm-offload-wrapper' tool (PR #153504)

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

[clang] [Clang] Support using boolean vectors in ternary operators (PR #154145)

2025-08-18 Thread Joseph Huber via cfe-commits
@@ -5558,8 +5558,8 @@ VisitAbstractConditionalOperator(const AbstractConditionalOperator *E) { // OpenCL: If the condition is a vector, we can treat this condition like // the select function. - if ((CGF.getLangOpts().OpenCL && condExpr->getType()->isVectorType()) || -

[clang] [Clang] Support using boolean vectors in ternary operators (PR #154145)

2025-08-18 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/154145 >From 0e67cc11433a0e2e0d5ac454643de07eba7a145a Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 18 Aug 2025 09:35:01 -0500 Subject: [PATCH] [Clang] Support using boolean vectors in ternary operators Summa

[clang] [Clang] Support using boolean vectors in ternary operators (PR #154145)

2025-08-18 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > errors, but I think to fold it directly we'd need a dedicated builtin. But > > I'm not a master of the clang AST. > > We shouldn't need a builtin, we should just be able to handle the AST nodes > directly in ExprConstant.cpp. Ah, right. That doesn't work, but it seems like

[clang] [Clang] Support using boolean vectors in ternary operators (PR #154145)

2025-08-18 Thread Joseph Huber via cfe-commits
jhuber6 wrote: The constexpr case doesn't cause errors, but I think to fold it directly we'd need a dedicated builtin. But I'm not a master of the clang AST. https://github.com/llvm/llvm-project/pull/154145 ___ cfe-commits mailing list cfe-commits@lis

[clang] [Clang] Support using boolean vectors in ternary operators (PR #154145)

2025-08-18 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/154145 >From 0e67cc11433a0e2e0d5ac454643de07eba7a145a Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 18 Aug 2025 09:35:01 -0500 Subject: [PATCH 1/2] [Clang] Support using boolean vectors in ternary operators

[clang] [Clang] Support using boolean vectors in ternary operators (PR #154145)

2025-08-18 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > > Nope, that was me mis-reading the Github interface. LGTM. > > > > > > Nice, thanks for the quick review. I'm going to try making the generic bit > > functions (e.g. `__builtin_ctzg`) work with these vestors as well. A future > > patch I'll like to add a new queryable feat

[clang] [Clang] Support using boolean vectors in ternary operators (PR #154145)

2025-08-18 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > > This needs a release note, else I think this is fine. LGTM. > > > > > > I added one under the non-comprehensive changes. Should I put it somewhere > > more specific? > > Nope, that was me mis-reading the Github interface. LGTM. Nice, thanks for the quick review. I'm goin

[clang] [Clang] Support using boolean vectors in ternary operators (PR #154145)

2025-08-18 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > This needs a release note, else I think this is fine. LGTM. I added one under the non-comprehensive changes. Should I put it somewhere more specific? https://github.com/llvm/llvm-project/pull/154145 ___ cfe-commits mailing list cfe-c

[clang] [Clang] Support using boolean vectors in ternary operators (PR #154145)

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

[clang] [Clang] Support using boolean vectors in ternary operators (PR #154145)

2025-08-18 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/154145 Summary: It's extremely common to conditionally blend two vectors. Previously this was done with mask registers, which is what the normal ternary code generation does when used on a vector. However, since Clang 1

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

2025-08-15 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > I'd suggest you just try doing `--offload-new-driver` with `-###` and `-v` > > and see what doesn't work. > > Running the `hipspv-toolchain.hip` case with the `--offload-new-driver` > option reveals that it is missing steps for running custom pass plugin on the > final devi

  1   2   3   4   5   6   7   8   9   10   >