[clang] [CIR] Upstream initial support for fixed size VectorType (PR #136488)

2025-04-21 Thread Andy Kaylor via cfe-commits
@@ -637,6 +637,42 @@ ArrayType::getABIAlignment(const ::mlir::DataLayout &dataLayout, return dataLayout.getTypeABIAlignment(getEltType()); } +//===--===// +// VectorType Definitions +//===--

[clang] [CIR] Upstream initial support for fixed size VectorType (PR #136488)

2025-04-21 Thread Andy Kaylor via cfe-commits
@@ -82,6 +82,9 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { cir::IntType>(ty)) return true; +if (mlir::isa(ty)) andykaylor wrote: ```suggestion if (auto vt = mlir::dyn_cast(ty)) ``` Then this would replace the `mli

[clang] [CIR] Upstream initial support for fixed size VectorType (PR #136488)

2025-04-21 Thread Andy Kaylor via cfe-commits
@@ -399,6 +399,14 @@ mlir::Type CIRGenTypes::convertType(QualType type) { break; } + case Type::ExtVector: + case Type::Vector: { +const VectorType *vec = cast(ty); +const mlir::Type elemTy = convertTypeForMem(vec->getElementType()); andykaylor

[clang] [clang] Constant-evaluate format strings as last resort (PR #135864)

2025-04-21 Thread via cfe-commits
@@ -6331,26 +6321,79 @@ static StringLiteralCheckType checkFormatStringExpr( } } -return SLCT_NotALiteral; +// try to constant-evaluate the string +break; } default: +// try to constant-evaluate the string +break; + } + + const StringLit

[clang] 7810d84 - [HLSL] Boolean in a RawBuffer should be i32 and Boolean vector in a RawBuffer should be (#135848)

2025-04-21 Thread via cfe-commits
Author: Sarah Spall Date: 2025-04-21T15:11:39-07:00 New Revision: 7810d8484413ae64029c93f8dfc43f77b0ba98c3 URL: https://github.com/llvm/llvm-project/commit/7810d8484413ae64029c93f8dfc43f77b0ba98c3 DIFF: https://github.com/llvm/llvm-project/commit/7810d8484413ae64029c93f8dfc43f77b0ba98c3.diff L

[clang] [CLANG][MS-STRUCT] bitfield padding warning presents padding to exact bit count (PR #136062)

2025-04-21 Thread Theo de Magalhaes via cfe-commits
=?utf-8?q?Théo?= de Magalhaes Message-ID: In-Reply-To: theomagellan wrote: It doesn't affect non-ms_struct definitions! The new `PaddingInLastUnit` variable only gets a non-zero value when the following condition is met: `IsMsStruct && (LastBitfieldStorageUnitSize != StorageUnitSize ||

[clang] 3ca2fa7 - [CLANG][MS-STRUCT] bitfield padding warning presents padding to exact bit count (#136062)

2025-04-21 Thread via cfe-commits
Author: Theo de Magalhaes Date: 2025-04-21T15:25:14-07:00 New Revision: 3ca2fa704e149ca22bd9739101ee7d5c498eb1a6 URL: https://github.com/llvm/llvm-project/commit/3ca2fa704e149ca22bd9739101ee7d5c498eb1a6 DIFF: https://github.com/llvm/llvm-project/commit/3ca2fa704e149ca22bd9739101ee7d5c498eb1a6.d

[clang] [CLANG][MS-STRUCT] bitfield padding warning presents padding to exact bit count (PR #136062)

2025-04-21 Thread Eli Friedman via cfe-commits
=?utf-8?q?Théo?= de Magalhaes Message-ID: In-Reply-To: https://github.com/efriedma-quic closed https://github.com/llvm/llvm-project/pull/136062 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
@@ -0,0 +1,28 @@ +//===- hlsl_spirv.h - HLSL definitions for SPIR-V target --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
@@ -6330,6 +6331,140 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode { findHandleTypeOnResource(const Type *RT); }; +/// Instances of this class represent operands to a SPIR-V type instruction. +class SpirvOperand { +public: + enum SpirvOpera

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
@@ -3332,6 +3388,39 @@ checkBuiltinTemplateIdType(Sema &SemaRef, BuiltinTemplateDecl *BTD, } return HasNoTypeMember; } + + case BTK__hlsl_spirv_type: { +assert(Converted.size() == 4); + +if (!Context.getTargetInfo().getTriple().isSPIRV()) { + SemaRef.Di

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
@@ -3332,6 +3388,39 @@ checkBuiltinTemplateIdType(Sema &SemaRef, BuiltinTemplateDecl *BTD, } return HasNoTypeMember; } + + case BTK__hlsl_spirv_type: { +assert(Converted.size() == 4); + +if (!Context.getTargetInfo().getTriple().isSPIRV()) { + SemaRef.Di

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
@@ -3228,6 +3228,62 @@ static QualType builtinCommonTypeImpl(Sema &S, TemplateName BaseTemplate, } } +static bool isInVkNamespace(const RecordType *RT) { + DeclContext *DC = RT->getDecl()->getDeclContext(); + if (!DC) +return false; + + NamespaceDecl *ND = dyn_cast(D

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
llvm-beanz wrote: Please move to SemaHLSL. https://github.com/llvm/llvm-project/pull/134034 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ +// RUN: dxil-pc-shadermodel6.0-compute %s \ +// RUN: -fsyntax-only -verify + +typedef vk::SpirvType<12, 2, 4, float> InvalidType1; // expected-error {{use of undeclared identifier 'vk'}} +vk::Li

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
@@ -6330,6 +6331,140 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode { findHandleTypeOnResource(const Type *RT); }; +/// Instances of this class represent operands to a SPIR-V type instruction. +class SpirvOperand { +public: + enum SpirvOpera

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
@@ -877,6 +878,11 @@ bool CodeGenTypes::isZeroInitializable(QualType T) { if (const MemberPointerType *MPT = T->getAs()) return getCXXABI().isZeroInitializable(MPT); + // HLSL Inline SPIR-V types are non-zero-initializable. + if (T->getAs()) { +return false; + } -

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
@@ -3228,6 +3228,62 @@ static QualType builtinCommonTypeImpl(Sema &S, TemplateName BaseTemplate, } } +static bool isInVkNamespace(const RecordType *RT) { + DeclContext *DC = RT->getDecl()->getDeclContext(); + if (!DC) +return false; + + NamespaceDecl *ND = dyn_cast(D

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
@@ -5444,6 +5459,31 @@ QualType ASTContext::getHLSLAttributedResourceType( return QualType(Ty, 0); } + +QualType ASTContext::getHLSLInlineSpirvType(uint32_t Opcode, uint32_t Size, +uint32_t Alignment, +

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
https://github.com/llvm-beanz commented: A few substantive comments, but mostly coding standard nits. https://github.com/llvm/llvm-project/pull/134034 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
@@ -369,14 +369,102 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getOpenCLType(CodeGenModule &CGM, return nullptr; } +// Gets a spirv.IntegralConstant or spirv.Literal. If IntegralType is present, +// returns an IntegralConstant, otherwise returns a Literal. +static llvm::Ty

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
@@ -6330,6 +6331,140 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode { findHandleTypeOnResource(const Type *RT); }; +/// Instances of this class represent operands to a SPIR-V type instruction. +class SpirvOperand { +public: + enum SpirvOpera

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
llvm-beanz wrote: Cool... cool... This is fine, but it looks like #130910 rewrote the line endings on some test files to CRLF. @hekota might be worth checking your editor settings and cleaning up the test files to avoid every edit rewriting every line of the

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/134034 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-04-21 Thread Chris B via cfe-commits
@@ -6165,6 +6254,18 @@ bool UnnamedLocalNoLinkageFinder::VisitHLSLAttributedResourceType( return Visit(T->getWrappedType()); } +bool UnnamedLocalNoLinkageFinder::VisitHLSLInlineSpirvType( +const HLSLInlineSpirvType *T) { + for (auto &Operand : T->getOperands()) { +

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-21 Thread Volodymyr Sapsai via cfe-commits
@@ -3311,12 +3314,11 @@ ASTReader::ReadControlBlock(ModuleFile &F, SignatureBytes.end()); Blob = Blob.substr(ASTFileSignature::size); -if (ImportedFile.empty()) { - // Use BaseDirectoryAsWritten to ens

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-21 Thread Volodymyr Sapsai via cfe-commits
@@ -0,0 +1,62 @@ +/// This tests the expected error case when there is a mismatch between the pcm dependencies passed in +/// the command line with `fmodule-file` and whats encoded in the pcm. + +/// The steps are: +/// 1. Build module (A-1) with no dependencies. +/// 2. Build

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-21 Thread Volodymyr Sapsai via cfe-commits
@@ -0,0 +1,62 @@ +/// This tests the expected error case when there is a mismatch between the pcm dependencies passed in +/// the command line with `fmodule-file` and whats encoded in the pcm. + +/// The steps are: +/// 1. Build module (A-1) with no dependencies. +/// 2. Build

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-21 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai edited https://github.com/llvm/llvm-project/pull/136612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-21 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai commented: What would happen if both A-1.pcm and A-2.pcm are built for the same files (e.g., from Sysroot) but have different file names? Not saying it is a valid use case to support, just curious what would happen. https://github.com/llvm/llvm-project/pull/136612 __

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-21 Thread Cyndy Ishida via cfe-commits
@@ -0,0 +1,62 @@ +/// This tests the expected error case when there is a mismatch between the pcm dependencies passed in +/// the command line with `fmodule-file` and whats encoded in the pcm. + +/// The steps are: +/// 1. Build module (A-1) with no dependencies. +/// 2. Build

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-21 Thread Cyndy Ishida via cfe-commits
cyndyishida wrote: > What would happen if both A-1.pcm and A-2.pcm are built for the same files > (e.g., from Sysroot) but have different file names? Not saying it is a valid > use case to support, just curious what would happen. I tried this, where basically `A-1.pcm` is built again but with

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-21 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida updated https://github.com/llvm/llvm-project/pull/136612 >From 046b60179ee5eddc6db2193406bfc2ef10fda3df Mon Sep 17 00:00:00 2001 From: Cyndy Ishida Date: Mon, 21 Apr 2025 13:20:12 -0700 Subject: [PATCH 1/3] [clang][Modules] Report when` lookupModuleFile` fails and

[clang] [llvm] [mlir] [NVPTX] Add support for Shared Cluster Memory address space. (PR #135444)

2025-04-21 Thread via cfe-commits
@@ -426,10 +426,7 @@ static std::optional evaluateIsSpace(Intrinsic::ID IID, unsigned AS) { case Intrinsic::nvvm_isspacep_shared: return AS == NVPTXAS::ADDRESS_SPACE_SHARED; case Intrinsic::nvvm_isspacep_shared_cluster: -// We can't tell shared from shared_cluster

[clang] [clang][ARM][AArch64] Define intrinsics guarded by __has_builtin on all platforms (PR #128222)

2025-04-21 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/128222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Boolean in a RawBuffer should be i32 and Boolean vector in a RawBuffer should be (PR #135848)

2025-04-21 Thread Sarah Spall via cfe-commits
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/135848 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [NVPTX] Add support for Shared Cluster Memory address space. (PR #135444)

2025-04-21 Thread via cfe-commits
@@ -25,6 +25,7 @@ enum AddressSpace : unsigned { ADDRESS_SPACE_CONST = 4, ADDRESS_SPACE_LOCAL = 5, ADDRESS_SPACE_TENSOR = 6, + ADDRESS_SPACE_SHARED_CLUSTER = 7, modiking wrote: Will keep it `shared` in this change. We can visit renaming/aliasing later i

[clang] [llvm] [mlir] [NVPTX] Add support for Shared Cluster Memory address space. (PR #135444)

2025-04-21 Thread via cfe-commits
@@ -176,6 +176,7 @@ enum AddressSpace : AddressSpaceUnderlyingType { Shared = 3, modiking wrote: Will keep it `shared` in this change. We can visit renaming/aliasing later if we want. https://github.com/llvm/llvm-project/pull/135444 _

[clang] [llvm] [mlir] [NVPTX] Add support for Shared Cluster Memory address space. (PR #135444)

2025-04-21 Thread via cfe-commits
@@ -426,10 +426,7 @@ static std::optional evaluateIsSpace(Intrinsic::ID IID, unsigned AS) { case Intrinsic::nvvm_isspacep_shared: return AS == NVPTXAS::ADDRESS_SPACE_SHARED; modiking wrote: Right, if it's `ADDRESS_SPACE_SHARED_CLUSTER` we can't perform a

[clang] [OpenACC][CIR] Implement 'async' lowering. (PR #136626)

2025-04-21 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/136626 Async acts just like num_workers/vector_length in that it gets a new variant per device_type and is lowered as an operand. However, it has one additional complication, in that it can have a variant that has

[clang] [OpenACC][CIR] Implement 'async' lowering. (PR #136626)

2025-04-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Erich Keane (erichkeane) Changes Async acts just like num_workers/vector_length in that it gets a new variant per device_type and is lowered as an operand. However, it has one additional complication, in that it can have a variant that h

[clang] [llvm] [mlir] [NVPTX] Add support for Shared Cluster Memory address space. (PR #135444)

2025-04-21 Thread via cfe-commits
https://github.com/modiking edited https://github.com/llvm/llvm-project/pull/135444 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 6d765e1 - Reapply 19c708c "FunctionDecl::getFunctionTypeLoc: ignore function type attributes (#118420)" (#136484)

2025-04-21 Thread via cfe-commits
Author: Owen Anderson Date: 2025-04-22T10:23:27+12:00 New Revision: 6d765e1c916aba7a038f5ace963001fca4fc9314 URL: https://github.com/llvm/llvm-project/commit/6d765e1c916aba7a038f5ace963001fca4fc9314 DIFF: https://github.com/llvm/llvm-project/commit/6d765e1c916aba7a038f5ace963001fca4fc9314.diff

[clang] [clang-tools-extra] Reapply 19c708c "FunctionDecl::getFunctionTypeLoc: ignore function type attributes (#118420)" (PR #136484)

2025-04-21 Thread Owen Anderson via cfe-commits
https://github.com/resistor closed https://github.com/llvm/llvm-project/pull/136484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CLANG][MS-STRUCT] bitfield padding warning presents padding to exact bit count (PR #136062)

2025-04-21 Thread Eli Friedman via cfe-commits
=?utf-8?q?Th=C3=A9o?= de Magalhaes Message-ID: In-Reply-To: https://github.com/efriedma-quic approved this pull request. Oh, I see, I missed the nesting. LGTM https://github.com/llvm/llvm-project/pull/136062 ___ cfe-commits mailing list cfe-commits

[clang] [OpenACC][CIR] Implement 'async' lowering. (PR #136626)

2025-04-21 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. Looks good to me. Just a couple of nits regarding the comment block. https://github.com/llvm/llvm-project/pull/136626 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [OpenACC][CIR] Implement 'async' lowering. (PR #136626)

2025-04-21 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor edited https://github.com/llvm/llvm-project/pull/136626 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC][CIR] Implement 'async' lowering. (PR #136626)

2025-04-21 Thread Andy Kaylor via cfe-commits
@@ -97,11 +97,13 @@ class OpenACCClauseCIREmitter final // Handle a clause affected by the 'device-type' to the point that they need // to have the attributes added in the correct/corresponding order, such as - // 'num_workers' or 'vector_length' on a compute construct. -

[clang] [OpenACC][CIR] Implement 'async' lowering. (PR #136626)

2025-04-21 Thread Andy Kaylor via cfe-commits
@@ -97,11 +97,13 @@ class OpenACCClauseCIREmitter final // Handle a clause affected by the 'device-type' to the point that they need // to have the attributes added in the correct/corresponding order, such as - // 'num_workers' or 'vector_length' on a compute construct. -

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-21 Thread Cyndy Ishida via cfe-commits
@@ -0,0 +1,62 @@ +/// This tests the expected error case when there is a mismatch between the pcm dependencies passed in +/// the command line with `fmodule-file` and whats encoded in the pcm. + +/// The steps are: +/// 1. Build module (A-1) with no dependencies. +/// 2. Build

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-21 Thread Jan Svoboda via cfe-commits
@@ -3349,9 +3351,14 @@ ASTReader::ReadControlBlock(ModuleFile &F, .getModuleCache() .getInMemoryModuleCache() .isPCMFinal(F.FileName); - if (isDiagnosedResult(

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-21 Thread Cyndy Ishida via cfe-commits
@@ -3349,9 +3351,14 @@ ASTReader::ReadControlBlock(ModuleFile &F, .getModuleCache() .getInMemoryModuleCache() .isPCMFinal(F.FileName); - if (isDiagnosedResult(

[clang] [Clang] Add support for GCC bound member functions extension (PR #135649)

2025-04-21 Thread Hubert Tong via cfe-commits
hubert-reinterpretcast wrote: > We used this extension to improve virtual function calling performance, there > are simple and small virtual functions which are frequently called and can > not be eliminated and it is in a delegation thus compiler can not optimize. > > [toplingdb](https://githu

[clang] [llvm] [mlir] [NVPTX] Add support for Shared Cluster Memory address space. (PR #135444)

2025-04-21 Thread via cfe-commits
@@ -280,8 +282,10 @@ NVPTXTargetMachine::getPredicatedAddrSpace(const Value *V) const { case Intrinsic::nvvm_isspacep_local: return std::make_pair(II->getArgOperand(0), llvm::ADDRESS_SPACE_LOCAL); case Intrinsic::nvvm_isspacep_shared: -case Intrinsic::nvvm_is

[clang] Revert "[Fuchsia] Disable PIC" (PR #136617)

2025-04-21 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-gcc-ubuntu-no-asserts` running on `doug-worker-6` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/202/builds/818

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-21 Thread Helena Kotas via cfe-commits
https://github.com/hekota approved this pull request. LGTM! Just a couple of nits. Apologies for the delay, I was on vacation last week. :) https://github.com/llvm/llvm-project/pull/127675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-21 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/127675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-21 Thread Helena Kotas via cfe-commits
@@ -121,15 +121,15 @@ RESOURCE Buffer; // CHECK-SUBSCRIPT-NEXT: DeclRefExpr {{.*}} 'unsigned int' ParmVar {{.*}} 'Index' 'unsigned int' // CHECK-SUBSCRIPT-NEXT: AlwaysInlineAttr {{.*}} Implicit always_inline -// CHECK-NOSUBSCRIPT-NOT: CXXMethodDecl {{.*}} operator[] 'const el

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-21 Thread Helena Kotas via cfe-commits
@@ -89,12 +89,12 @@ RESOURCE Buffer; // CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SUBSCRIPT: CXXMethodDecl {{.*}} operator[] 'const element_type &(unsigned int) const' +// CHECK-SUBSCRIPT: CXXMethodDecl

[clang] [Clang] Add support for GCC bound member functions extension (PR #135649)

2025-04-21 Thread Richard Smith via cfe-commits
zygoloid wrote: > Not sure if anyone has mentioned this elsewhere, but there's a significant > problem with the type of the returned function pointer: a normal function > pointer doesn't necessarily have the correct calling convention. In practice, > this is likely to cause problems on Windows

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-21 Thread Jan Svoboda via cfe-commits
@@ -3349,9 +3351,14 @@ ASTReader::ReadControlBlock(ModuleFile &F, .getModuleCache() .getInMemoryModuleCache() .isPCMFinal(F.FileName); - if (isDiagnosedResult(

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2025-04-21 Thread Trevor Gross via cfe-commits
tgross35 wrote: Talked to arsenm on discord, long discussion starting around here https://discord.com/channels/636084430946959380/636732535434510338/1362207130559578185. The outcome is that this is effectively a target option and needs to be tied to the triple rather than per-module. Which mak

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-21 Thread via cfe-commits
https://github.com/jofrn updated https://github.com/llvm/llvm-project/pull/123609 >From 210b6d80bcfbbcd216f98199df386280724561e2 Mon Sep 17 00:00:00 2001 From: jofernau Date: Mon, 20 Jan 2025 04:51:26 -0800 Subject: [PATCH 01/11] [TargetVerifier][AMDGPU] Add TargetVerifier. This pass verifies

[clang] [llvm] [mlir] [NVPTX] Add support for Shared Cluster Memory address space. (PR #135444)

2025-04-21 Thread Alex MacLean via cfe-commits
@@ -2381,25 +2387,38 @@ def INT_PTX_LDG_G_v4i32_ELE : VLDG_G_ELE_V4<"u32", Int32Regs>; def INT_PTX_LDG_G_v4f32_ELE : VLDG_G_ELE_V4<"f32", Float32Regs>; -multiclass NG_TO_G { - def "" : NVPTXInst<(outs Int32Regs:$result), (ins Int32Regs:$src), - "cvta." # Str # ".u

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-21 Thread via cfe-commits
jofrn wrote: >I don't think it makes sense to have a target-specific "verifier": >verification sets the limits of what optimizations are allowed to do. And that >determination needs to be target-independent, or else target-independent >optimizations can't exist. This would be run during the b

[clang] [Clang] Add support for GCC bound member functions extension (PR #135649)

2025-04-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Yes, I'm very eager for this feature, let me investigate the RFC proposal > routine. I would recommend you also include details about how the extension meets our [usual criteria](https://clang.llvm.org/get_involved.html#criteria) when you write the RFC. https://github.c

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-21 Thread Aaron Ballman via cfe-commits
@@ -2336,16 +2336,9 @@ bool Type::isArithmeticType() const { } bool Type::hasBooleanRepresentation() const { - if (isBooleanType()) -return true; - - if (const EnumType *ET = getAs()) -return ET->getDecl()->getIntegerType()->isBooleanType(); - - if (const AtomicType

[clang] [CIR] Upstream initial support for fixed size VectorType (PR #136488)

2025-04-21 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/136488 >From 5d07a639dc6c933f6f171e501e4ec20d731553e3 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Sat, 19 Apr 2025 21:03:07 +0200 Subject: [PATCH 1/2] [CIR] Upstream initial support for fixed size VectorType

[clang] [CLANG] Enable alignas after GNU attributes (PR #133107)

2025-04-21 Thread Aaron Ballman via cfe-commits
@@ -24,7 +24,7 @@ int templateFunction(T value) __attribute__((annotate("works"))); // CHECK: ClassDecl=Test:3:7 (Definition) Extent=[3:1 - 17:2] // CHECK-NEXT: CXXAccessSpecifier=:4:1 (Definition) Extent=[4:1 - 4:8] -// CHECK-NEXT: CXXMethod=aMethod:5:51 Extent=[5:3 - 5:60]

[clang] 08b0c25 - [Clang] disallow use of attributes before extern template declarations (#136328)

2025-04-21 Thread via cfe-commits
Author: Oleksandr T. Date: 2025-04-21T18:12:07+03:00 New Revision: 08b0c2517eb859667d59873bf04b6aa78a7583a7 URL: https://github.com/llvm/llvm-project/commit/08b0c2517eb859667d59873bf04b6aa78a7583a7 DIFF: https://github.com/llvm/llvm-project/commit/08b0c2517eb859667d59873bf04b6aa78a7583a7.diff

[clang] 52a5332 - [HLSL] Make it possible to assign an array from a cbuffer (#134174)

2025-04-21 Thread via cfe-commits
Author: Sarah Spall Date: 2025-04-21T08:18:56-07:00 New Revision: 52a5332a710d4db22327c3777ebf6873ff20732f URL: https://github.com/llvm/llvm-project/commit/52a5332a710d4db22327c3777ebf6873ff20732f DIFF: https://github.com/llvm/llvm-project/commit/52a5332a710d4db22327c3777ebf6873ff20732f.diff L

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)

2025-04-21 Thread Erich Keane via cfe-commits
erichkeane wrote: >I don't think we can do that, at least for C, because that means this code >would then be accepted when it shouldn't be, right? Yeah, I am not sure we can do this now then. It seems odd to allow calls to builtins to change their return 'type' (or at least, return sugar) bas

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)

2025-04-21 Thread via cfe-commits
YexuanXiao wrote: > > > > Thank you for this! > > > > I'd like to better understand the need for the changes because I have a > > > > few concerns. One concern is about compile time performance. But also, > > > > this means downstream consumers of the AST are going to have to react > > > > bec

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)

2025-04-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > > Thank you for this! > > > > I'd like to better understand the need for the changes because I have a > > > > few concerns. One concern is about compile time performance. But also, > > > > this means downstream consumers of the AST are going to have to react > > > > b

[clang] 1cb82ff - [clang][CIR] Fix various warnings. NFC

2025-04-21 Thread Michael Liao via cfe-commits
Author: Michael Liao Date: 2025-04-21T10:52:23-04:00 New Revision: 1cb82ff9cd95c216f6d8da18637ee47a15bd41f6 URL: https://github.com/llvm/llvm-project/commit/1cb82ff9cd95c216f6d8da18637ee47a15bd41f6 DIFF: https://github.com/llvm/llvm-project/commit/1cb82ff9cd95c216f6d8da18637ee47a15bd41f6.diff

[clang] [Clang] disallow use of attributes before extern template declarations (PR #136328)

2025-04-21 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk closed https://github.com/llvm/llvm-project/pull/136328 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] disallow use of attributes before extern template declarations (PR #136328)

2025-04-21 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk deleted https://github.com/llvm/llvm-project/pull/136328 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-21 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/135573 >From 93c8fc7faba6ab9537039b8745e62f5d79785cd0 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Thu, 17 Apr 2025 23:58:35 +0300 Subject: [PATCH 1/2] [Clang] enhance loop analysis to handle variable cha

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)

2025-04-21 Thread via cfe-commits
YexuanXiao wrote: > > I don't think we can do that, at least for C, because that means this code > > would then be accepted when it shouldn't be, right? > > Yeah, I am not sure we can do this now then. It seems odd to allow calls to > builtins to change their return 'type' (or at least, return

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)

2025-04-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > I don't think we can do that, at least for C, because that means this code > > would then be accepted when it shouldn't be, right? > > Yeah, I am not sure we can do this now then. It seems odd to allow calls to > builtins to change their return 'type' (or at least, retu

[clang-tools-extra] [clang-tide] added `AllowedTypes` option to `readability-qualified-auto` check (PR #136571)

2025-04-21 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/136571 Added `AllowedTypes` option to `readability-qualified-auto` check Fixes https://github.com/llvm/llvm-project/issues/63461. >From 95be4b44cc7ad8f9b30b020ba3083a5267a65202 Mon Sep 17 00:00:00 2001 From: Victor B

[clang-tools-extra] [clang-tide] added `AllowedTypes` option to `readability-qualified-auto` check (PR #136571)

2025-04-21 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/136571 >From 95be4b44cc7ad8f9b30b020ba3083a5267a65202 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 21 Apr 2025 18:29:28 +0300 Subject: [PATCH 1/2] added Allowed types to qualified-auto --- .../readabilit

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-21 Thread via cfe-commits
jofrn wrote: > Does this sound like a viable approach? Yes, it does sound like a good idea. Just added the implementation of `registerVerifierCallbacks`. https://github.com/llvm/llvm-project/pull/123609 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-21 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,175 @@ +#include "llvm/Target/TargetVerify/AMDGPUTargetVerifier.h" + +#include "llvm/Analysis/UniformityAnalysis.h" +#include "llvm/Analysis/PostDominators.h" +#include "llvm/Support/Debug.h" +#include "llvm/IR/Dominators.h" +#include "llvm/IR/Function.h" +#include "llv

[libclc] [libclc] only check filename part of the source for avoiding duplication (PR #135710)

2025-04-21 Thread Wenju He via cfe-commits
wenju-he wrote: > You could just have `cos_fp32.cl` and `cos_fp16.cl`, of course. Yes. To enable overriding generic implementation of `cos.cl`, the names in target folder could be `cos.cl` and `cos_fp16.cl` > I would like to further investigate weak linkage as another means of > overriding sp

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-21 Thread Shilei Tian via cfe-commits
@@ -2040,6 +2043,8 @@ void AMDGPUCodeGenPassBuilder::addIRPasses(AddIRPass &addPass) const { // but EarlyCSE can do neither of them. if (isPassEnabled(EnableScalarIRPasses)) addEarlyCSEOrGVNPass(addPass); + + addPass(AMDGPUTargetVerifierPass()); shilt

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-21 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,175 @@ +//===--- llvm-isel-fuzzer.cpp - Fuzzer for instruction selection --===// shiltian wrote: the file name doesn't match the actual file name https://github.com/llvm/llvm-project/pull/123609 ___

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-21 Thread Shilei Tian via cfe-commits
@@ -1298,6 +1299,8 @@ void AMDGPUPassConfig::addIRPasses() { addPass(createLICMPass()); } + //addPass(AMDGPUTargetVerifierPass()); shiltian wrote: left over https://github.com/llvm/llvm-project/pull/123609 ___

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-21 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,175 @@ +#include "llvm/Target/TargetVerify/AMDGPUTargetVerifier.h" shiltian wrote: This file doesn't have LLVM copyright header https://github.com/llvm/llvm-project/pull/123609 ___ cfe-commits mailing list c

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-21 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,175 @@ +//===--- llvm-isel-fuzzer.cpp - Fuzzer for instruction selection --===// shiltian wrote: also, I wonder why do we need an extra binary for this? https://github.com/llvm/llvm-project/pull/123609

<    1   2   3   4