[clang] [CIR] Make ZeroAttr use AttrBuilderWithInferredContext (PR #136604)

2025-04-21 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/136604 >From a715e75eff27a5b37aca95ef7bbe1c217a1f5463 Mon Sep 17 00:00:00 2001 From: xlauko Date: Mon, 21 Apr 2025 21:51:06 +0200 Subject: [PATCH] [CIR] Make ZeroAttr use AttrBuilderWithInferredContext --- clang/inclu

[clang] [lld] [llvm] [X86] Implement disabling APX relocations and EPGR/NDD instrs for relocations (PR #136660)

2025-04-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-lld Author: Feng Zou (fzou1) Changes Introduce an option (-mapx-relax-relocations) to control the emission of the new APX relocations. It's off by default to keep backward compatibility with old version of ld and other linkers without APX support. And

[clang] [lld] [llvm] [X86] Implement disabling APX relocations and EPGR/NDD instrs for relocations (PR #136660)

2025-04-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-lld-elf @llvm/pr-subscribers-backend-x86 Author: Feng Zou (fzou1) Changes Introduce an option (-mapx-relax-relocations) to control the emission of the new APX relocations. It's off by default to keep backward compatibility with old version of ld and ot

[clang] [lld] [llvm] [X86] Implement disabling APX relocations and EPGR/NDD instrs for relocations (PR #136660)

2025-04-21 Thread Feng Zou via cfe-commits
https://github.com/fzou1 created https://github.com/llvm/llvm-project/pull/136660 Introduce an option (-mapx-relax-relocations) to control the emission of the new APX relocations. It's off by default to keep backward compatibility with old version of ld and other linkers without APX support. A

[clang] [CIR] Make ZeroAttr use AttrBuilderWithInferredContext (PR #136604)

2025-04-21 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/136604 >From 7790612aabf4a310328b16551620edf0704d5453 Mon Sep 17 00:00:00 2001 From: xlauko Date: Mon, 21 Apr 2025 21:51:06 +0200 Subject: [PATCH] [CIR] Make ZeroAttr use AttrBuilderWithInferredContext --- clang/inclu

[clang] [CIR] Make ZeroAttr use AttrBuilderWithInferredContext (PR #136604)

2025-04-21 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/136604 >From 6f59c473e8ecef0aeaa4d9eb02d41d2e97696615 Mon Sep 17 00:00:00 2001 From: xlauko Date: Mon, 21 Apr 2025 21:51:06 +0200 Subject: [PATCH] [CIR] Make ZeroAttr use AttrBuilderWithInferredContext --- clang/inclu

[clang] [CIR] Make ZeroAttr use AttrBuilderWithInferredContext (PR #136604)

2025-04-21 Thread Henrich Lauko via cfe-commits
xlauko wrote: ### Merge activity * **Apr 22, 2:26 AM EDT**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/136604). https://github.com/llvm/llvm-project/pull/136604 _

[libclc] [libclc] Build for OpenCL 3.0 and enable all extensions and features (PR #135733)

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

[libclc] [libclc] Build for OpenCL 3.0 and enable all extensions and features (PR #135733)

2025-04-21 Thread Matt Arsenault via cfe-commits
@@ -429,7 +411,9 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) set( LIBCLC_ARCH_OBJFILE_DIR "${LIBCLC_OBJFILE_DIR}/${arch_suffix}" ) file( MAKE_DIRECTORY ${LIBCLC_ARCH_OBJFILE_DIR} ) -list( APPEND build_flags -cl-std=${opencl_lang_std} ) +# Build for OpenCL 3.0 an

[clang-tools-extra] [clang-doc] Fix clang-tidy naming diagnostics (PR #136444)

2025-04-21 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek approved this pull request. https://github.com/llvm/llvm-project/pull/136444 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix UEFI Target info (PR #127290)

2025-04-21 Thread Petr Hosek via cfe-commits
@@ -3038,8 +3038,30 @@ static Address EmitX86_64VAArgFromMemory(CodeGenFunction &CGF, return Address(Res, LTy, Align); } +static RValue EmitMSABIVAArg(CodeGenFunction &CGF, Address VAListAddr, + QualType Ty, AggValueSlot Slot, +

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

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

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-21 Thread David Rivera via cfe-commits
RiverDave wrote: > Please add a unit test demonstrating that the related issue is fixed. Added 👍 https://github.com/llvm/llvm-project/pull/134774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-21 Thread David Rivera via cfe-commits
@@ -122,7 +122,10 @@ void UseDesignatedInitializersCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( initListExpr( hasType(cxxRecordDecl(RestrictToPODTypes ? isPOD() : isAggregate(), -unless(HasBaseWithFields))

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-21 Thread David Rivera via cfe-commits
@@ -182,6 +182,11 @@ Changes in existing checks ``constexpr`` and ``static``` values on member initialization and by detecting explicit casting of built-in types within member list initialization. +- Improved :doc:`modernize-use-designated-initializers + ` check by avoid

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-21 Thread David Rivera via cfe-commits
https://github.com/RiverDave updated https://github.com/llvm/llvm-project/pull/134774 >From 5dc7aa51c52b2fd31c182af964152765bed72ec7 Mon Sep 17 00:00:00 2001 From: David Rivera Date: Mon, 7 Apr 2025 23:21:50 -0400 Subject: [PATCH] [clang-tidy] Avoid diagnosing std::array initializations for mo

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

2025-04-21 Thread Sirui Mu via cfe-commits
@@ -0,0 +1,105 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals all --version 5 +// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wno-pmf-conversions %s -O3 -emit-llvm -o - | FileCheck %s + +struct A { + int data; +//. +//

[clang] [llvm] [RISCV] Add smcntrpmf extension (PR #136556)

2025-04-21 Thread Liao Chunyu via cfe-commits
https://github.com/ChunyuLiao closed https://github.com/llvm/llvm-project/pull/136556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9e26c79 - [RISCV] Add smcntrpmf extension (#136556)

2025-04-21 Thread via cfe-commits
Author: Liao Chunyu Date: 2025-04-22T12:34:39+08:00 New Revision: 9e26c797ae9699fba8bd62af99ab3ad6f9b16462 URL: https://github.com/llvm/llvm-project/commit/9e26c797ae9699fba8bd62af99ab3ad6f9b16462 DIFF: https://github.com/llvm/llvm-project/commit/9e26c797ae9699fba8bd62af99ab3ad6f9b16462.diff L

[clang] [llvm] [RISCV] Add smcntrpmf extension (PR #136556)

2025-04-21 Thread Craig Topper via cfe-commits
https://github.com/topperc approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/136556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Define convergence in C++ languages such as HIP, CUDA, OpenCL (PR #136280)

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

[clang] [clang] Define convergence in C++ languages such as HIP, CUDA, OpenCL (PR #136280)

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

[clang] [llvm] [RISCV] Add smcntrpmf extension (PR #136556)

2025-04-21 Thread Liao Chunyu via cfe-commits
https://github.com/ChunyuLiao updated https://github.com/llvm/llvm-project/pull/136556 >From 43e266b5a8f51ecd79df3156b20b48762699afd4 Mon Sep 17 00:00:00 2001 From: Liao Chunyu Date: Mon, 21 Apr 2025 04:18:56 -0400 Subject: [PATCH] [RISCV] Add smcntrpmf extension spec: https://github.com/riscv

[libclc] [libclc] Build for OpenCL 3.0 and enable all extensions and features (PR #135733)

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

[clang] [CUDA][HIP] capture possible ODR-used var (PR #136645)

2025-04-21 Thread Yaxun Liu via cfe-commits
@@ -14706,6 +14706,8 @@ ExprResult Sema::BuildOverloadedCallExpr(Scope *S, Expr *Fn, // the UnresolvedLookupExpr was type-dependent. if (OverloadResult == OR_Success) { const FunctionDecl *FDecl = Best->Function; +if (LangOpts.CUDA) yxsamliu wrote:

[clang] [CUDA][HIP] capture possible ODR-used var (PR #136645)

2025-04-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Yaxun (Sam) Liu (yxsamliu) Changes In a lambda function, a call of a function may resolve to host and device functions with different signatures. Especially, a constexpr local variable may be passed by value by the device function and passe

[clang] [CUDA][HIP] capture possible ODR-used var (PR #136645)

2025-04-21 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/136645 In a lambda function, a call of a function may resolve to host and device functions with different signatures. Especially, a constexpr local variable may be passed by value by the device function and passed by r

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

2025-04-21 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > > IIRC this feature is orthogonal to GCC bound member functions. `declcall` > > with a virtual method just returns a pmf, and we still need to perform > > vtable lookup at the callsite: https://compiler-explorer.com/z/YrT3nPTEz > > Try `declcall(p->B::virtual_method())`?: > h

[clang-tools-extra] [clangd] Improve `BlockEnd` inlayhint presentation (PR #136106)

2025-04-21 Thread via cfe-commits
https://github.com/MythreyaK updated https://github.com/llvm/llvm-project/pull/136106 >From d03c7afdd497011335590448fef886395cc815d2 Mon Sep 17 00:00:00 2001 From: daiyousei-qz Date: Tue, 14 Nov 2023 20:42:10 -0800 Subject: [PATCH 1/5] Improve BlockEnd presentation including: 1. Explicitly sta

[clang] [Clang] Improve error recovery for invalid calls (PR #136295)

2025-04-21 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/136295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] b144258 - [Clang] Improve error recovery for invalid calls (#136295)

2025-04-21 Thread via cfe-commits
Author: Younan Zhang Date: 2025-04-22T10:41:16+08:00 New Revision: b144258b0c0cc63dffba00a911d6539f00ed07bb URL: https://github.com/llvm/llvm-project/commit/b144258b0c0cc63dffba00a911d6539f00ed07bb DIFF: https://github.com/llvm/llvm-project/commit/b144258b0c0cc63dffba00a911d6539f00ed07bb.diff

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

2025-04-21 Thread via cfe-commits
rockeet 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. Thank you

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

2025-04-21 Thread Hubert Tong via cfe-commits
hubert-reinterpretcast wrote: > IIRC this feature is orthogonal to GCC bound member functions. `declcall` > with a virtual method just returns a pmf, and we still need to perform vtable > lookup at the callsite: https://compiler-explorer.com/z/YrT3nPTEz Try `declcall(p->B::virtual_method())`?:

[libclc] [libclc] Build for OpenCL 3.0 and enable all extensions and features (PR #135733)

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

[libclc] [libclc] Set OpenCL C version for each target (PR #135733)

2025-04-21 Thread Wenju He via cfe-commits
wenju-he wrote: > > LGTM. That means we compile for the last OpenCL version, which is 3.0, and > > enable all OpenCL extensions/features, right? > > Yes. Otherwise you have to still write the code to work with the lowest > common denominator. done in commit https://github.com/llvm/llvm-proje

[libclc] [libclc] Set OpenCL C version for each target (PR #135733)

2025-04-21 Thread Wenju He via cfe-commits
wenju-he wrote: > An OpenCL 1.2 module could still call a builtin that makes internal use of > CLC `ctz`, for example. Yes, you're right. https://github.com/llvm/llvm-project/pull/135733 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[libclc] [libclc] Set OpenCL C version for each target (PR #135733)

2025-04-21 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/135733 >From 64d7bfdceb5a0a6fbf34bb15cd7d6cbeb9214881 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Mon, 14 Apr 2025 19:20:25 -0700 Subject: [PATCH 1/5] [libclc] Set OpenCL version to 3.0 This PR is cherry-pick of ht

[clang] cuda clang: Move nvptx-surface.cu test to CodeGenCUDA (PR #134758)

2025-04-21 Thread Austin Schuh via cfe-commits
AustinSchuh wrote: @Artem-B , 2 things. 1) Looks like I was too slow and had to fix merge conflicts. Please take another look. 2) Can you submit? I don't have submit permission yet, and realistically, unless you've got more requests for improvements to surface support, odds are low I'll be

[clang] [llvm] [RISCV] Add smcntrpmf extension (PR #136556)

2025-04-21 Thread Jim Lin via cfe-commits
@@ -1453,6 +1454,14 @@ // RUN: -o - | FileCheck --check-prefix=CHECK-SMCSRIND-EXT %s // CHECK-SMCSRIND-EXT: __riscv_smcsrind 100{{$}} +// RUN: %clang --target=riscv32 \ tclin914 wrote: Put the test for `smcntrpmf` above for `smcsrind` https://github.

[clang] [Clang] Improve error recovery for invalid calls (PR #136295)

2025-04-21 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/136295 >From 8efadc35d64f2724d5610a7ae66fa70a7c8e3d46 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 18 Apr 2025 19:20:49 +0800 Subject: [PATCH 1/2] [Clang] Improve error recovery for invalid calls It doesn't

[clang] cuda clang: Move nvptx-surface.cu test to CodeGenCUDA (PR #134758)

2025-04-21 Thread Austin Schuh via cfe-commits
https://github.com/AustinSchuh updated https://github.com/llvm/llvm-project/pull/134758 >From 1e6367407a4b23b2a85f088ba4b66a0c0afc8faa Mon Sep 17 00:00:00 2001 From: Austin Schuh Date: Mon, 7 Apr 2025 17:18:38 -0700 Subject: [PATCH 1/2] cuda clang: Move nvptx-surface.cu test to CodeGenCUDA Sig

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

2025-04-21 Thread Yingwei Zheng via cfe-commits
dtcxzyw 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://github.com

[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

[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
@@ -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
@@ -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
@@ -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" + +#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 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 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] [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
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] [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] [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] 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] [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] [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
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
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] 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] [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] [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][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
@@ -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
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] [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] [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] [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] [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 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 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
@@ -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
@@ -3311,12 +3314,11 @@ ASTReader::ReadControlBlock(ModuleFile &F, SignatureBytes.end()); Blob = Blob.substr(ASTFileSignature::size); -if (ImportedFile.empty()) { - // Use BaseDirectoryAsWritten to ens

[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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
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
@@ -6165,6 +6254,18 @@ bool UnnamedLocalNoLinkageFinder::VisitHLSLAttributedResourceType( return Visit(T->getWrappedType()); } +bool UnnamedLocalNoLinkageFinder::VisitHLSLInlineSpirvType( +const HLSLInlineSpirvType *T) { + for (auto &Operand : T->getOperands()) { +

[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] [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] 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=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 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] [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

  1   2   3   4   >