[clang] [NFC] [dataflow] generalize smart pointer caching (PR #133350)

2025-03-27 Thread Florian Mayer via cfe-commits
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/133350 >From 8ece858e76fad0962b2567f03bf80bcaf2828348 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 27 Mar 2025 18:25:23 -0700 Subject: [PATCH 1/5] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UT

[clang] [llvm] Reland [MIPS] Define SubTargetFeature for i6500 cpu (#132907) (PR #133366)

2025-03-27 Thread Mallikarjuna Gouda via cfe-commits
https://github.com/mgoudar created https://github.com/llvm/llvm-project/pull/133366 Relands #132907 with a fix in the testcase: clang/test/CodeGen/Mips/subtarget-feature-test.c enable this test for only mips64 target PR #130587 defined same SubTargetFeature for CPUs i6400 and i6500 which resul

[clang] [Clang] Link libgcc_s.1.dylib when building for macOS 10.5 and older (PR #124651)

2025-03-27 Thread via cfe-commits
https://github.com/Un1q32 updated https://github.com/llvm/llvm-project/pull/124651 >From d4e97c4113086c3d2dfa3bf6e9ecfee377f8c4b6 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Mon, 27 Jan 2025 18:00:34 -0500 Subject: [PATCH 1/3] [Clang] Link libgcc_s.1.dylib when building for macOS 10.5 and olde

[clang] [llvm] Hlsl asuint16 function (PR #132315)

2025-03-27 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,52 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -verify + +uint16_t test_asuint16_less_argument() +{ +return asuint16(); + // expected-error@-1 {{no matching function for call to 'asuint16'}} + // ex

[clang] [clang-repl] Implement LoadDynamicLibrary for clang-repl wasm use cases (PR #133037)

2025-03-27 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 updated https://github.com/llvm/llvm-project/pull/133037 >From dfe49e826705a5e9371e17e66e40c31602beea8e Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Wed, 26 Mar 2025 10:33:37 +0530 Subject: [PATCH 1/3] Implement LoadDynamicLibrary for clang-repl wasm use cases

[clang] [PATCH] [clang][frontend] Fix AllocKind retrieving for `CXXConstructorDecl` refs #132794 (PR #133077)

2025-03-27 Thread Paul Schwabauer via cfe-commits
@@ -2601,10 +2601,11 @@ class CXXConstructorDecl final void anchor() override; size_t numTrailingObjects(OverloadToken) const { -return CXXConstructorDeclBits.IsInheritingConstructor; +return getCanonicalDecl()->CXXConstructorDeclBits.IsInheritingConstructor; }

[clang] [compiler-rt] Reland [Coverage] Fix region termination for GNU statement expressions (PR #132222)

2025-03-27 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-pgo Author: Justin Cady (justincady) Changes Relands #130976 with adjustments to test requirements. Calls to __noreturn__ functions result in region termination for coverage mapping. But this creates incorrect coverage results when __noreturn__ function

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-27 Thread Martin Uecker via cfe-commits
uecker wrote: > It seems to me that we could simplify the implementation by being a bit more > literal in the interpretation of the requirements: look only at the type, > alignment, name, and bitfield-width of members. Just don't bother checking > other stuff > > I'd hope it can look more lik

[clang] [Clang] Correct the DeclRefExpr's Type after the initializer gets instantiated (PR #133212)

2025-03-27 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/133212 >From 34632d01840af89745dc79d27e06bd86aeb04c84 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Thu, 27 Mar 2025 13:58:36 +0800 Subject: [PATCH 1/3] [Clang] Correct the DeclRefExpr's Type after the initializer

[clang] [Clang] Correct the DeclRefExpr's Type after the initializer gets instantiated (PR #133212)

2025-03-27 Thread Younan Zhang via cfe-commits
@@ -19849,11 +19849,14 @@ static void DoMarkVarDeclReferenced( SemaRef.InstantiateVariableDefinition(PointOfInstantiation, Var); }); -// Re-set the member to trigger a recomputation of the dependence bits -// for the expression. -if (a

[clang] [PATCH] [clang][frontend] Fix AllocKind retrieving for `CXXConstructorDecl` refs #132794 (PR #133077)

2025-03-27 Thread via cfe-commits
@@ -316,6 +316,7 @@ Bug Fixes in This Version - Fixed a modules crash where exception specifications were not propagated properly (#GH121245, relanded in #GH129982) - Fixed a problematic case with recursive deserialization within ``FinishedDeserializing()`` where ``PassInte

[clang] [Clang] Correct the DeclRefExpr's Type after the initializer gets instantiated (PR #133212)

2025-03-27 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/133212 >From 34632d01840af89745dc79d27e06bd86aeb04c84 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Thu, 27 Mar 2025 13:58:36 +0800 Subject: [PATCH 1/3] [Clang] Correct the DeclRefExpr's Type after the initializer

[libclc] [libclc] Move log1p/asinh/acosh/atanh to the CLC library (PR #132956)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/132956 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

[clang] [Clang] Correct the DeclRefExpr's Type after the initializer gets instantiated (PR #133212)

2025-03-27 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/133212 >From 34632d01840af89745dc79d27e06bd86aeb04c84 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Thu, 27 Mar 2025 13:58:36 +0800 Subject: [PATCH 1/4] [Clang] Correct the DeclRefExpr's Type after the initializer

[libclc] [libclc] Pass -fapprox-func when compiling 'native' builtins (PR #133119)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/133119 >From afb5cf51ce0b2de2a3d58dbd493c80173e970fac Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 26 Mar 2025 16:18:34 + Subject: [PATCH 1/2] [libclc] Pass -fapprox-func when compiling 'native' bu

[libclc] [libclc] Pass -fapprox-func when compiling 'native' builtins (PR #133119)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/133119 >From afb5cf51ce0b2de2a3d58dbd493c80173e970fac Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 26 Mar 2025 16:18:34 + Subject: [PATCH 1/4] [libclc] Pass -fapprox-func when compiling 'native' bu

[libclc] [libclc] Pass -fapprox-func when compiling 'native' builtins (PR #133119)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/133119 >From afb5cf51ce0b2de2a3d58dbd493c80173e970fac Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 26 Mar 2025 16:18:34 + Subject: [PATCH 1/3] [libclc] Pass -fapprox-func when compiling 'native' bu

[libclc] [libclc] Move atan2/atan2pi to the CLC library (PR #133226)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/133226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm] Add triples for managarm (PR #87845)

2025-03-27 Thread via cfe-commits
https://github.com/no92 updated https://github.com/llvm/llvm-project/pull/87845 >From 696b5b24601d2ef773833a9e4b2336107efd586c Mon Sep 17 00:00:00 2001 From: no92 Date: Fri, 6 Sep 2024 21:17:53 +0200 Subject: [PATCH 1/3] [llvm] Add managarm OS target --- llvm/include/llvm/ADT/bit.h

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/133125 >From 75ef42d644da9136fb07014ade18b6be137426a1 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 26 Mar 2025 12:54:29 -0400 Subject: [PATCH 1/5] [C2y] Implement WG14 N3369 and N3469 (_Countof) C2y ad

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/133125 >From 75ef42d644da9136fb07014ade18b6be137426a1 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 26 Mar 2025 12:54:29 -0400 Subject: [PATCH 1/6] [C2y] Implement WG14 N3369 and N3469 (_Countof) C2y ad

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread via cfe-commits
@@ -0,0 +1,68 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c2y -pedantic -Wall -Wno-comment -verify %s + +/* WG14 N3369: Clang 21 + * _Lengthof operator + * + * Adds an operator to get the length of an array. Note that WG14 N3469 renamed + * this operator to _Countof. + */ -

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread via cfe-commits
@@ -14926,6 +14926,42 @@ bool IntExprEvaluator::VisitUnaryExprOrTypeTraitExpr( return false; } + case UETT_CountOf: { +QualType Ty = E->getTypeOfArgument(); +assert(Ty->isArrayType()); + +// We don't need to worry about array element qualifiers, so getting t

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread via cfe-commits
@@ -0,0 +1,68 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c2y -pedantic -Wall -Wno-comment -verify %s + +/* WG14 N3369: Clang 21 + * _Lengthof operator + * + * Adds an operator to get the length of an array. Note that WG14 N3469 renamed + * this operator to _Countof. + */ -

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-27 Thread Martin Uecker via cfe-commits
@@ -450,6 +453,116 @@ class StmtComparer { }; } // namespace +static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, + const Attr *Attr1, const Attr *Attr2) { + // Two attributes are structurally equivalent if they are

[clang] [llvm] [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #133173)

2025-03-27 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > If split stacks are negatively impacting profiling, debugging, or other > compiler development tasks, I have to ask, have we considered optimizing > clang stack usage? Strong +1 to this. > Apple platforms and tools are known to support this, so this only enables it > th

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread via cfe-commits
cor3ntin wrote: > There is weak consensus to add `stdcountof.h` which supplies a `countof` > macro. However, there's no changes to the standard which add one (yet), so I > figured that can be done in a follow-up. Then I'd really like a feature. We already have a bunch, It makes sense to add on

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-27 Thread Aaron Ballman via cfe-commits
@@ -450,6 +453,116 @@ class StmtComparer { }; } // namespace +static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, + const Attr *Attr1, const Attr *Attr2) { + // Two attributes are structurally equivalent if they are

[libclc] [libclc] Move atan2/atan2pi to the CLC library (PR #133226)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/133226 As with other work in this area, these builtins are now vectorized. A further table has been split into two. There was discrepancy between comments above the table describing the values as "lead" and "tail"

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread Aaron Ballman via cfe-commits
@@ -14926,6 +14926,42 @@ bool IntExprEvaluator::VisitUnaryExprOrTypeTraitExpr( return false; } + case UETT_CountOf: { +QualType Ty = E->getTypeOfArgument(); +assert(Ty->isArrayType()); + +// We don't need to worry about array element qualifiers, so getting t

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > There is weak consensus to add `stdcountof.h` which supplies a `countof` > > macro. However, there's no changes to the standard which add one (yet), so > > I figured that can be done in a follow-up. > > Then I'd really like a feature. We already have a bunch, It makes s

[libclc] [libclc] Move atan2/atan2pi to the CLC library (PR #133226)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/133226 >From 497781f9fe1d1750d37a36948be285cdb6c14b04 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 25 Mar 2025 18:19:38 + Subject: [PATCH 1/2] [libclc] Move atan2/atan2pi to the CLC library --- li

[libclc] [libclc] Pass -fapprox-func when compiling 'native' builtins (PR #133119)

2025-03-27 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: I've pushed an update with uses the `COMPILE_OPTIONS` property. It's definitely better, thanks for the suggestion. It would be best if there were `CMakeLists.txt` in each sub-directory which added the properties. However, because we currently have this system where targets

[libclc] [libclc] Move __clc_(remainder|fmod|remquo) to the CLC library (PR #132054)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/132054 >From e480113652a1a371e296192d4e1460af26a8a436 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 19 Mar 2025 14:52:09 + Subject: [PATCH 1/3] [libclc] Move __clc_remainder to CLC library It was al

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread Aaron Ballman via cfe-commits
@@ -14926,6 +14926,42 @@ bool IntExprEvaluator::VisitUnaryExprOrTypeTraitExpr( return false; } + case UETT_CountOf: { AaronBallman wrote: I'll add support for this there. https://github.com/llvm/llvm-project/pull/133125 ___

[clang] [llvm] [RISCV] Add MC layer support for XSfmm*. (PR #133031)

2025-03-27 Thread Pengcheng Wang via cfe-commits
wangpc-pp wrote: > > but won't merge them until they are ratified just like Zvzip/Zvabd/Zibimm > > I think this patch is supported to be the vendor instruction set of `SiFive > Xsfmm* Attached Matrix Extensions` if I understand correctly of this PR. > > AME is another issue that we don’t have

[clang] [CIR] Upstream CmpOp (PR #133159)

2025-03-27 Thread Henrich Lauko via cfe-commits
@@ -710,6 +710,89 @@ class ScalarExprEmitter : public StmtVisitor { HANDLEBINOP(Xor) HANDLEBINOP(Or) #undef HANDLEBINOP + + mlir::Value emitCmp(const BinaryOperator *e) { +mlir::Value result; +QualType lhsTy = e->getLHS()->getType(); +QualType rhsTy = e->getRH

[clang] [llvm] [RISCV] Add MC layer support for XSfmm*. (PR #133031)

2025-03-27 Thread Jiuyang Liu via cfe-commits
sequencer wrote: > SiFive's AME proposal locates in OP-V/OP-VE category Yes, this is a good point. I do think we should also remove other vendor instruction sets which abused the standard op fields. https://github.com/llvm/llvm-project/pull/133031 _

[clang] [llvm] Revert "[MIPS] Define SubTargetFeature for i6500 cpu" (PR #133215)

2025-03-27 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Djordje Todorovic (djtodoro) Changes Reverts llvm/llvm-project#132907 due to some test failures. --- Full diff: https://github.com/llvm/llvm-project/pull/133215.diff 3 Files Affected: - (removed) clang/test/CodeGen/Mips/subtarget-featur

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,68 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c2y -pedantic -Wall -Wno-comment -verify %s + +/* WG14 N3369: Clang 21 + * _Lengthof operator + * + * Adds an operator to get the length of an array. Note that WG14 N3469 renamed + * this operator to _Countof. + */ -

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread Aaron Ballman via cfe-commits
@@ -141,6 +141,12 @@ C2y Feature Support paper also introduced octal and hexadecimal delimited escape sequences (e.g., ``"\x{12}\o{12}"``) which are also supported as an extension in older C language modes. +- Implemented `WG14 N3369

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread via cfe-commits
cor3ntin wrote: > So you want this to be a FEATURE in C2y and an EXTENSION in older language > modes? Presumably yes. > And when we get the countof macro in a few months, this becomes unnecessary? Are most users going to include `stdcountof.h` ? My assumption is that they would not, so havi

[clang] [RFC][clang] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-03-27 Thread Dmitry Polukhin via cfe-commits
@@ -2572,7 +2572,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl( // Friend function defined withing class template may stop being function // definition during AST merges from different modules, in this case decl // with function body should be used for instantiat

[clang] [flang] [flang] Expose -m32 and -m64 options (PR #132409)

2025-03-27 Thread Jean-Didier PAILLEUX via cfe-commits
https://github.com/JDPailleux updated https://github.com/llvm/llvm-project/pull/132409 >From 9522fe01070c44cdb5562b048aa94d68a8117fd1 Mon Sep 17 00:00:00 2001 From: Jean-Didier Pailleux Date: Tue, 18 Mar 2025 14:51:05 +0100 Subject: [PATCH] [flang] Expose -m64 option --- clang/include/clang/D

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

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

[clang] [flang] [libcxx] [llvm] [llvm-reduce]: print short form, actionable names in the log (PR #132813)

2025-03-27 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: None (YLChenZ) Changes Closes #132696. before the patch like this: ``` *** Reducing GlobalObjects... *** Reducing GV Initializers... *** Reducin

[clang] [flang] [flang] Expose -m32 and -m64 options (PR #132409)

2025-03-27 Thread Jean-Didier PAILLEUX via cfe-commits
https://github.com/JDPailleux updated https://github.com/llvm/llvm-project/pull/132409 >From 10add8793e15a4767c772556763a8c063c0eb667 Mon Sep 17 00:00:00 2001 From: Jean-Didier Pailleux Date: Tue, 18 Mar 2025 14:51:05 +0100 Subject: [PATCH] [flang] Expose -m64 option --- clang/include/clang/D

[clang] Fix complex long division with -mno-x87. (PR #133152)

2025-03-27 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam edited https://github.com/llvm/llvm-project/pull/133152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-27 Thread Martin Uecker via cfe-commits
@@ -450,6 +453,116 @@ class StmtComparer { }; } // namespace +static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, + const Attr *Attr1, const Attr *Attr2) { + // Two attributes are structurally equivalent if they are

[clang-tools-extra] [clang-tidy][misc-const-correctness] fix fp when using const array type. (PR #133018)

2025-03-27 Thread Carlos Galvez via cfe-commits
@@ -1007,3 +1007,11 @@ template void f() { x[T{}] = 3; } } // namespace gh127776_false_positive + +namespace gh132931_false_positive { +using T = const int; +void valid(int i) { + const int arr0[] = {1, 2, 3}; + T arr1[] = {1, 2, 3}; carlosgalvezp wrote:

[clang] [PATCH] [clang][frontend] Fix AllocKind retrieving for `CXXConstructorDecl` refs #132794 (PR #133077)

2025-03-27 Thread via cfe-commits
@@ -316,6 +316,7 @@ Bug Fixes in This Version - Fixed a modules crash where exception specifications were not propagated properly (#GH121245, relanded in #GH129982) - Fixed a problematic case with recursive deserialization within ``FinishedDeserializing()`` where ``PassInte

[clang-tools-extra] [clang-tidy][misc-const-correctness] fix fp when using const array type. (PR #133018)

2025-03-27 Thread Carlos Galvez via cfe-commits
@@ -1007,3 +1007,11 @@ template void f() { x[T{}] = 3; } } // namespace gh127776_false_positive + +namespace gh132931_false_positive { +using T = const int; +void valid(int i) { + const int arr0[] = {1, 2, 3}; + T arr1[] = {1, 2, 3}; carlosgalvezp wrote:

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-27 Thread Aaron Ballman via cfe-commits
@@ -450,6 +453,116 @@ class StmtComparer { }; } // namespace +static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, + const Attr *Attr1, const Attr *Attr2) { + // Two attributes are structurally equivalent if they are

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,68 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c2y -pedantic -Wall -Wno-comment -verify %s + +/* WG14 N3369: Clang 21 + * _Lengthof operator + * + * Adds an operator to get the length of an array. Note that WG14 N3469 renamed + * this operator to _Countof. + */ -

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread Aaron Ballman via cfe-commits
@@ -4338,6 +4338,21 @@ bool Sema::CheckUnaryExprOrTypeTraitOperand(Expr *E, E->getSourceRange(), ExprKind)) return true; + if (ExprKind == UETT_CountOf) { +// The type has to be an array type. We already checked for incomplete +

[clang-tools-extra] [clang-tidy][misc-const-correctness] fix fp when using const array type. (PR #133018)

2025-03-27 Thread Carlos Galvez via cfe-commits
@@ -89,6 +89,8 @@ void ConstCorrectnessCheck::registerMatchers(MatchFinder *Finder) { const auto ConstReference = hasType(references(isConstQualified())); carlosgalvezp wrote: All the tests (including the FP at hand) pass if you remove `unless(arrayType()` f

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread Aaron Ballman via cfe-commits
@@ -14926,6 +14926,42 @@ bool IntExprEvaluator::VisitUnaryExprOrTypeTraitExpr( return false; } + case UETT_CountOf: { +QualType Ty = E->getTypeOfArgument(); +assert(Ty->isArrayType()); + +// We don't need to worry about array element qualifiers, so getting t

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-27 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj closed https://github.com/llvm/llvm-project/pull/131985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Correct the DeclRefExpr's Type after the initializer gets instantiated (PR #133212)

2025-03-27 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. Thanks https://github.com/llvm/llvm-project/pull/133212 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] a967251 - [Clang] Correct the DeclRefExpr's Type after the initializer gets instantiated (#133212)

2025-03-27 Thread via cfe-commits
Author: Younan Zhang Date: 2025-03-27T19:40:02+08:00 New Revision: a9672515ce6b8b1bc6976ed1225f4fb4d53fa381 URL: https://github.com/llvm/llvm-project/commit/a9672515ce6b8b1bc6976ed1225f4fb4d53fa381 DIFF: https://github.com/llvm/llvm-project/commit/a9672515ce6b8b1bc6976ed1225f4fb4d53fa381.diff

[clang] [RFC][clang] Fix for regression #130917 (PR #132214)

2025-03-27 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Dmitry Polukhin (dmpolukhin) Changes Changes in #111992 was too broad. This change reduces scope of previous fix. Unfortunately in clang there is no way to know when redeclaration was craeted artificially due to AST mergse and when it was

[clang] [Clang] Correct the DeclRefExpr's Type after the initializer gets instantiated (PR #133212)

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

[libclc] [libclc] Move atan2/atan2pi to the CLC library (PR #133226)

2025-03-27 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/133226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] 3284559 - [libclc] Move atan2/atan2pi to the CLC library (#133226)

2025-03-27 Thread via cfe-commits
Author: Fraser Cormack Date: 2025-03-27T10:59:09Z New Revision: 3284559cca4bc64e78e8243bb34195216e8979ee URL: https://github.com/llvm/llvm-project/commit/3284559cca4bc64e78e8243bb34195216e8979ee DIFF: https://github.com/llvm/llvm-project/commit/3284559cca4bc64e78e8243bb34195216e8979ee.diff LOG

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/133125 >From 75ef42d644da9136fb07014ade18b6be137426a1 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 26 Mar 2025 12:54:29 -0400 Subject: [PATCH 1/7] [C2y] Implement WG14 N3369 and N3469 (_Countof) C2y ad

[clang] [Clang] Correct the DeclRefExpr's Type after the initializer gets instantiated (PR #133212)

2025-03-27 Thread via cfe-commits
@@ -19849,11 +19849,14 @@ static void DoMarkVarDeclReferenced( SemaRef.InstantiateVariableDefinition(PointOfInstantiation, Var); }); -// Re-set the member to trigger a recomputation of the dependence bits -// for the expression. -if (a

[clang] [NFC][clang] Remove superfluous header files after refactor in #132252 (PR #132495)

2025-03-27 Thread Jonathan Thackray via cfe-commits
jthackray wrote: > How'd you manage to find the right ones? IMO we should be using > include-what-you-use on these to make sure we get it right (if you have > already, disregard this). Yes, I used iwyu. > Also, can you share before-split/after-split/after-this build time > benchmarks? Does

[clang] [llvm] [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #133173)

2025-03-27 Thread via cfe-commits
cor3ntin wrote: > > If split stacks are negatively impacting profiling, debugging, or other > > compiler development tasks, I have to ask, have we considered optimizing > > clang stack usage? > > Strong +1 to this. I removed a few uses of ParsedAttributes recently, it helped https://github.c

[clang] [llvm] [llvm] Add triples for managarm (PR #87845)

2025-03-27 Thread via cfe-commits
no92 wrote: Rebased on main, pinging @MaskRay for re-review. https://github.com/llvm/llvm-project/pull/87845 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Pass -fapprox-func when compiling 'native' builtins (PR #133119)

2025-03-27 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > set_source_files_properties That's true but since we're compiling with custom commands (I think) the properties won't automatically get picked up. That said, we could perhaps set the properties as you suggest and retrieve them with `get_source_file_property`. We'd still n

[clang] [Clang] Improve subsumption. (PR #132849)

2025-03-27 Thread via cfe-commits
@@ -170,102 +132,112 @@ struct alignas(ConstraintAlignment) FoldExpandedConstraint { const Expr *Pattern) : Kind(K), Constraint(std::move(C)), Pattern(Pattern) {}; - template - bool subsumes(const FoldExpandedConstraint &Other, -

[libclc] [libclc] Move fmod, remainder & remquo to the CLC library (PR #132054)

2025-03-27 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited https://github.com/llvm/llvm-project/pull/132054 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIR-V] Add hlsl_private address space for HLSL/SPIR-V (PR #122103)

2025-03-27 Thread Nathan Gauër via cfe-commits
@@ -5386,6 +5386,23 @@ LangAS CodeGenModule::GetGlobalVarAddressSpace(const VarDecl *D) { if (OpenMPRuntime->hasAllocateAttributeForGlobalVar(D, AS)) return AS; } + + if (LangOpts.HLSL) { +if (D == nullptr) + return LangAS::hlsl_private; + +// Except

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread via cfe-commits
@@ -14926,6 +14926,42 @@ bool IntExprEvaluator::VisitUnaryExprOrTypeTraitExpr( return false; } + case UETT_CountOf: { +QualType Ty = E->getTypeOfArgument(); +assert(Ty->isArrayType()); + +// We don't need to worry about array element qualifiers, so getting t

[clang] [HLSL][SPIR-V] Add hlsl_private address space for HLSL/SPIR-V (PR #122103)

2025-03-27 Thread Nathan Gauër via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -std=hlsl202x -emit-llvm -o - -disable-llvm-passes %s | FileCheck %s --check-prefixes=CHECK +// RUN: %clang_cc1 -triple spirv-pc-vulkan1.3-compute -std=hlsl202x -emit-llvm -o - -disable-llvm-passes %s |

[clang] [HLSL][SPIR-V] Add hlsl_private address space for HLSL/SPIR-V (PR #122103)

2025-03-27 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts updated https://github.com/llvm/llvm-project/pull/122103 From c11ace708fab316f422e12cf9785a5a362d7250c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= Date: Thu, 28 Nov 2024 15:00:56 +0100 Subject: [PATCH 1/3] [SPIR-V] Add hlsl_private address space for

[clang] [SYCL] Basic code generation for SYCL kernel caller offload entry point functions. (PR #133030)

2025-03-27 Thread Fraser Cormack via cfe-commits
@@ -229,6 +229,12 @@ class CodeGenTypes { const CGFunctionInfo &arrangeBuiltinFunctionCall(QualType resultType, const CallArgList &args); + /// A SYCL device kernel function is a free standing function with + /// spir_kern

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Objects (PR #131969)

2025-03-27 Thread David Rivera via cfe-commits
RiverDave wrote: Ping https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-27 Thread Michael Kruse via cfe-commits
@@ -44,23 +44,19 @@ MDNode *LoopInfo::createPipeliningMetadata(const LoopAttributes &Attrs, else if (Attrs.PipelineInitiationInterval != 0) Enabled = true; + SmallVector Args; + Args.append(LoopProperties.begin(), LoopProperties.end()); + if (Enabled != true) { -

[clang] [analyzer] Add metrics tracking time spent in Z3 solver (PR #133236)

2025-03-27 Thread Balázs Benics via cfe-commits
https://github.com/balazs-benics-sonarsource created https://github.com/llvm/llvm-project/pull/133236 These metrics would turn out to be useful for verifying an upgrade of Z3. From 5fe04bcbb3eaf5682037ada6ab64fd7e021f787e Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Thu, 27 Mar 2025 12:1

[clang] [analyzer] Add metrics tracking time spent in Z3 solver (PR #133236)

2025-03-27 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Balázs Benics (balazs-benics-sonarsource) Changes These metrics would turn out to be useful for verifying an upgrade of Z3. --- Full diff: https://github.com/llvm/llvm-project/pull/133236.diff 2 Files Affected: - (modi

[clang] [clang-repl] Implement LoadDynamicLibrary for clang-repl wasm use cases (PR #133037)

2025-03-27 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 edited https://github.com/llvm/llvm-project/pull/133037 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/133125 >From 75ef42d644da9136fb07014ade18b6be137426a1 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 26 Mar 2025 12:54:29 -0400 Subject: [PATCH 1/8] [C2y] Implement WG14 N3369 and N3469 (_Countof) C2y ad

[clang] [flang] [flang] Expose -m32 and -m64 options (PR #132409)

2025-03-27 Thread Jean-Didier PAILLEUX via cfe-commits
@@ -0,0 +1,4 @@ +! Check support of -m64. +! RUN: %flang -target i386-pc-win32 -m64 -### - %s 2>&1 | FileCheck -check-prefix=M64 %s + +! M64: "-triple" "{{[^-]+}}64-{{.*}}" JDPailleux wrote: Ok :-) https://github.com/llvm/llvm-project/pull/132409 __

[clang] [llvm] [RISCV] Add MC layer support for XSfmm*. (PR #133031)

2025-03-27 Thread Jiuyang Liu via cfe-commits
sequencer wrote: > but won't merge them until they are ratified just like Zvzip/Zvabd/Zibimm I think this patch is supported to be the vendor instruction set of `SiFive Xsfmm* Attached Matrix Extensions` if I understand correctly of this PR. AME is another issue that we don’t have ratified AM

[clang] [flang] [flang] Expose -m64 option (PR #132409)

2025-03-27 Thread Jean-Didier PAILLEUX via cfe-commits
https://github.com/JDPailleux edited https://github.com/llvm/llvm-project/pull/132409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/133125 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [libcxx] [llvm] [llvm-reduce]: print short form, actionable names in the log (PR #132813)

2025-03-27 Thread via cfe-commits
YLChenZ wrote: I'm having some problems with my code branch, I guess I should resubmit a PR, I apologize for that! https://github.com/llvm/llvm-project/pull/132813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang-tools-extra] [clang-doc] [feat] add --repository-line-prefix argument (PR #131280)

2025-03-27 Thread Mohamed Emad via cfe-commits
https://github.com/hulxv updated https://github.com/llvm/llvm-project/pull/131280 >From bf9bd4156cb7f652c9cf0477f537e5c58b470448 Mon Sep 17 00:00:00 2001 From: hulxv Date: Fri, 14 Mar 2025 07:39:15 +0200 Subject: [PATCH 01/14] [clang-doc] [feat] add `--repository-line-prefix` argument (fix #59

[clang] [flang] [llvm] [AMDGPU] Add "lds-buffer-load-insts" attribute for all targets < gfx11 (PR #133055)

2025-03-27 Thread Juan Manuel Martinez Caamaño via cfe-commits
https://github.com/jmmartinez updated https://github.com/llvm/llvm-project/pull/133055 From 70fbaa4e4f2334cf6134adf02b4af2bcc0bf9847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Martinez=20Caama=C3=B1o?= Date: Thu, 20 Mar 2025 13:23:25 +0100 Subject: [PATCH 1/3] [AMDGPU] Add "lds-bu

[clang] [Driver] Enable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON on AIX. (PR #132821)

2025-03-27 Thread Daniel Chen via cfe-commits
DanielCChen wrote: Thanks to @MaskRay for reviewing the PR and @ldionne for the comments that led us to find another issue. Would the reviewers please let me know if you are still reviewing the change? I am planning to merge it if you have no further comments. https://github.com/llvm/llvm-pro

[clang] Remove duplicate API (PR #132776)

2025-03-27 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum edited https://github.com/llvm/llvm-project/pull/132776 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [AMDGPU] Use a target feature to enable __builtin_amdgcn_global_load_lds on gfx9/10 (PR #133055)

2025-03-27 Thread Juan Manuel Martinez Caamaño via cfe-commits
https://github.com/jmmartinez edited https://github.com/llvm/llvm-project/pull/133055 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Remove duplicate API (PR #132776)

2025-03-27 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum approved this pull request. Oh wow, what an oversight. Thank you for this PR! Looks good to me for the most part, it just needs a release note (especially for the breaking change). I'd also like @Endilll to sign off on this as well https://github.com/llvm/llvm-pr

[clang] [Clang] Improve subsumption. (PR #132849)

2025-03-27 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/132849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Improve subsumption. (PR #132849)

2025-03-27 Thread Younan Zhang via cfe-commits
@@ -170,102 +132,112 @@ struct alignas(ConstraintAlignment) FoldExpandedConstraint { const Expr *Pattern) : Kind(K), Constraint(std::move(C)), Pattern(Pattern) {}; - template - bool subsumes(const FoldExpandedConstraint &Other, -

[clang] [Clang] Improve subsumption. (PR #132849)

2025-03-27 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. One small nit Otherwise looks great, thanks! https://github.com/llvm/llvm-project/pull/132849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [flang] [llvm] [AMDGPU] Use a target feature to enable __builtin_amdgcn_global_load_lds on gfx9/10 (PR #133055)

2025-03-27 Thread Juan Manuel Martinez Caamaño via cfe-commits
https://github.com/jmmartinez edited https://github.com/llvm/llvm-project/pull/133055 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC][HLSL] Move emitter out of AMDGPU.cpp (PR #133251)

2025-03-27 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/133251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   >