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

2025-03-26 Thread Congcong Cai via cfe-commits
@@ -89,6 +89,8 @@ void ConstCorrectnessCheck::registerMatchers(MatchFinder *Finder) { const auto ConstReference = hasType(references(isConstQualified())); HerrCai0907 wrote: I think the comment means check the constness of pointer and array instead of const

[clang] 80f216d - [C++20] [Modules] Add a test

2025-03-26 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-03-27T14:04:41+08:00 New Revision: 80f216db530eda98a444bc1994c7d69a7107c3c6 URL: https://github.com/llvm/llvm-project/commit/80f216db530eda98a444bc1994c7d69a7107c3c6 DIFF: https://github.com/llvm/llvm-project/commit/80f216db530eda98a444bc1994c7d69a7107c3c6.diff LO

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

2025-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Younan Zhang (zyn0217) Changes The instantiation of a VarDecl's initializer might be deferred until the variable is actually used. However, we were still building the DeclRefExpr with a type that could later be changed by the initializer'

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

2025-03-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/133212 The instantiation of a VarDecl's initializer might be deferred until the variable is actually used. However, we were still building the DeclRefExpr with a type that could later be changed by the initializer's i

[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

2025-03-26 Thread Ibraim Ganiev via cfe-commits
olologin wrote: > It would feel safer if the custom check was passed via command-line instead, > similar to --config But then you will not be able to properly disable such checks for subfolders (modules) of some huge project, right? https://github.com/llvm/llvm-project/pull/131804

[clang] Add guard to for loop test clang/test/Sema/for.c (PR #133169)

2025-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (Ariel-Burton) Changes Commit 20b7f5982622f includes a case that checks diagnostics for for loops using thread locals. This fails on platforms which do not support TLS. This change adds guards to run this part of the test iff the feat

[clang] [Driver] Use a range constructor of StringSet (NFC) (PR #133201)

2025-03-26 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-aarch64-sve-vls-2stage` running on `linaro-g3-02` while building `clang` at step 12 "ninja check 2". Full details are available at: https://lab.llvm.org/buildbot/#/builders/4/builds/5888 Here is the relevant piece of

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

2025-03-26 Thread Ryotaro Kasuga via cfe-commits
https://github.com/kasuga-fj commented: Thanks for your review! 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] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Ryotaro Kasuga 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] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Ryotaro Kasuga 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] [Driver] Use a range constructor of StringSet (NFC) (PR #133201)

2025-03-26 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-aarch64-sve-vls` running on `linaro-g3-03` while building `clang` at step 7 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/143/builds/6485 Here is the relevant piece of the bui

[clang] [llvm] [ADT] Remove old range constructors of SmallSet and StringSet (PR #133205)

2025-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes This patch removes the old range constructors of SmallSet and StringSet that do not take the llvm::from_range tag. Since there are so few uses, this patch directly removes them without going through the

[clang] [llvm] [ADT] Remove old range constructors of SmallSet and StringSet (PR #133205)

2025-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-adt Author: Kazu Hirata (kazutakahirata) Changes This patch removes the old range constructors of SmallSet and StringSet that do not take the llvm::from_range tag. Since there are so few uses, this patch directly removes them without going through

[clang] [CIR] Upstream global initialization for ArrayType (PR #131657)

2025-03-26 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. Looks good. Thanks for the updates! https://github.com/llvm/llvm-project/pull/131657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [llvm] [ADT] Remove old range constructors of SmallSet and StringSet (PR #133205)

2025-03-26 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/133205 This patch removes the old range constructors of SmallSet and StringSet that do not take the llvm::from_range tag. Since there are so few uses, this patch directly removes them without going through the d

[clang] [Clang][SYCL] Add support AOT compilation support for Intel GPUs in clang-sycl-linker (PR #133194)

2025-03-26 Thread Justin Cai via cfe-commits
https://github.com/jzc created https://github.com/llvm/llvm-project/pull/133194 This PR adds support for AOT compilation for Intel CPUs and GPUs in clang-sycl-linker. When no `-arch` is passed to `clang-sycl-linker`, the output of the tool will be the resulting linked SPIR-V bytecode. If the `-

[clang] 64046e9 - [Driver] Use a range constructor of StringSet (NFC) (#133201)

2025-03-26 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-03-26T20:54:08-07:00 New Revision: 64046e9d2628ce421682eea8465e41554b46c96d URL: https://github.com/llvm/llvm-project/commit/64046e9d2628ce421682eea8465e41554b46c96d DIFF: https://github.com/llvm/llvm-project/commit/64046e9d2628ce421682eea8465e41554b46c96d.diff L

[clang] 16d1942 - [RISCV] Drop '-x c' from riscv-target-features.c. NFC

2025-03-26 Thread Craig Topper via cfe-commits
Author: Craig Topper Date: 2025-03-26T21:20:04-07:00 New Revision: 16d1942c069a7572efceba884452f08a157cb684 URL: https://github.com/llvm/llvm-project/commit/16d1942c069a7572efceba884452f08a157cb684 DIFF: https://github.com/llvm/llvm-project/commit/16d1942c069a7572efceba884452f08a157cb684.diff

[clang] [Clang][SYCL] Add support AOT compilation support for Intel GPUs in clang-sycl-linker (PR #133194)

2025-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Justin Cai (jzc) Changes This PR adds support for AOT compilation for Intel CPUs and GPUs in clang-sycl-linker. When no `-arch` is passed to `clang-sycl-linker`, the output of the tool will be the resulting linked SPIR-V bytecode. If the

[clang] 3386156 - [clang][ExtractAPI] fix a couple crashes when used via libclang (#132297)

2025-03-26 Thread via cfe-commits
Author: QuietMisdreavus Date: 2025-03-26T17:46:21-06:00 New Revision: 3386156b1e8418083e99833d3d22420cf439c039 URL: https://github.com/llvm/llvm-project/commit/3386156b1e8418083e99833d3d22420cf439c039 DIFF: https://github.com/llvm/llvm-project/commit/3386156b1e8418083e99833d3d22420cf439c039.dif

[clang] [Clang] Implement CWG2517 Useless restriction on use of parameter in constraint-expression (PR #132919)

2025-03-26 Thread Imad Aldij via cfe-commits
https://github.com/imdj edited https://github.com/llvm/llvm-project/pull/132919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement CWG2517 Useless restriction on use of parameter in constraint-expression (PR #132919)

2025-03-26 Thread Imad Aldij via cfe-commits
https://github.com/imdj edited https://github.com/llvm/llvm-project/pull/132919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86][AVX10] Re-target mavx10.1 and emit warning for mavx10.x-256/512 (PR #132542)

2025-03-26 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang updated https://github.com/llvm/llvm-project/pull/132542 >From 9a8d9b7d5d3f07685579c3d1336e146755bb7efa Mon Sep 17 00:00:00 2001 From: "Wang, Phoebe" Date: Sat, 22 Mar 2025 19:15:01 +0800 Subject: [PATCH 1/2] [X86][AVX10] Re-target mavx10.1 and emit warning for ma

[clang] [Driver] Use *Set::insert_range (NFC) (PR #133201)

2025-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes This patch uses a range constructor to collapse: llvm::StringSet<> Dest; for (const auto &S : Src) Dest.insert(S); down to: llvm::StringSet<> Dest(llvm::from_range, Src); --- Full diff: ht

[clang] [Driver] Use *Set::insert_range (NFC) (PR #133201)

2025-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Kazu Hirata (kazutakahirata) Changes This patch uses a range constructor to collapse: llvm::StringSet<> Dest; for (const auto &S : Src) Dest.insert(S); down to: llvm::StringSet<> Dest(llvm::from_range, Src); --- Full d

[clang] [Driver] Use *Set::insert_range (NFC) (PR #133201)

2025-03-26 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/133201 This patch uses a range constructor to collapse: llvm::StringSet<> Dest; for (const auto &S : Src) Dest.insert(S); down to: llvm::StringSet<> Dest(llvm::from_range, Src); >From 5f536050eb4df

[clang] [llvm] [HLSL] Implement the `smoothstep` intrinsic (PR #132288)

2025-03-26 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng edited https://github.com/llvm/llvm-project/pull/132288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement dot2add intrinsic (PR #131237)

2025-03-26 Thread Sumit Agarwal via cfe-commits
https://github.com/sumitsays updated https://github.com/llvm/llvm-project/pull/131237 >From 6d5c4053c90975d64e378e52779dab9c3ffb64cd Mon Sep 17 00:00:00 2001 From: Sumit Agarwal Date: Thu, 13 Mar 2025 16:02:32 -0700 Subject: [PATCH 01/12] dot2add working for dxil without sema check --- clang/

[clang] [clang]: fix overload resolution in case of bind rvalue ref to const lvalue ref (PR #133035)

2025-03-26 Thread Nhat Nguyen via cfe-commits
https://github.com/changkhothuychung edited https://github.com/llvm/llvm-project/pull/133035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement CWG2517 Useless restriction on use of parameter in constraint-expression (PR #132919)

2025-03-26 Thread Imad Aldij via cfe-commits
@@ -32,6 +32,26 @@ enum E2 : S::I { e }; #endif } // namespace cwg2516 +namespace cwg2517 { // cwg2517: 21 +#if __cplusplus >= 202302L imdj wrote: Ok, so it's often based on when the issue was first introduced. Thanks for clearing my misunderstanding. https

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

2025-03-26 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff bfe85230e2dc27493b82ffba5a46c8f7449a6e10 bfd36727df42b6bc95468e84a74efbbff968e7aa --e

[clang] [clang][CodeComplete] Use HeuristicResolver in getAsRecordDecl() (PR #130473)

2025-03-26 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 converted_to_draft https://github.com/llvm/llvm-project/pull/130473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][SYCL] Add support AOT compilation support for Intel GPUs in clang-sycl-linker (PR #133194)

2025-03-26 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [Serialization] Fix lazy template loading (PR #133057)

2025-03-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Complete only needed partial specializations: It is unclear (to me) why this > needs to be done "for safety", but this change significantly improves the > effectiveness of lazy loading. This comes from the logic: if we have a partial template specialization `A` and we need

[clang] [Serialization] Fix lazy template loading (PR #133057)

2025-03-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > While I may not able to look into them in detail recently, it may be > > helpful to split this into seperate patches to review and to land. > > I initially considered this, but @vgvassilev said in [root-project/root#17722 > (comment)](https://github.com/root-project/root/

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

2025-03-26 Thread Michael Kruse via cfe-commits
@@ -227,36 +226,26 @@ void for_test_scalable_1(int *List, int Length) { // CHECK: ![[LOOP_5]] = distinct !{![[LOOP_5]], ![[UNROLL_DISABLE:.*]], ![[DISTRIBUTE_DISABLE:.*]], ![[WIDTH_1:.*]]} // CHECK: ![[WIDTH_1]] = !{!"llvm.loop.vectorize.width", i32 1} -// CHECK: ![[LOOP_6]]

[clang] [llvm] [IRBuilder] Add new overload for CreateIntrinsic (PR #131942)

2025-03-26 Thread Rahul Joshi via cfe-commits
jurahul wrote: @nikic any concerns? I'll merge in a couple of days https://github.com/llvm/llvm-project/pull/131942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][clang] Split clang/lib/CodeGen/CGBuiltin.cpp into target-specific files (PR #132252)

2025-03-26 Thread Farzon Lotfi via cfe-commits
farzonl wrote: In the future It would have been good to get feedback from the HLSL team before moving `EmitHLSLBuiltinExpr` to `clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp`. HLSL is a language and does not fall into the TargetBuiltin categorization. It supports all gpus. https://github.com/ll

[clang] [clang]: fix overload resolution in case of bind rvalue ref to const lvalue ref (PR #133035)

2025-03-26 Thread Nhat Nguyen via cfe-commits
https://github.com/changkhothuychung edited https://github.com/llvm/llvm-project/pull/133035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] link_bc target should depends on target builtins.link.clc-arch_suffix (PR #132338)

2025-03-26 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/132338 >From 6ce54aa767f8cdff2f938cdce8656e495a1346f0 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 20 Mar 2025 22:01:55 -0700 Subject: [PATCH 1/3] [libclc] link_bc target should depends on target builtins.link.

[clang] 2b43ecd - [webkit.RefCntblBaseVirtualDtor] Add support for NoVirtualDestructorBase. (#132497)

2025-03-26 Thread via cfe-commits
Author: Ryosuke Niwa Date: 2025-03-26T16:57:49-07:00 New Revision: 2b43ecd27b9651ac2bfb1328ad14b43a0f47a385 URL: https://github.com/llvm/llvm-project/commit/2b43ecd27b9651ac2bfb1328ad14b43a0f47a385 DIFF: https://github.com/llvm/llvm-project/commit/2b43ecd27b9651ac2bfb1328ad14b43a0f47a385.diff

[clang] [llvm] [HLSL] Implement the `smoothstep` intrinsic (PR #132288)

2025-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-ir Author: Kaitlin Peng (kmpeng) Changes Closes #99156. Tasks completed: - Implement `smoothstep` using HLSL source in `hlsl_intrinsics.h` - Implement the `smoothstep` SPIR-V target built-in in `clang/include/clang/Basic/BuiltinsSPIRV.td` - Add s

[clang] [llvm] [AArch64] Add FEAT_FPAC to Neoverse V2 (PR #133054)

2025-03-26 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus edited https://github.com/llvm/llvm-project/pull/133054 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for while and do..while loops (PR #133157)

2025-03-26 Thread Andy Kaylor via cfe-commits
@@ -759,6 +761,84 @@ def BrCondOp : CIR_Op<"brcond", }]; } +//===--===// +// While & DoWhileOp +//===--===// + +class WhileOpBase : CIR_Op

[clang] [webkit.RefCntblBaseVirtualDtor] Add support for NoVirtualDestructorBase. (PR #132497)

2025-03-26 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/132497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.RefCntblBaseVirtualDtor] Add support for NoVirtualDestructorBase. (PR #132497)

2025-03-26 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thank you for the review! https://github.com/llvm/llvm-project/pull/132497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.RawPtrRefMemberChecker] The checker doesn't warn Objective-C types in ivars. (PR #132833)

2025-03-26 Thread Ryosuke Niwa via cfe-commits
@@ -58,3 +59,11 @@ void forceTmplToInstantiate(FooTmpl) {} void forceTmplToInstantiate(RefPtr) {} } + +@interface AnotherObject : NSObject { + NSString *ns_string; + // expected-warning@-1{{Instance variable 'ns_string' in 'AnotherObject' is a raw pointer to retainable ty

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

2025-03-26 Thread Reid Kleckner via cfe-commits
@@ -0,0 +1,115 @@ +//===--- RunOnNewStack.cpp - Crash Recovery ---===// +// +// 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: Ap

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

2025-03-26 Thread Reid Kleckner via cfe-commits
@@ -52,6 +56,7 @@ else() check_include_file(mach/mach.h HAVE_MACH_MACH_H) check_include_file(malloc/malloc.h HAVE_MALLOC_MALLOC_H) check_include_file(pthread.h HAVE_PTHREAD_H) + check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H) rnk wrote: Do we nee

[clang] [webkit.RefCntblBaseVirtualDtor] Add support for NoVirtualDestructorBase. (PR #132497)

2025-03-26 Thread Rashmi Mudduluru via cfe-commits
https://github.com/t-rasmud approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/132497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ExtractAPI] fix a couple crashes when used via libclang (PR #132297)

2025-03-26 Thread via cfe-commits
https://github.com/QuietMisdreavus closed https://github.com/llvm/llvm-project/pull/132297 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ExtractAPI] fix a couple crashes when used via libclang (PR #132297)

2025-03-26 Thread via cfe-commits
QuietMisdreavus wrote: I rebased the PR to squash the review commits into their respective patches, but then i noticed that i can't do a merge that preserves the individual commits without pushing to `main` directly. 😅 Thanks for the review! https://github.com/llvm/llvm-project/pull/132297 ___

[clang] [clang-tools-extra] [clang] Concepts: support pack expansions for type constraints (PR #132626)

2025-03-26 Thread Matheus Izvekov via cfe-commits
@@ -70,7 +70,14 @@ struct alignas(ConstraintAlignment) AtomicConstraint { // We do not actually substitute the parameter mappings into the // constraint expressions, therefore the constraint expressions are // the originals, and comparing them will suffice. -if

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

2025-03-26 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. I don't have anything to add on top of Andy's review. LGTM once those comments are addressed. https://github.com/llvm/llvm-project/pull/133159 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [CIR] Upstream zero init for global variables (PR #133100)

2025-03-26 Thread Andy Kaylor via cfe-commits
@@ -67,6 +67,40 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { return create(loc, attr.getType(), attr); } + mlir::TypedAttr getConstNullPtrAttr(mlir::Type t) { +assert(mlir::isa(t) && "expected cir.ptr"); +return getConstPtrAttr(t, 0); + } + + mlir::Typ

[clang] [CIR] Upstream zero init for global variables (PR #133100)

2025-03-26 Thread Andy Kaylor via cfe-commits
@@ -67,6 +67,40 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { return create(loc, attr.getType(), attr); } + mlir::TypedAttr getConstNullPtrAttr(mlir::Type t) { +assert(mlir::isa(t) && "expected cir.ptr"); +return getConstPtrAttr(t, 0); + } + + mlir::Typ

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

2025-03-26 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] Optimize Module Dependency Handling for Efficient Memory Usage (PR #132294)

2025-03-26 Thread Ayush Pareek via cfe-commits
https://github.com/ayushpareek2003 updated https://github.com/llvm/llvm-project/pull/132294 >From 53a31ec6ed3d9ace8e7d822c2b2de4f6f58ece8d Mon Sep 17 00:00:00 2001 From: Ayush Pareek Date: Fri, 21 Mar 2025 03:44:05 +0530 Subject: [PATCH] Optimize Module Dependency Handling for Efficient Memory

[clang] 49f0607 - [clang][bytecode] Fix union copy/move operator active check (#132238)

2025-03-26 Thread via cfe-commits
Author: Timm Baeder Date: 2025-03-20T19:08:55+01:00 New Revision: 49f06075a6d298bd13564c9bffcf51281bed4962 URL: https://github.com/llvm/llvm-project/commit/49f06075a6d298bd13564c9bffcf51281bed4962 DIFF: https://github.com/llvm/llvm-project/commit/49f06075a6d298bd13564c9bffcf51281bed4962.diff L

[clang] [CIR] Upstream zero init for global variables (PR #133100)

2025-03-26 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/133100 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MS][clang] Add support for vector deleting destructors (PR #126240)

2025-03-26 Thread Reid Kleckner via cfe-commits
rnk wrote: I'll try to take a look at this when I get a chance, but that looks like it's not happening today. I read the comments a bit and found some codesearch links worth sharing for reference. Here's the original UnicodeString array new operation: https://source.chromium.org/chromium/chrom

[clang] [clang] Update Mach-O ptrauth driver defaults (PR #132834)

2025-03-26 Thread Jon Roelofs via cfe-commits
jroelofs wrote: Looks mechanically okay, but I need to defer to Ahmed on whether you're missing other bits that go along with this. He's around, just need to be patient ;) https://github.com/llvm/llvm-project/pull/132834 ___ cfe-commits mailing list c

[clang] [alpha.webkit.RawPtrRefMemberChecker] The checker doesn't warn Objective-C types in ivars. (PR #132833)

2025-03-26 Thread Rashmi Mudduluru via cfe-commits
@@ -58,3 +59,11 @@ void forceTmplToInstantiate(FooTmpl) {} void forceTmplToInstantiate(RefPtr) {} } + +@interface AnotherObject : NSObject { + NSString *ns_string; + // expected-warning@-1{{Instance variable 'ns_string' in 'AnotherObject' is a raw pointer to retainable ty

[clang] [llvm] [HLSL] Implement the `smoothstep` intrinsic (PR #132288)

2025-03-26 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng edited https://github.com/llvm/llvm-project/pull/132288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement the `smoothstep` intrinsic (PR #132288)

2025-03-26 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng edited https://github.com/llvm/llvm-project/pull/132288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR][NFC] Fix warnings in ClangIR code (PR #133134)

2025-03-26 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. https://github.com/llvm/llvm-project/pull/133134 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for while and do..while loops (PR #133157)

2025-03-26 Thread Bruno Cardoso Lopes via cfe-commits
@@ -759,6 +761,84 @@ def BrCondOp : CIR_Op<"brcond", }]; } +//===--===// +// While & DoWhileOp +//===--===// + +class WhileOpBase : CIR_Op

[clang] [CIR] Upstream support for while and do..while loops (PR #133157)

2025-03-26 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. Looks straight-forward to me, one minor nit! https://github.com/llvm/llvm-project/pull/133157 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [llvm] [HLSL] Implement the `smoothstep` intrinsic (PR #132288)

2025-03-26 Thread Kaitlin Peng via cfe-commits
@@ -0,0 +1,60 @@ +; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %} kmpeng wrote: Seems like this change produces thi

[clang-tools-extra] [llvm] Clang doc mustache rebase (PR #133161)

2025-03-26 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 2d1517d257fcbd0c9bce14badc7646e94d81ea2b 9dbd1b84d501db2619b716a029e612bca60eef5f --e

[clang] [CIR] Upstream zero init for global variables (PR #133100)

2025-03-26 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes commented: Overall looks fine! https://github.com/llvm/llvm-project/pull/133100 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for while and do..while loops (PR #133157)

2025-03-26 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/133157 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for while and do..while loops (PR #133157)

2025-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Andy Kaylor (andykaylor) Changes This adds basic support for while and do..while loops. Support for break and continue are left for a subsequent patch. --- Full diff: https://github.com/llvm/llvm-project/pull/133157.diff 7 Files Affec

[clang] [llvm] [HLSL] Implement the `smoothstep` intrinsic (PR #132288)

2025-03-26 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng deleted https://github.com/llvm/llvm-project/pull/132288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add BinOpOverflowOp and basic pointer arithmetic support (PR #133118)

2025-03-26 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1117,6 +1118,122 @@ mlir::LogicalResult CIRToLLVMBinOpLowering::matchAndRewrite( return mlir::LogicalResult::success(); } +mlir::LogicalResult CIRToLLVMBinOpOverflowOpLowering::matchAndRewrite( +cir::BinOpOverflowOp op, OpAdaptor adaptor, +mlir::ConversionPatter

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

2025-03-26 Thread Tarun Prabhu 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-{{.*}}" tarunprabhu wrote: If the `-target` is given as `i386-*`, this should always return `x86_

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

2025-03-26 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. 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] [llvm] [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #133173)

2025-03-26 Thread Reid Kleckner via cfe-commits
@@ -0,0 +1,115 @@ +//===--- RunOnNewStack.cpp - Crash Recovery ---===// +// +// 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: Ap

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

2025-03-26 Thread Reid Kleckner via cfe-commits
@@ -0,0 +1,115 @@ +//===--- RunOnNewStack.cpp - Crash Recovery ---===// +// +// 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: Ap

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

2025-03-26 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: If split stacks are negatively impacting profiling, debugging, or other compiler development tasks, I have to ask, have we considered optimizing clang stack usage? There are multiple issues: * Clang is a recursive descent parser. This isn't going to change, it

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

2025-03-26 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/133173 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream zero init for global variables (PR #133100)

2025-03-26 Thread Bruno Cardoso Lopes via cfe-commits
@@ -67,6 +67,40 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { return create(loc, attr.getType(), attr); } + mlir::TypedAttr getConstNullPtrAttr(mlir::Type t) { +assert(mlir::isa(t) && "expected cir.ptr"); +return getConstPtrAttr(t, 0); + } + + mlir::Typ

[clang] [CIR] Upstream support for while and do..while loops (PR #133157)

2025-03-26 Thread Andy Kaylor via cfe-commits
andykaylor wrote: @mmha https://github.com/llvm/llvm-project/pull/133157 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-03-26 Thread Andy Kaylor 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] [CIR] Upstream CmpOp (PR #133159)

2025-03-26 Thread Andy Kaylor 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] [CIR] Upstream CmpOp (PR #133159)

2025-03-26 Thread Andy Kaylor 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] [CIR] Upstream CmpOp (PR #133159)

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

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

2025-03-26 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor commented: This looks really good. I have just a few minor comments and a request for more tests. https://github.com/llvm/llvm-project/pull/133159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

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

2025-03-26 Thread Andy Kaylor via cfe-commits
@@ -514,9 +515,17 @@ mlir::LogicalResult CIRToLLVMCastOpLowering::matchAndRewrite( assert(!MissingFeatures::cxxABI()); assert(!MissingFeatures::dataMemberType()); break; - case cir::CastKind::ptr_to_bool: -assert(!cir::MissingFeatures::opCmp()); + case cir::C

[libclc] [libclc] Fix commands in compile_to_bc are executed sequentially (PR #130755)

2025-03-26 Thread Wenju He via cfe-commits
wenju-he wrote: @frasercrmck should we check CMAKE_VERSION and use DEPENDS_EXPLICIT_ONLY if the version is 3.27 or higher? I suppose DEPENDS_EXPLICIT_ONLY would be more light-weighted. And we need to keep both DEPENDS_EXPLICIT_ONLY and adding new target path, until llvm uplifts cmake version t

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-26 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 8122bb9dbe39a1dde77eb4aad76bf1c0e70b2d89 a7f38496c6ae6686268f67cf1e884b7ed09470eb --e

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-26 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/132974 >From 4dc1e77299c71b8f01fb73f7fba5f14e0fbe3edd Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 21 Mar 2025 21:07:11 +0100 Subject: [PATCH 1/5] [CIR] [Upstream local initialization for ArrayType ---

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

2025-03-26 Thread Paul Schwabauer via cfe-commits
https://github.com/koplas updated https://github.com/llvm/llvm-project/pull/133077 >From 86033b4b698ad11cf358b929e950f0b01e50390e Mon Sep 17 00:00:00 2001 From: koplas Date: Wed, 26 Mar 2025 13:49:44 +0100 Subject: [PATCH] [PATCH] [clang][frontend] Fix AllocKind retrieval for CXXConstructorDec

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

2025-03-26 Thread James Y Knight via cfe-commits
jyknight 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 like a simple

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-26 Thread Amr Hesham via cfe-commits
AmrDeveloper wrote: > I'm not suggesting errorNYI. I'm suggesting op.emitError(). We can't do that > here either, but maybe we could do it in the function from which this is > called? I think it's easier to keep it as assert, llvm_unreachable or a missing features as the error message mention

[clang] [HLSL] Add new int overloads for math builtins (PR #133162)

2025-03-26 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. https://github.com/llvm/llvm-project/pull/133162 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-03-26 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,115 @@ +//===--- RunOnNewStack.cpp - Crash Recovery ---===// +// +// 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: Ap

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

2025-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Michael Spencer (Bigcheese) Changes Clang spawns a new thread to avoid running out of stack space. This can make debugging and performance analysis more difficult as how the threads are connected is difficult to recover. This patch intro

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

2025-03-26 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/133173 Clang spawns a new thread to avoid running out of stack space. This can make debugging and performance analysis more difficult as how the threads are connected is difficult to recover. This patch introduces

[clang] [Clang] Fix various bugs in alias CTAD transform (PR #132061)

2025-03-26 Thread Matheus Izvekov via cfe-commits
@@ -1650,6 +1665,23 @@ namespace { return inherited::TransformTemplateArgument(Input, Output, Uneval); } +std::optional ComputeSizeOfPackExprWithoutSubstitution( +ArrayRef PackArgs) { + // Don't do this when rewriting template parameters for CTAD: +

  1   2   3   4   5   6   >