[clang] [llvm] [PowerPC] Add BCDCOPYSIGN and BCDSETSIGN Instruction Support (PR #144874)

2025-08-11 Thread Aditi Medhane via cfe-commits
@@ -580,6 +580,8 @@ TARGET_BUILTIN(__builtin_ppc_bcdsub_p, "iiV16UcV16Uc", "", "isa-v207-instructions") // P9 Binary-coded decimal (BCD) builtins. +TARGET_BUILTIN(__builtin_ppc_bcdcopysign, "V16UcV16UcV16Uc", "",

[clang] [clang] Inject IndirectFieldDecl even if name conflicts. (PR #153140)

2025-08-11 Thread via cfe-commits
https://github.com/keinflue updated https://github.com/llvm/llvm-project/pull/153140 >From cfca176239f48de13897b6d1a59eab74b55055af Mon Sep 17 00:00:00 2001 From: keinflue Date: Mon, 11 Aug 2025 15:51:14 +0200 Subject: [PATCH] [clang] Inject IndirectFieldDecl even if name conflicts. This modif

[clang] [clang] Inject IndirectFieldDecl even if name conflicts. (PR #153140)

2025-08-11 Thread via cfe-commits
keinflue wrote: I am not entirely sure that this doesn't have any further side effects, but I think it makes sense to have the indirect fields nodes in the final AST even if they are invalid. This should however probably at least be mentioned in the release notes, I am not entirely sure in wh

[clang] [clang] Inject IndirectFieldDecl even if name conflicts. (PR #153140)

2025-08-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (keinflue) Changes This modifies InjectAnonymousStructOrUnionMembers to inject an IndirectFieldDecl and mark it invalid even if its name conflicts with another name in the scope. This resolves a crash on a further diagnostic diag::

[clang] [clang] Inject IndirectFieldDecl even if name conflicts. (PR #153140)

2025-08-11 Thread via cfe-commits
https://github.com/keinflue created https://github.com/llvm/llvm-project/pull/153140 This modifies InjectAnonymousStructOrUnionMembers to inject an IndirectFieldDecl and mark it invalid even if its name conflicts with another name in the scope. This resolves a crash on a further diagnostic d

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-11 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Thanks! One more question @ChuanqiXu9 -- I now have a [pile of smallish > fixes](https://github.com/llvm/llvm-project/pull/152623#issuecomment-3177095986) > to make. Are you still thinking about the overall design of this PR, or > should I go ahead and polish it up for merg

[libclc] [libclc] Enable -ffp-contract=fast compile option for math native_* functions (PR #153137)

2025-08-11 Thread Matt Arsenault via cfe-commits
@@ -304,7 +304,7 @@ set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_sin.cl ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_sqrt.cl ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/math/native_tan.cl - PROPERTIES COMPILE_OP

[libclc] [libclc] Enable -ffp-contract=fast compile option for math native_* functions (PR #153137)

2025-08-11 Thread Matt Arsenault via cfe-commits
arsenm wrote: I think fp contract should be globally enabled in the build, and selectively disabled in the handful of places that it is problematic (namely specific blocks in expF, sinbF, and trig reductions) https://github.com/llvm/llvm-project/pull/153137 ___

[libclc] [libclc] Enable -ffp-contract=fast compile option for math native_* functions (PR #153137)

2025-08-11 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/153137 According to OpenCL spec, native_* functions have implementation-defined accuracy and typically have better performance. We can enable floating- point contraction optimizations for them. >From 719a6914321afc0

[clang] [llvm] [CodeGen] Fix VNInfo mapping in LiveRange::assign (PR #148790)

2025-08-11 Thread Matt Arsenault via cfe-commits
@@ -257,11 +257,13 @@ namespace llvm { assert(Other.segmentSet == nullptr && "Copying of LiveRanges with active SegmentSets is not supported"); // Duplicate valnos. + auto FirstNewVNIIdx = valnos.size(); arsenm wrote: ```suggestio

[clang] [llvm] [CodeGen] Fix VNInfo mapping in LiveRange::assign (PR #148790)

2025-08-11 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm commented: Probably do need to drop to a unit test for this https://github.com/llvm/llvm-project/pull/148790 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CodeGen] Fix VNInfo mapping in LiveRange::assign (PR #148790)

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

[clang] [llvm] [RISCV] Add SpacemiT XSMTVDot (SpacemiT Vector Dot Product) extension. (PR #151706)

2025-08-11 Thread Balint Cristian via cfe-commits
https://github.com/cbalint13 edited https://github.com/llvm/llvm-project/pull/151706 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add SpacemiT XSMTVDot (SpacemiT Vector Dot Product) extension. (PR #151706)

2025-08-11 Thread Pengcheng Wang via cfe-commits
@@ -1220,9 +1220,9 @@ define void @mgather_nxv16i64( %ptrs0, %ptr ; RV32-LABEL: mgather_nxv16i64: ; RV32: # %bb.0: ; RV32-NEXT:vl8re64.v v24, (a0) -; RV32-NEXT:csrr a0, vlenb -; RV32-NEXT:vsetvli a2, zero, e64, m8, ta, mu +; RV32-NEXT:vsetvli a0, zero, e

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-11 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > My current IR test verifies that there's no heap alloc across a few examples. > Were you thinking of a different kind of test? Can you be very specific since > I'm totally new to LLVM? I mean to add a test for https://github.com/llvm/llvm-project/issues/148380 to show we c

[clang-tools-extra] [clang-tidy] Fix `modernize-use-constraints` crash on uses of nonstandard `enable_if`s (PR #152938)

2025-08-11 Thread Victor Chernyakin via cfe-commits
@@ -78,6 +79,15 @@ matchEnableIfSpecializationImplTypename(TypeLoc TheType) { if (!TD || TD->getName() != "enable_if") return std::nullopt; +const TemplateParameterList *Params = TD->getTemplateParameters(); +if (Params->size() != 2) + return std::nullop

[clang-tools-extra] [clang-tidy] Fix `modernize-use-constraints` crash on uses of nonstandard `enable_if`s (PR #152938)

2025-08-11 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/152938 >From 728fc710260d529a604bf3692b18c9131061e070 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sun, 10 Aug 2025 12:25:26 -0700 Subject: [PATCH 1/4] [clang-tidy] Fix `modernize-use-constraints` crash on

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-11 Thread Chuanqi Xu via cfe-commits
@@ -174,6 +174,66 @@ static bool StmtCanThrow(const Stmt *S) { return false; } +// Check if this suspend should be calling `await_suspend_destroy` +static bool useCoroAwaitSuspendDestroy(const CoroutineSuspendExpr &S) { + // This can only be an `await_suspend_destroy` suspe

[clang] [clang] [Sema] Simplify Expr::isUnusedResultAWarning for CXXConstructExpr (PR #153116)

2025-08-11 Thread via cfe-commits
https://github.com/halbi2 updated https://github.com/llvm/llvm-project/pull/153116 >From ca3213a6e252919fe6eb19ed2a6d6cd6de539bca Mon Sep 17 00:00:00 2001 From: halbi2 Date: Mon, 11 Aug 2025 21:29:46 -0400 Subject: [PATCH 1/2] [clang] [Sema] Simplify Expr::isUnusedResultAWarning for CXXConstru

[clang] [llvm] [AIX] Implement the ifunc attribute. (PR #153049)

2025-08-11 Thread Wael Yehia via cfe-commits
https://github.com/w2yehia updated https://github.com/llvm/llvm-project/pull/153049 >From 87cd7b2124ed6e1450f10a53726fcb8db6d7b8e7 Mon Sep 17 00:00:00 2001 From: Wael Yehia Date: Mon, 11 Aug 2025 15:56:25 + Subject: [PATCH 1/4] Create and implement lowering of two intrinsics: int.ppc.get.

[clang] [clang] constexpr integer `__builtin_elementwise_{max,min}` (PR #152294)

2025-08-11 Thread Iris Shi via cfe-commits
https://github.com/el-ev closed https://github.com/llvm/llvm-project/pull/152294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 713ec58 - [clang] constexpr integer `__builtin_elementwise_{max,min}` (#152294)

2025-08-11 Thread via cfe-commits
Author: Iris Shi Date: 2025-08-12T09:49:05+08:00 New Revision: 713ec58dec1ec4d3866d62e563d7bd8e1ae3da53 URL: https://github.com/llvm/llvm-project/commit/713ec58dec1ec4d3866d62e563d7bd8e1ae3da53 DIFF: https://github.com/llvm/llvm-project/commit/713ec58dec1ec4d3866d62e563d7bd8e1ae3da53.diff LOG:

[clang] [llvm] [RISCV] Add SpacemiT XSMTVDot (SpacemiT Vector Dot Product) extension. (PR #151706)

2025-08-11 Thread via cfe-commits
https://github.com/link-xyq updated https://github.com/llvm/llvm-project/pull/151706 From 444e18a57cce92434de32dd899924a48169823a8 Mon Sep 17 00:00:00 2001 From: xuqian Date: Fri, 1 Aug 2025 22:26:16 +0800 Subject: [PATCH 1/9] [RISCV] Add SpacemiT XSMTVDot (SpacemiT Vector Dot Product) extensi

[libclc] [libclc] update __clc_mem_fence: add MemorySemantic arg and use __builtin_amdgcn_fence for AMDGPU (PR #152275)

2025-08-11 Thread Wenju He via cfe-commits
@@ -0,0 +1,21 @@ +//===--===// +// +// 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: Apac

[libclc] [libclc] update __clc_mem_fence: add MemorySemantic arg and use __builtin_amdgcn_fence for AMDGPU (PR #152275)

2025-08-11 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/152275 >From c48a94749e7e4ee261895826f2df2e2c48f040ef Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 6 Aug 2025 11:07:15 +0200 Subject: [PATCH 1/3] [libclc] update __clc_mem_fence: add MemorySemantic arg and use

[clang] [Headers][X86] Allow MMX/SSE2/AVX2/AVX512BW integer saturated arithmetic intrinsics to be used in constexpr (PR #153088)

2025-08-11 Thread Yatao Wang via cfe-commits
https://github.com/ningxinr edited https://github.com/llvm/llvm-project/pull/153088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers][X86] Allow MMX/SSE2/AVX2/AVX512BW integer saturated arithmetic intrinsics to be used in constexpr (PR #153088)

2025-08-11 Thread Yatao Wang via cfe-commits
https://github.com/ningxinr ready_for_review https://github.com/llvm/llvm-project/pull/153088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers][X86] Allow MMX/SSE2/AVX2/AVX512BW integer saturated arithmetic intrinsics to be used in constexpr (PR #153088)

2025-08-11 Thread Yatao Wang via cfe-commits
https://github.com/ningxinr edited https://github.com/llvm/llvm-project/pull/153088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP][Headers][X86] Allow MMX/SSE2/AVX2/AVX512BW integer saturated arithmetic intrinsics to be used in constexpr (PR #153088)

2025-08-11 Thread Yatao Wang via cfe-commits
https://github.com/ningxinr updated https://github.com/llvm/llvm-project/pull/153088 >From 9f75cd85db53322d3134a5aa8c506859e5179a0a Mon Sep 17 00:00:00 2001 From: ningxinr Date: Mon, 11 Aug 2025 13:36:48 -0700 Subject: [PATCH 1/4] [Headers][X86] Allow MMX integer saturated arithmetic intrinsic

[clang-tools-extra] [clangd] extend and rearrange doxygen hover documentation (PR #152918)

2025-08-11 Thread Maksim Ivanov via cfe-commits
@@ -1276,6 +1276,7 @@ std::optional getHover(ParsedAST &AST, Position Pos, HI.Definition = URIForFile::canonicalize(Inc.Resolved, AST.tuPath()).file().str(); HI.DefinitionLanguage = ""; +HI.IsIncludeDirective = true; emaxx-google wrote: Co

[clang-tools-extra] [clangd] extend and rearrange doxygen hover documentation (PR #152918)

2025-08-11 Thread Maksim Ivanov via cfe-commits
@@ -1504,41 +1505,103 @@ markup::Document HoverInfo::presentDoxygen() const { Header.appendText(index::getSymbolKindString(Kind)).appendSpace(); assert(!Name.empty() && "hover triggered on a nameless symbol"); - Header.appendCode(Name); emaxx-google wro

[clang] [WIP][Headers][X86] Allow MMX/SSE2/AVX2/AVX512BW integer saturated arithmetic intrinsics to be used in constexpr (PR #153088)

2025-08-11 Thread Yatao Wang via cfe-commits
https://github.com/ningxinr updated https://github.com/llvm/llvm-project/pull/153088 >From fcb1db6b8b0d13bfc84321a0e5bcd31db646524e Mon Sep 17 00:00:00 2001 From: ningxinr Date: Mon, 11 Aug 2025 13:36:48 -0700 Subject: [PATCH 1/4] [Headers][X86] Allow MMX integer saturated arithmetic intrinsic

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-11 Thread via cfe-commits
@@ -9270,6 +9270,110 @@ Example: }]; } +def CoroAwaitSuspendDestroyDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ + +The ``[[clang::coro_await_suspend_destroy]]`` attribute may be applied to a C++ +coroutine awaiter type. When this attribute is presen

[clang] [WIP][Headers][X86] Allow MMX/SSE2/AVX2/AVX512BW integer saturated arithmetic intrinsics to be used in constexpr (PR #153088)

2025-08-11 Thread Yatao Wang via cfe-commits
https://github.com/ningxinr updated https://github.com/llvm/llvm-project/pull/153088 >From fcb1db6b8b0d13bfc84321a0e5bcd31db646524e Mon Sep 17 00:00:00 2001 From: ningxinr Date: Mon, 11 Aug 2025 13:36:48 -0700 Subject: [PATCH 1/4] [Headers][X86] Allow MMX integer saturated arithmetic intrinsic

[clang] [WIP][Headers][X86] Allow MMX/SSE2/AVX2/AVX512BW integer saturated arithmetic intrinsics to be used in constexpr (PR #153088)

2025-08-11 Thread Yatao Wang via cfe-commits
https://github.com/ningxinr updated https://github.com/llvm/llvm-project/pull/153088 >From fcb1db6b8b0d13bfc84321a0e5bcd31db646524e Mon Sep 17 00:00:00 2001 From: ningxinr Date: Mon, 11 Aug 2025 13:36:48 -0700 Subject: [PATCH 1/4] [Headers][X86] Allow MMX integer saturated arithmetic intrinsic

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-11 Thread via cfe-commits
@@ -9270,6 +9270,110 @@ Example: }]; } +def CoroAwaitSuspendDestroyDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ + +The ``[[clang::coro_await_suspend_destroy]]`` attribute may be applied to a C++ +coroutine awaiter type. When this attribute is presen

[clang] [KeyInstr] Enable -gkey-instructions by default if optimisations are enabled (PR #149509)

2025-08-11 Thread Reid Kleckner via cfe-commits
rnk wrote: I think you've all gone above and beyond to pay for the (marginal) cost increase from this feature, and we should go ahead and land this. Thanks for all the hard work and data gathering! https://github.com/llvm/llvm-project/pull/149509 ___

[clang] [llvm] workflows/release-binaries: Enable Windows x86 builds (PR #128274)

2025-08-11 Thread Tom Stellard via cfe-commits
https://github.com/tstellar updated https://github.com/llvm/llvm-project/pull/128274 >From 2110f92892dd72dfbe1a7d87116faa3693c7c586 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Sat, 22 Feb 2025 03:08:24 + Subject: [PATCH 01/16] workflows/release-binaries: Enable Windows x86 builds ---

[clang] [CIR] Upstream LabelOp (PR #152802)

2025-08-11 Thread Andy Kaylor via cfe-commits
@@ -1060,6 +1060,20 @@ def CIR_BrOp : CIR_Op<"br",[ }]; } +//===--===// +// LabelOp +//===--===// + +// The LabelOp has AlwaysSpeculatable

[clang] [CIR] Upstream LabelOp (PR #152802)

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

[clang] [CIR] Upstream LabelOp (PR #152802)

2025-08-11 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm, just a couple of nits https://github.com/llvm/llvm-project/pull/152802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream builtin lowering emitter & FAbs op (PR #151750)

2025-08-11 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/151750 >From 64ae6442a22f4ad67c7af2089c3248a88f4cfc29 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 1 Aug 2025 20:48:02 +0200 Subject: [PATCH 1/4] [CIR] Upstream builtin fabs op --- clang/include/clang/

[clang] [CIR] Upstream builtin lowering emitter & FAbs op (PR #151750)

2025-08-11 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/151750 >From 64ae6442a22f4ad67c7af2089c3248a88f4cfc29 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 1 Aug 2025 20:48:02 +0200 Subject: [PATCH 1/4] [CIR] Upstream builtin fabs op --- clang/include/clang/

[clang] [llvm] [AVR] Only specify one legal int string in data layout (PR #153010)

2025-08-11 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `mlir-nvidia` running on `mlir-nvidia` while building `clang,llvm` at step 7 "test-build-check-mlir-build-only-check-mlir". Full details are available at: https://lab.llvm.org/buildbot/#/builders/138/builds/17367 Here is the

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-08-11 Thread via cfe-commits
https://github.com/schittir updated https://github.com/llvm/llvm-project/pull/140282 Unicorn! · GitHub body { background-color: #f1f1f1; margin: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } .container { margin: 50px a

[clang] [clang-format] Allow array alignment on non-rectangular arrays (PR #143781)

2025-08-11 Thread Ben Dunkin via cfe-commits
https://github.com/bdunkin edited https://github.com/llvm/llvm-project/pull/143781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Allow array alignment on non-rectangular arrays (PR #143781)

2025-08-11 Thread Ben Dunkin via cfe-commits
@@ -118,9 +118,9 @@ const tooling::Replacements &WhitespaceManager::generateReplacements() { alignConsecutiveTableGenDefinitions(); } alignChainedConditionals(); + alignArrayInitializers(); bdunkin wrote: Aligning elements in arrays can changed the l

[clang] [clang-format] Allow array alignment on non-rectangular arrays (PR #143781)

2025-08-11 Thread Ben Dunkin via cfe-commits
@@ -274,76 +268,17 @@ class WhitespaceManager { void alignArrayInitializersLeftJustified(CellDescriptions &&CellDescs); /// Calculate the cell width between two indexes. - unsigned calculateCellWidth(unsigned Start, unsigned End, - bool WithSp

[clang] [clang-format] Allow array alignment on non-rectangular arrays (PR #143781)

2025-08-11 Thread Ben Dunkin via cfe-commits
https://github.com/bdunkin updated https://github.com/llvm/llvm-project/pull/143781 Unicorn! · GitHub body { background-color: #f1f1f1; margin: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } .container { margin: 50px au

[clang] [clang-format] Allow array alignment on non-rectangular arrays (PR #143781)

2025-08-11 Thread Ben Dunkin via cfe-commits
https://github.com/bdunkin edited https://github.com/llvm/llvm-project/pull/143781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add implicit binding attribute to resource arrays (PR #152452)

2025-08-11 Thread Joshua Batista via cfe-commits
@@ -71,6 +71,10 @@ static RegisterType getRegisterType(ResourceClass RC) { llvm_unreachable("unexpected ResourceClass value"); } +static RegisterType getRegisterType(const HLSLAttributedResourceType *ResTy) { bob80905 wrote: FYI, doesn't seem like this was

[clang] [clang-format] Allow array alignment on non-rectangular arrays (PR #143781)

2025-08-11 Thread Ben Dunkin via cfe-commits
@@ -1318,281 +1343,253 @@ void WhitespaceManager::alignArrayInitializers(unsigned Start, unsigned End) { void WhitespaceManager::alignArrayInitializersRightJustified( CellDescriptions &&CellDescs) { - if (!CellDescs.isRectangular()) + + // If there are less than two row

[clang] [clang-format] Allow array alignment on non-rectangular arrays (PR #143781)

2025-08-11 Thread Ben Dunkin via cfe-commits
@@ -1318,281 +1343,253 @@ void WhitespaceManager::alignArrayInitializers(unsigned Start, unsigned End) { void WhitespaceManager::alignArrayInitializersRightJustified( bdunkin wrote: This function, and the left justified version, are full rewrites. Comparing t

[clang] [clang-format] Allow array alignment on non-rectangular arrays (PR #143781)

2025-08-11 Thread Ben Dunkin via cfe-commits
@@ -278,6 +278,33 @@ void WhitespaceManager::calculateLineBreakInformation() { } } +// Sets the spaces in front of a Change, and updates the start/end columns of +// subsequent tokens so that trailing comments and escaped newlines can be +// aligned properly +static void +Se

[clang] [clang-format] Add functionality of getting info about numeric literals (PR #152878)

2025-08-11 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-aarch64-windows` running on `linaro-armv8-windows-msvc-05` while building `clang` at step 6 "test". Full details are available at: https://lab.llvm.org/buildbot/#/builders/141/builds/10747 Here is the relevant piece of

[clang] [clang-format] Allow array alignment on non-rectangular arrays (PR #143781)

2025-08-11 Thread Ben Dunkin via cfe-commits
https://github.com/bdunkin updated https://github.com/llvm/llvm-project/pull/143781 >From f0a9d10d5306e5f074259c88426725b5adfe6994 Mon Sep 17 00:00:00 2001 From: Ben Dunkin Date: Fri, 6 Jun 2025 14:23:29 -0700 Subject: [PATCH] Rewrite AlignArrayOfStructures implementation to allow non-rectangu

[clang] dde474c - [CIR] Make ClangIR compatible with latest nested name specifier AST representation (#152846)

2025-08-11 Thread via cfe-commits
Author: Amr Hesham Date: 2025-08-11T20:08:37+02:00 New Revision: dde474cfc41b480422a3c4e9607843660a88fc2a URL: https://github.com/llvm/llvm-project/commit/dde474cfc41b480422a3c4e9607843660a88fc2a DIFF: https://github.com/llvm/llvm-project/commit/dde474cfc41b480422a3c4e9607843660a88fc2a.diff LO

[clang] [CIR] Make ClangIR compatible with latest nested name specifier AST representation (PR #152846)

2025-08-11 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper closed https://github.com/llvm/llvm-project/pull/152846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -6654,6 +6658,56 @@ class SubstTemplateTypeParmType final } }; +/// Represents the result of substituting a set of types as a template argument +/// that needs to be expanded later. +/// +/// These types are always dependent and produced depending on the situations: +///

[libunwind] [libunwind] Use consistent indentation in `__libunwind_config.h` (PR #152861)

2025-08-11 Thread Michał Górny via cfe-commits
mgorny wrote: > Should we maybe just set `IndentPPDirectives: AfterHash`? We already do that > in libc++, libc++abi and (I think) compiler-rt. I suppose it would make sense to me, but I don't feel like I'm the person to make that decision. https://github.com/llvm/llvm-project/pull/152861

[clang] [llvm] [Clang][CUDA] Add support for __managed__ variables in non-RDC and default RDC mode (PR #149716)

2025-08-11 Thread Artem Belevich via cfe-commits
Artem-B wrote: Is this pull request ready for review? https://github.com/llvm/llvm-project/pull/149716 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers][X86] Fix incorrect macro definitions for non-constexpr (PR #153060)

2025-08-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Bhasawut Singhaphan (markbhasawut) Changes While working on PR #152910, I discovered some incorrectly defined `__DEFAULT_FN_ATTRS*_CONSTEXPR` macros for non-constexpr contexts. --- Full diff: https://github.com/llvm/llvm-project/pull/1530

[clang] [Headers][X86] Fix incorrect macro definitions for non-constexpr (PR #153060)

2025-08-11 Thread Bhasawut Singhaphan via cfe-commits
https://github.com/markbhasawut created https://github.com/llvm/llvm-project/pull/153060 While working on PR #152910, I discovered some incorrectly defined `__DEFAULT_FN_ATTRS*_CONSTEXPR` macros for non-constexpr contexts. >From 4924552f7b1c585a613943ab65050e73e6525bb4 Mon Sep 17 00:00:00 2001

[clang] [analyzer] MallocChecker – Fix false positive leak for smart pointers in temporary objects (PR #152751)

2025-08-11 Thread Pavel Skripkin via cfe-commits
@@ -3068,11 +3110,195 @@ void MallocChecker::checkDeadSymbols(SymbolReaper &SymReaper, C.addTransition(state->set(RS), N); } +// Allowlist of owning smart pointers we want to recognize. +// Start with unique_ptr and shared_ptr. (intentionally exclude weak_ptr) +static bool

[libunwind] [libunwind] Use consistent indentation in `__libunwind_config.h` (PR #152861)

2025-08-11 Thread Michał Górny via cfe-commits
@@ -11,6 +11,8 @@ #define _LIBUNWIND_VERSION 15000 +// Disable clang-format as it makes the huge conditions unreadable. +// clang-format off mgorny wrote: I mean, `clang-format` flattens everything, so I'm disabling it, so indentations remain meaningful. h

[clang] [analyzer] MallocChecker – Fix false positive leak for smart pointers in temporary objects (PR #152751)

2025-08-11 Thread Pavel Skripkin via cfe-commits
pskrgag wrote: I am sorry, looks like I found another regression: ```cpp #include struct Foo { std::unique_ptr ptr; int *raw; Foo() : ptr(std::make_unique(1)), raw(new int) {} }; void add(Foo foo) {} int main(int argc, const char **argv) { add(Foo()); return 0; } ``` With your p

[libunwind] [libunwind] Use consistent indentation in `__libunwind_config.h` (PR #152861)

2025-08-11 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: Should we maybe just set `IndentPPDirectives: AfterHash`? We already do that in libc++, libc++abi and (I think) compiler-rt. https://github.com/llvm/llvm-project/pull/152861 ___ cfe-commits mailing list cfe-com

[clang] [llvm] [HLSL][DirectX] Fix `dot2add` DXIL operation to use float overload (PR #152781)

2025-08-11 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng updated https://github.com/llvm/llvm-project/pull/152781 >From 10739a31a7074306f63f67b30b9295e9a37e9e77 Mon Sep 17 00:00:00 2001 From: kmpeng Date: Fri, 8 Aug 2025 12:25:20 -0700 Subject: [PATCH 1/2] fix dot2add definition in DXIL.td and tests --- clang/test/CodeGenH

[clang] [llvm] [HLSL][DirectX] Fix `dot2add` DXIL operation to use float overload (PR #152781)

2025-08-11 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl approved this pull request. https://github.com/llvm/llvm-project/pull/152781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][DirectX] Fix `dot2add` DXIL operation to use float overload (PR #152781)

2025-08-11 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng updated https://github.com/llvm/llvm-project/pull/152781 >From 81d1e32a847889a3cc1b98fbcf438f63a8e4d024 Mon Sep 17 00:00:00 2001 From: kmpeng Date: Fri, 8 Aug 2025 12:25:20 -0700 Subject: [PATCH 1/2] fix dot2add definition in DXIL.td and tests --- clang/test/CodeGenH

[clang] [Clang](NFC) Add coverage for VTable debug info (PR #151818)

2025-08-11 Thread Carlos Alberto Enciso via cfe-commits
CarlosAlbertoEnciso wrote: @kikairoya I am sorry for my delay but currently I am on PTO. I will have a look early next week. https://github.com/llvm/llvm-project/pull/151818 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [KeyInstr] Enable -gkey-instructions by default if optimisations are enabled (PR #149509)

2025-08-11 Thread David Blaikie via cfe-commits
dwblaikie wrote: Cool - thansks for all the details. I'm fine with making the change in general then, but should get some thougths from the apple folks, probably @JDevlieghere or @adrian-prantl https://github.com/llvm/llvm-project/pull/149509 ___ cf

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -316,6 +330,13 @@ TemplateNameKind Sema::isTemplateName(Scope *S, } } + if (isPackProducingBuiltinTemplateName(Template) && + S->getTemplateParamParent() == nullptr) { +Diag(Name.getBeginLoc(), diag::err_builtin_pack_outside_template); +// Recover by ret

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -36,6 +40,7 @@ #include "clang/Sema/TemplateDeduction.h" #include "clang/Sema/TemplateInstCallback.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Support/Casting.h" ilya-biryukov wrote: Done. https://github.com/llvm/llvm-project/pull/106730

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -1,5 +1,4 @@ // RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -// XFAIL: asserts ilya-biryukov wrote: Yes, I managed to hit a similar case in the new testsuite and fixing it also fixed the corresponding assertion. I was going to follow up with checking all ex

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -5857,6 +5900,29 @@ bool Sema::CheckTemplateArgumentList( } } +// Check for builtins producing template packs at this position, we do not +// support them yet. ilya-biryukov wrote: Done. https://github.com/llvm/llvm-project/pull/106730 _

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -17,30 +17,44 @@ #include "clang/AST/DynamicRecursiveASTVisitor.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" +#include "clang/AST/Mangle.h" +#include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/TemplateBase.h" #include "clang/AST/TemplateName.h"

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -1914,7 +1914,8 @@ Decl *TemplateDeclInstantiator::VisitFriendDecl(FriendDecl *D) { UnsignedOrNone NumExpansions = std::nullopt; if (SemaRef.CheckParameterPacksForExpansion( D->getEllipsisLoc(), D->getSourceRange(), Unexpanded, -

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -5154,6 +5177,84 @@ bool TreeTransform::TransformTemplateArguments( } +template +bool TreeTransform::PreparePackForExpansion(TemplateArgumentLoc In, + bool Uneval, + Te

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -71,12 +73,17 @@ inline std::pair getDepthAndIndex(const NamedDecl *ND) { } /// Retrieve the depth and index of an unexpanded parameter pack. -inline std::pair +/// Returns nullopt when the unexpanded packs do not correspond to template +/// parameters, e.g. __builtin_dedu

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -228,7 +228,9 @@ void threadSafetyCleanup(BeforeSet *Cache); // FIXME: No way to easily map from TemplateTypeParmTypes to // TemplateTypeParmDecls, so we have this horrible PointerUnion. -typedef std::pair, +typedef std::pair, ilya-biryukov wrote: When we

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -6414,11 +6410,9 @@ Sema::InstantiateMemInitializers(CXXConstructorDecl *New, bool RetainExpansion = false; UnsignedOrNone NumExpansions = std::nullopt; if (CheckParameterPacksForExpansion(Init->getEllipsisLoc(), - B

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -5063,60 +5115,30 @@ bool TreeTransform::TransformTemplateArguments( } if (In.getArgument().isPackExpansion()) { - // We have a pack expansion, for which we will be substituting into - // the pattern. - SourceLocation Ellipsis; - UnsignedOrNone O

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -307,7 +307,7 @@ static UnsignedOrNone EvaluateFoldExpandedConstraintSize( UnsignedOrNone NumExpansions = FE->getNumExpansions(); if (S.CheckParameterPacksForExpansion( FE->getEllipsisLoc(), Pattern->getSourceRange(), Unexpanded, MLTAL, - Expand, Retai

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -777,12 +844,32 @@ bool Sema::CheckParameterPacksForExpansion( IdentifierInfo *Name; bool IsVarDeclPack = false; FunctionParmPackExpr *BindingPack = nullptr; +std::optional NumPrecomputedArguments; -if (const TemplateTypeParmType *TTP = -Par

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -25,6 +25,7 @@ #include "clang/AST/RawCommentList.h" #include "clang/AST/SYCLKernelInfo.h" #include "clang/AST/TemplateName.h" +#include "clang/AST/Type.h" ilya-biryukov wrote: I believe Clangd added it for `SubstBuiltinTemplatePackType` and it seems reaso

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -1510,6 +1517,21 @@ namespace { } } +MultiLevelTemplateArgumentList ForgetSubstitution() { + MultiLevelTemplateArgumentList New; + New.addOuterRetainedLevels(this->TemplateArgs.getNumLevels()); + + MultiLevelTemplateArgumentList Old = +

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -3331,6 +3343,65 @@ checkBuiltinTemplateIdType(Sema &SemaRef, BuiltinTemplateDecl *BTD, QualType HasNoTypeMember = Converted[2].getAsType(); return HasNoTypeMember; } + case BTK__builtin_dedup_pack: { +assert(Converted.size() == 1 && "__builtin_dedup_pack sho

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -935,15 +938,18 @@ class PackDeductionScope { S.collectUnexpandedParameterPacks(Pattern, Unexpanded); for (unsigned I = 0, N = Unexpanded.size(); I != N; ++I) { unsigned Depth, Index; -std::tie(Depth, Index) = getDepthAndIndex(Unexpanded[I]); +

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -4393,17 +4393,47 @@ void SubstTemplateTypeParmType::Profile(llvm::FoldingSetNodeID &ID, ID.AddBoolean(Final); } +SubstPackType::SubstPackType(TypeClass Derived, QualType Canon, + const TemplateArgument &ArgPack) +: Type(Derived, Canon, +

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -133,7 +133,7 @@ static void instantiateDependentAlignedAttr( // FIXME: Use the actual location of the ellipsis. SourceLocation EllipsisLoc = Aligned->getLocation(); if (S.CheckParameterPacksForExpansion(EllipsisLoc, Aligned->getRange(), -

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -17992,7 +17992,12 @@ DeclResult Sema::ActOnTemplatedFriendTag( collectUnexpandedParameterPacks(QualifierLoc, Unexpanded); unsigned FriendDeclDepth = TempParamLists.front()->getDepth(); for (UnexpandedParameterPack &U : Unexpanded) { -if (getDepthAndIndex(U).first

[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

2025-08-11 Thread Ilya Biryukov via cfe-commits
@@ -4014,8 +4010,8 @@ Decl *TemplateDeclInstantiator::instantiateUnresolvedUsingDecl( bool RetainExpansion = false; UnsignedOrNone NumExpansions = std::nullopt; if (SemaRef.CheckParameterPacksForExpansion( - D->getEllipsisLoc(), D->getSourceRange(), Unexpa

[clang] [clang] Enable constexpr handling for __builtin_elementwise_fma (PR #152919)

2025-08-11 Thread Chaitanya Koparkar via cfe-commits
https://github.com/ckoparkar updated https://github.com/llvm/llvm-project/pull/152919 >From 24139055908afd5d5f32c2ec975c5d831fa07174 Mon Sep 17 00:00:00 2001 From: Chaitanya Koparkar Date: Sat, 9 Aug 2025 07:18:20 -0400 Subject: [PATCH 1/2] [clang] Enable constexpr handling for __builtin_eleme

[clang] [clang] Enable constexpr handling for __builtin_elementwise_fma (PR #152919)

2025-08-11 Thread Chaitanya Koparkar via cfe-commits
@@ -141,6 +141,16 @@ static void diagnoseNonConstexprBuiltin(InterpState &S, CodePtr OpPC, S.CCEDiag(Loc, diag::note_invalid_subexpr_in_const_expr); } +// Same implementation as Compiler::getRoundingMode. +static llvm::RoundingMode getRoundingMode(const InterpState &S, co

[clang] [clang] Enable constexpr handling for __builtin_elementwise_fma (PR #152919)

2025-08-11 Thread Chaitanya Koparkar via cfe-commits
@@ -11,3 +11,55 @@ float V3 = func_01(1.0F, 2.0F); // CHECK: @V1 = {{.*}}global float 1.00e+00, align 4 // CHECK: @V2 = {{.*}}global float 1.00e+00, align 4 // CHECK: @V3 = {{.*}}global float 3.00e+00, align 4 + +void test_builtin_elementwise_fma_round_upward() { --

[clang] [clang] Enable constexpr handling for __builtin_elementwise_fma (PR #152919)

2025-08-11 Thread Chaitanya Koparkar via cfe-commits
@@ -11,3 +11,55 @@ float V3 = func_01(1.0F, 2.0F); // CHECK: @V1 = {{.*}}global float 1.00e+00, align 4 // CHECK: @V2 = {{.*}}global float 1.00e+00, align 4 // CHECK: @V3 = {{.*}}global float 3.00e+00, align 4 + +void test_builtin_elementwise_fma_round_upward() { +

[clang] [NFC][Clang][Docs] Update Pointer Authentication documentation (PR #152596)

2025-08-11 Thread Aaron Ballman via cfe-commits
@@ -47,16 +47,16 @@ This document serves four purposes: - It documents several language extensions that are useful on targets using pointer authentication. -- It will eventually present a theory of operation for the security mitigation, - describing the basic requirements f

[clang] [NFC][Clang][Docs] Update Pointer Authentication documentation (PR #152596)

2025-08-11 Thread Oliver Hunt via cfe-commits
@@ -500,12 +707,892 @@ type. Implementations are not required to make all bits of the result equally significant; in particular, some implementations are known to not leave meaningful data in the low bits. +Standard ``__ptrauth`` qualifiers +^

[clang] [NFC][Clang][Docs] Update Pointer Authentication documentation (PR #152596)

2025-08-11 Thread Oliver Hunt via cfe-commits
@@ -500,12 +707,892 @@ type. Implementations are not required to make all bits of the result equally significant; in particular, some implementations are known to not leave meaningful data in the low bits. +Standard ``__ptrauth`` qualifiers +^

  1   2   3   4   >