[llvm-branch-commits] [clang] release/21.x: [clang-format] Fix a crash in AlignArrayOfStructures (#167099) (PR #170967)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: None (llvmbot) Changes Backport 836919bb3449767fc1734e402d3ebf989acb Requested by: @owenca --- Full diff: https://github.com/llvm/llvm-project/pull/170967.diff 2 Files Affected: - (modified) clang/lib/Format/WhitespaceManage

[llvm-branch-commits] [clang] release/21.x: [clang-format] Fix a crash in AlignArrayOfStructures (#167099) (PR #170967)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @HazardyKnusperkeks What do you think about merging this PR to the release branch? https://github.com/llvm/llvm-project/pull/170967 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/m

[llvm-branch-commits] [clang] release/21.x: [clang-format] Fix a crash in AlignArrayOfStructures (#167099) (PR #170967)

2025-12-05 Thread via llvm-branch-commits
https://github.com/llvmbot milestoned https://github.com/llvm/llvm-project/pull/170967 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] release/21.x: [clang-format] Fix a crash in AlignArrayOfStructures (#167099) (PR #170967)

2025-12-05 Thread via llvm-branch-commits
https://github.com/llvmbot created https://github.com/llvm/llvm-project/pull/170967 Backport 836919bb3449767fc1734e402d3ebf989acb Requested by: @owenca >From 4f777458a44be780c6ddd42c6622aadf22e2fc75 Mon Sep 17 00:00:00 2001 From: owenca Date: Sun, 9 Nov 2025 17:35:54 -0800 Subject: [PATCH

[llvm-branch-commits] [clang] release/21.x: [clang-format] Don't swap `(const override)` with QAS_Right (#167191) (PR #170966)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: None (llvmbot) Changes Backport dfe9838f9c790aa632bed0a1b67976c2a7e95f76 Requested by: @owenca --- Full diff: https://github.com/llvm/llvm-project/pull/170966.diff 2 Files Affected: - (modified) clang/lib/Format/QualifierAlignme

[llvm-branch-commits] [clang] release/21.x: [clang-format] Don't swap `(const override)` with QAS_Right (#167191) (PR #170966)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @owenca What do you think about merging this PR to the release branch? https://github.com/llvm/llvm-project/pull/170966 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listin

[llvm-branch-commits] [clang] release/21.x: [clang-format] Don't swap `(const override)` with QAS_Right (#167191) (PR #170966)

2025-12-05 Thread via llvm-branch-commits
https://github.com/llvmbot milestoned https://github.com/llvm/llvm-project/pull/170966 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] release/21.x: [clang-format] Don't swap `(const override)` with QAS_Right (#167191) (PR #170966)

2025-12-05 Thread via llvm-branch-commits
https://github.com/llvmbot created https://github.com/llvm/llvm-project/pull/170966 Backport dfe9838f9c790aa632bed0a1b67976c2a7e95f76 Requested by: @owenca >From 17d714fcb43dd9361ba32895d2a185e008ac6961 Mon Sep 17 00:00:00 2001 From: owenca Date: Wed, 12 Nov 2025 20:55:34 -0800 Subject: [PATC

[llvm-branch-commits] [llvm] [BPF] add allows-misaligned-mem-access target feature (PR #168314)

2025-12-05 Thread Claire Fan via llvm-branch-commits
clairechingching wrote: @tru would appreciate it if you could merge this in the newly opened release, thank you! https://github.com/llvm/llvm-project/pull/168314 ___ llvm-branch-commits mailing list [email protected] https://lists.ll

[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #133538)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -15131,3 +15131,93 @@ bool ASTContext::useAbbreviatedThunkName(GlobalDecl VirtualMethodDecl, ThunksToBeAbbreviated[VirtualMethodDecl] = std::move(SimplifiedThunkNames); return Result; } + +bool ASTContext::arePFPFieldsTriviallyCopyable(const RecordDecl *RD) const { + b

[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #133538)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -1310,21 +1310,91 @@ static llvm::Value *CoerceIntOrPtrToIntOrPtr(llvm::Value *Val, llvm::Type *Ty, return Val; } +static std::vector findPFPCoercedFields(CodeGenFunction &CGF, + QualType SrcFETy) { + // Coercion directly

[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #133538)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -15131,3 +15131,93 @@ bool ASTContext::useAbbreviatedThunkName(GlobalDecl VirtualMethodDecl, ThunksToBeAbbreviated[VirtualMethodDecl] = std::move(SimplifiedThunkNames); return Result; } + +bool ASTContext::arePFPFieldsTriviallyCopyable(const RecordDecl *RD) const { + b

[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #133538)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -0,0 +1,70 @@ + +Structure Protection + + +.. contents:: + :local: + + +Introduction + + +Structure protection is an *experimental* mitigation +against use-after-free vulnerabilities. For +more information, please see the or

[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #133538)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -2643,6 +2643,19 @@ def CountedByOrNull : DeclOrTypeAttr { let LangOpts = [COnly]; } +def NoFieldProtection : DeclOrTypeAttr { + let Spellings = [Clang<"no_field_protection">]; pcc wrote: I figured that we could use the same attribute for e.g. enum fiel

[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #133538)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -15131,3 +15131,93 @@ bool ASTContext::useAbbreviatedThunkName(GlobalDecl VirtualMethodDecl, ThunksToBeAbbreviated[VirtualMethodDecl] = std::move(SimplifiedThunkNames); return Result; } + +bool ASTContext::arePFPFieldsTriviallyCopyable(const RecordDecl *RD) const { + b

[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #133538)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -15131,3 +15131,93 @@ bool ASTContext::useAbbreviatedThunkName(GlobalDecl VirtualMethodDecl, ThunksToBeAbbreviated[VirtualMethodDecl] = std::move(SimplifiedThunkNames); return Result; } + +bool ASTContext::arePFPFieldsTriviallyCopyable(const RecordDecl *RD) const { + b

[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #133538)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -4522,18 +4522,48 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, Address Dest = EmitPointerWithAlignment(E->getArg(0)); Address Src = EmitPointerWithAlignment(E->getArg(1)); Value *SizeVal = EmitScalarExpr(E->getArg(2)); +

[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #133538)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -15131,3 +15131,93 @@ bool ASTContext::useAbbreviatedThunkName(GlobalDecl VirtualMethodDecl, ThunksToBeAbbreviated[VirtualMethodDecl] = std::move(SimplifiedThunkNames); return Result; } + +bool ASTContext::arePFPFieldsTriviallyCopyable(const RecordDecl *RD) const { + b

[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #133538)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -15131,3 +15131,93 @@ bool ASTContext::useAbbreviatedThunkName(GlobalDecl VirtualMethodDecl, ThunksToBeAbbreviated[VirtualMethodDecl] = std::move(SimplifiedThunkNames); return Result; } + +bool ASTContext::arePFPFieldsTriviallyCopyable(const RecordDecl *RD) const { + b

[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #133538)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -3141,6 +3141,17 @@ defm experimental_omit_vtable_rtti : BoolFOption<"experimental-omit-vtable-rtti" NegFlag, BothFlags<[], [CC1Option], " the RTTI component from virtual tables">>; +defm experimental_pointer_field_protection : BoolFOption<"experimental-pointer-field-

[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #133538)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -15131,3 +15131,93 @@ bool ASTContext::useAbbreviatedThunkName(GlobalDecl VirtualMethodDecl, ThunksToBeAbbreviated[VirtualMethodDecl] = std::move(SimplifiedThunkNames); return Result; } + +bool ASTContext::arePFPFieldsTriviallyCopyable(const RecordDecl *RD) const { + b

[llvm-branch-commits] [libcxx] Prepare libcxx and libcxxabi for pointer field protection. (PR #151651)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -1067,6 +1067,12 @@ typedef __char32_t char32_t; #define _LIBCPP_DIAGNOSE_NULLPTR # endif +# if __has_cpp_attribute(_Clang::__no_field_protection__) +#define _LIBCPP_NO_PFP [[_Clang::__no_field_protection__]] +# else +#define _LIBCPP_NO_PFP +# endif

[llvm-branch-commits] [libcxx] Prepare libcxx and libcxxabi for pointer field protection. (PR #151651)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -214,7 +214,11 @@ set(LIBCXX_LIBRARY_VERSION "${LIBCXX_ABI_VERSION}.0" CACHE STRING For example, -DLIBCXX_LIBRARY_VERSION=x.y will result in the library being named libc++.x.y.dylib, along with the usual symlinks pointing to that. On Apple platforms, this also co

[llvm-branch-commits] Implement a simple e2e test for PFP. (PR #151655)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/151655 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] Implement a simple e2e test for PFP. (PR #151655)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/151655 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [libc++] Add build and CI support for pointer field protection (PR #152414)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/152414 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [libc++] Add build and CI support for pointer field protection (PR #152414)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/152414 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #133538)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133538 >From e816ed160ed53ff8d9d9039b778c41ecad8a7da2 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 6 Aug 2025 17:12:25 -0700 Subject: [PATCH 1/2] Add tests and documentation Created using spr 1.3.6-beta.1

[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #133538)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133538 >From e816ed160ed53ff8d9d9039b778c41ecad8a7da2 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 6 Aug 2025 17:12:25 -0700 Subject: [PATCH 1/2] Add tests and documentation Created using spr 1.3.6-beta.1

[llvm-branch-commits] [libc++] Annotate classes with _LIBCPP_PFP to enable pointer field protection (PR #151652)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/151652 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [libc++] Annotate classes with _LIBCPP_PFP to enable pointer field protection (PR #151652)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/151652 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [libcxx] Prepare libcxx and libcxxabi for pointer field protection. (PR #151651)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/151651 >From 7820ec4faa7ecb99217569794db9328211a61553 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Fri, 10 Oct 2025 16:11:52 -0700 Subject: [PATCH] Address review comments Created using spr 1.3.6-beta.1 --- li

[llvm-branch-commits] [libcxx] Prepare libcxx and libcxxabi for pointer field protection. (PR #151651)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/151651 >From 7820ec4faa7ecb99217569794db9328211a61553 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Fri, 10 Oct 2025 16:11:52 -0700 Subject: [PATCH] Address review comments Created using spr 1.3.6-beta.1 --- li

[llvm-branch-commits] AArch64: Emit PAuth ifuncs into the same comdat as the containing global. (PR #170965)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-backend-aarch64 Author: Peter Collingbourne (pcc) Changes PAuth ifuncs contain a relocation pointing to the section they are relocating (the place), so they need to be in the same comdat in order to avoid relocations pointing to discarded sections. ---

[llvm-branch-commits] AArch64: Emit PAuth ifuncs into the same comdat as the containing global. (PR #170965)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc closed https://github.com/llvm/llvm-project/pull/170965 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] AArch64: Emit PAuth ifuncs into the same comdat as the containing global. (PR #170965)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc created https://github.com/llvm/llvm-project/pull/170965 PAuth ifuncs contain a relocation pointing to the section they are relocating (the place), so they need to be in the same comdat in order to avoid relocations pointing to discarded sections. ___

[llvm-branch-commits] [llvm] [LTT] Add `unknown` branch weights when lowering type tests with conditional (PR #170752)

2025-12-05 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/170752 >From 7e39ae7d574415e8eccba307503aeb6acb7dfbbc Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Thu, 4 Dec 2025 13:48:43 -0800 Subject: [PATCH] [LTT] Add `unknown` branch weights when lowering type tests with

[llvm-branch-commits] [llvm] 4294dc7 - Revert "[IR] Don't store switch case values as operands (#166842)"

2025-12-05 Thread via llvm-branch-commits
Author: Vitaly Buka Date: 2025-12-05T18:37:56-08:00 New Revision: 4294dc7f4b577d1c59efd7bf1b0ea70662c0790b URL: https://github.com/llvm/llvm-project/commit/4294dc7f4b577d1c59efd7bf1b0ea70662c0790b DIFF: https://github.com/llvm/llvm-project/commit/4294dc7f4b577d1c59efd7bf1b0ea70662c0790b.diff L

[llvm-branch-commits] [llvm] [LTT] Add `unknown` branch weights when lowering type tests with conditional (PR #170752)

2025-12-05 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/170752 >From 4d65a22be0ad4b42ed6c6fe01b5fdcd2ebd17af4 Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Thu, 4 Dec 2025 13:48:43 -0800 Subject: [PATCH] [LTT] Add `unknown` branch weights when lowering type tests with

[llvm-branch-commits] [llvm] [LTT] Add `unknown` branch weights when lowering type tests with conditional (PR #170752)

2025-12-05 Thread Mircea Trofin via llvm-branch-commits
https://github.com/mtrofin updated https://github.com/llvm/llvm-project/pull/170752 >From 4d65a22be0ad4b42ed6c6fe01b5fdcd2ebd17af4 Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Thu, 4 Dec 2025 13:48:43 -0800 Subject: [PATCH] [LTT] Add `unknown` branch weights when lowering type tests with

[llvm-branch-commits] [libc] [libc][printf] De-string-viewify writer internals. (PR #170959)

2025-12-05 Thread Roland McGrath via llvm-branch-commits
frobtech wrote: I very much think this is the wrong direction. Using span / string_view style types rather than raw pointer / size pairs is something I really think we should aspire to stick to and move more outlier code towards. `cpp::string_view` is a polyfill for `std::string_view`, which

[llvm-branch-commits] [llvm] [BPF] add allows-misaligned-mem-access target feature (PR #168314)

2025-12-05 Thread Claire Fan via llvm-branch-commits
https://github.com/clairechingching updated https://github.com/llvm/llvm-project/pull/168314 >From 93282b2f8a2249bce33c7c87aa4d8704674f6c46 Mon Sep 17 00:00:00 2001 From: Claire xyz Date: Fri, 7 Nov 2025 11:08:47 -0500 Subject: [PATCH] [BPF] add allows-misaligned-mem-access target feature This

[llvm-branch-commits] [libc] [libc][printf] De-string-viewify writer internals. (PR #170959)

2025-12-05 Thread Alexey Samsonov via llvm-branch-commits
vonosmas wrote: This is stacked on top of PR #169089 , to reduce the usage of cpp::string_view in Writer / WriteBuffer to simplify further templatization. https://github.com/llvm/llvm-project/pull/170959 ___ llvm-branch-commits mailing list llvm-bran

[llvm-branch-commits] [libc] [libc][printf] De-string-viewify writer internals. (PR #170959)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-libc Author: Alexey Samsonov (vonosmas) Changes This change doesn't yet modify Writer::write(string_view) public API, which has a lot of uses through printf_core. For wide-char write functions (like swprintf) we'd need to templatize WriteBuffer and Writ

[llvm-branch-commits] [libc] [libc][printf] De-string-viewify writer internals. (PR #170959)

2025-12-05 Thread Alexey Samsonov via llvm-branch-commits
https://github.com/vonosmas ready_for_review https://github.com/llvm/llvm-project/pull/170959 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [libc] [libc][printf] De-string-viewify writer internals. (PR #170959)

2025-12-05 Thread Alexey Samsonov via llvm-branch-commits
https://github.com/vonosmas updated https://github.com/llvm/llvm-project/pull/170959 >From 008397fc8a6aa17b27aecd965c3fc2be433708c0 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Fri, 21 Nov 2025 19:45:34 + Subject: [PATCH 1/2] [libc] Refactor static polymorphism in WriteBuffer (NFC).

[llvm-branch-commits] [libc] [libc][printf] De-string-viewify writer internals. (PR #170959)

2025-12-05 Thread Alexey Samsonov via llvm-branch-commits
https://github.com/vonosmas created https://github.com/llvm/llvm-project/pull/170959 This change doesn't yet modify Writer::write(string_view) public API, which has a lot of uses through printf_core. For wide-char write functions (like swprintf) we'd need to templatize WriteBuffer and Writer to

[llvm-branch-commits] [llvm] [BPF] add allows-misaligned-mem-access target feature (PR #168314)

2025-12-05 Thread Claire Fan via llvm-branch-commits
https://github.com/clairechingching updated https://github.com/llvm/llvm-project/pull/168314 >From 349793e37921eb616e6d61e442835cc5d754359f Mon Sep 17 00:00:00 2001 From: Claire xyz Date: Fri, 7 Nov 2025 11:08:47 -0500 Subject: [PATCH] [BPF] add allows-misaligned-mem-access target feature This

[llvm-branch-commits] [llvm] Reland "AMDGPU/PromoteAlloca: Always use i32 for indexing (#170511)" (PR #170956)

2025-12-05 Thread Nicolai Hähnle via llvm-branch-commits
https://github.com/nhaehnle updated https://github.com/llvm/llvm-project/pull/170956 From 67b208e8dde9374a1dd796f7fe85f690d8b5729f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Fri, 5 Dec 2025 12:54:57 -0800 Subject: [PATCH] Reland "AMDGPU/PromoteAlloca: Always use i32

[llvm-branch-commits] [llvm] Reland "AMDGPU/PromoteAlloca: Always use i32 for indexing (#170511)" (PR #170956)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Nicolai Hähnle (nhaehnle) Changes Create more canonical code that may even lead to slightly better codegen. --- **Stack**: - [2/2] #170956 ⬅ - [1/2] #170955 ⚠️ *Part of a stack created by [spr](https://github.com/nhaehnle/spr).

[llvm-branch-commits] [llvm] Reland "AMDGPU/PromoteAlloca: Always use i32 for indexing (#170511)" (PR #170956)

2025-12-05 Thread Nicolai Hähnle via llvm-branch-commits
https://github.com/nhaehnle created https://github.com/llvm/llvm-project/pull/170956 Create more canonical code that may even lead to slightly better codegen. --- **Stack**: - [2/2] #170956 ⬅ - [1/2] #170955 ⚠️ *Part of a stack created by [spr](https://github.com/nhaehnle/spr). Merging this

[llvm-branch-commits] [NFC] [FlowSensitive] Fix missing namespace in MockHeaders (PR #170954)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Florian Mayer (fmayer) Changes This happened to work because we were missing both a namespace close and open and things happened to be included in the correct order. --- Full diff: https://github.com/llvm/llvm-project/pull/170954.diff 1

[llvm-branch-commits] [NFC] [FlowSensitive] Fix missing namespace in MockHeaders (PR #170954)

2025-12-05 Thread Florian Mayer via llvm-branch-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/170954 This happened to work because we were missing both a namespace close and open and things happened to be included in the correct order. ___ llvm-branch-commits mailing

[llvm-branch-commits] [libcxx] Prepare libcxx and libcxxabi for pointer field protection. (PR #151651)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -34,10 +34,13 @@ template struct __libcpp_is_trivially_relocatable : is_trivially_copyable<_Tp> {}; #endif +// __trivially_relocatable on libc++'s builtin types does not currently return the right answer with PFP. pcc wrote: The property is that the type

[llvm-branch-commits] [libcxx] Prepare libcxx and libcxxabi for pointer field protection. (PR #151651)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -300,7 +300,7 @@ class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_TYPE_INFO_VTABLE_POINTER_AUTH type_info protected: typedef __type_info_implementations::__impl __impl; - __impl::__type_name_t __type_name; + _LIBCPP_NO_PFP __impl::__type_name_t __type_name; pcc

[llvm-branch-commits] [llvm] [BPF] add allows-misaligned-mem-access target feature (PR #168314)

2025-12-05 Thread Claire Fan via llvm-branch-commits
https://github.com/clairechingching updated https://github.com/llvm/llvm-project/pull/168314 >From 812fb70d9be2962b002daaf319a08dc2231d155a Mon Sep 17 00:00:00 2001 From: Claire xyz Date: Fri, 7 Nov 2025 11:08:47 -0500 Subject: [PATCH] [BPF] add allows-misaligned-mem-access target feature This

[llvm-branch-commits] [FlowSensitive] [StatusOr] [15/15] Support references to Status(Or)* (PR #170951)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Florian Mayer (fmayer) Changes That hopefully concludes the initial upstreaming. --- Full diff: https://github.com/llvm/llvm-project/pull/170951.diff 2 Files Affected: - (modified) clang/lib/Analysis/FlowSensitive/Models/UncheckedStat

[llvm-branch-commits] [FlowSensitive] [StatusOr] [15/15] Support references to Status(Or)* (PR #170951)

2025-12-05 Thread Florian Mayer via llvm-branch-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/170951 That hopefully concludes the initial upstreaming. ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listi

[llvm-branch-commits] [FlowSensitive] [StatusOr] [15/N] Support nested StatusOrs (PR #170950)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang-analysis Author: Florian Mayer (fmayer) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/170950.diff 2 Files Affected: - (modified) clang/lib/Analysis/FlowSensitive/Models/UncheckedStatusOrAccessModel.cpp (+24) - (modified)

[llvm-branch-commits] [FlowSensitive] [StatusOr] [15/N] Support nested StatusOrs (PR #170950)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Florian Mayer (fmayer) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/170950.diff 2 Files Affected: - (modified) clang/lib/Analysis/FlowSensitive/Models/UncheckedStatusOrAccessModel.cpp (+24) - (modified) clang/uni

[llvm-branch-commits] [FlowSensitive] [StatusOr] [15/N] Support nested StatusOrs (PR #170950)

2025-12-05 Thread Florian Mayer via llvm-branch-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/170950 None ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [FlowSensitive] [StatusOr] [13/N] Add support for gtest ASSERTs (PR #170947)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Florian Mayer (fmayer) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/170947.diff 2 Files Affected: - (modified) clang/lib/Analysis/FlowSensitive/Models/UncheckedStatusOrAccessModel.cpp (+221) - (modified) clang/un

[llvm-branch-commits] [FlowSensitive] [StatusOr] [13/N] Add support for gtest ASSERTs (PR #170947)

2025-12-05 Thread Florian Mayer via llvm-branch-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/170947 None ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] SROA: Recognize llvm.protected.field.ptr intrinsics. (PR #151650)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -5875,6 +5895,32 @@ SROA::runOnAlloca(AllocaInst &AI) { return {Changed, CFGChanged}; } + for (auto &P : AS.partitions()) { +std::optional ProtectedFieldDisc; +// For now, we can't split if a field is accessed both via protected +// field and not. +fo

[llvm-branch-commits] [llvm] SROA: Recognize llvm.protected.field.ptr intrinsics. (PR #151650)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -158,6 +159,10 @@ class PtrUseVisitorBase { /// The constant offset of the use if that is known. APInt Offset; + // When this access is via an llvm.protected.field.ptr intrinsic, contains + // the second argument to the intrinsic, the discriminator. + Value *Protecte

[llvm-branch-commits] [llvm] SROA: Recognize llvm.protected.field.ptr intrinsics. (PR #151650)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -5875,6 +5895,32 @@ SROA::runOnAlloca(AllocaInst &AI) { return {Changed, CFGChanged}; } + for (auto &P : AS.partitions()) { +std::optional ProtectedFieldDisc; +// For now, we can't split if a field is accessed both via protected +// field and not. +fo

[llvm-branch-commits] [llvm] SROA: Recognize llvm.protected.field.ptr intrinsics. (PR #151650)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -641,6 +648,9 @@ class AllocaSlices { /// Access the dead users for this alloca. ArrayRef getDeadUsers() const { return DeadUsers; } + /// Access the PFP users for this alloca. pcc wrote: Yes, it would be better to mention the intrinsic as the field c

[llvm-branch-commits] [llvm] SROA: Recognize llvm.protected.field.ptr intrinsics. (PR #151650)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
@@ -5875,6 +5895,32 @@ SROA::runOnAlloca(AllocaInst &AI) { return {Changed, CFGChanged}; } + for (auto &P : AS.partitions()) { +std::optional ProtectedFieldDisc; +// For now, we can't split if a field is accessed both via protected pcc wrote: D

[llvm-branch-commits] AArch64: Relax restriction on discriminator when PAuth ifunc used. (PR #170945)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-backend-aarch64 Author: Peter Collingbourne (pcc) Changes When a PAuth ifunc is being used, we can represent any discriminator that we want in the code and don't need to be restricted to 16 bits. For now we only need this capability for address discrimin

[llvm-branch-commits] AArch64: Emit PAuth ifuncs into the same comdat as the containing global. (PR #170944)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-backend-aarch64 Author: Peter Collingbourne (pcc) Changes PAuth ifuncs contain a relocation pointing to the section they are relocating (the place), so they need to be in the same comdat in order to avoid relocations pointing to discarded sections. ---

[llvm-branch-commits] AArch64: Relax restriction on discriminator when PAuth ifunc used. (PR #170945)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc created https://github.com/llvm/llvm-project/pull/170945 When a PAuth ifunc is being used, we can represent any discriminator that we want in the code and don't need to be restricted to 16 bits. For now we only need this capability for address discriminated ptrauth expressi

[llvm-branch-commits] AArch64: Emit PAuth ifuncs into the same comdat as the containing global. (PR #170944)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc created https://github.com/llvm/llvm-project/pull/170944 PAuth ifuncs contain a relocation pointing to the section they are relocating (the place), so they need to be in the same comdat in order to avoid relocations pointing to discarded sections. ___

[llvm-branch-commits] [llvm] SROA: Recognize llvm.protected.field.ptr intrinsics. (PR #151650)

2025-12-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/151650 >From a4419c94b0812e3b9d4fea97f9f4fe9b9b10793c Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Fri, 5 Dec 2025 15:01:45 -0800 Subject: [PATCH] Address review comments Created using spr 1.3.6-beta.1 --- llv

[llvm-branch-commits] [llvm] DAG: Check if deoptimize call is available before emitting it (PR #170940)

2025-12-05 Thread via llvm-branch-commits
https://github.com/dantrushin approved this pull request. Looks good, though I wonder if deoptimize is unavailable, where it comes from then? (Why it is generated in IR?) https://github.com/llvm/llvm-project/pull/170940 ___ llvm-branch-commits mailing

[llvm-branch-commits] [FlowSensitive] [StatusOr] [12/N] Add support for smart pointers (PR #170943)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Florian Mayer (fmayer) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/170943.diff 2 Files Affected: - (modified) clang/lib/Analysis/FlowSensitive/Models/UncheckedStatusOrAccessModel.cpp (+48) - (modified) clang/uni

[llvm-branch-commits] [NFC] [FlowSensitive] Add mock unique_ptr header (PR #170942)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Florian Mayer (fmayer) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/170942.diff 1 Files Affected: - (modified) clang/unittests/Analysis/FlowSensitive/MockHeaders.cpp (+90) ``diff diff --git a/clang/unitte

[llvm-branch-commits] [FlowSensitive] [StatusOr] [12/N] Add support for smart pointers (PR #170943)

2025-12-05 Thread Florian Mayer via llvm-branch-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/170943 None ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [NFC] [FlowSensitive] Add mock unique_ptr header (PR #170942)

2025-12-05 Thread Florian Mayer via llvm-branch-commits
https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/170942 None ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] DAG: Check if deoptimize call is available before emitting it (PR #170940)

2025-12-05 Thread Matt Arsenault via llvm-branch-commits
https://github.com/arsenm ready_for_review https://github.com/llvm/llvm-project/pull/170940 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] DAG: Check if deoptimize call is available before emitting it (PR #170940)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Matt Arsenault (arsenm) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/170940.diff 2 Files Affected: - (modified) llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp (+10-2) - (modified) llvm/test/CodeGen/A

[llvm-branch-commits] [llvm] DAG: Check if deoptimize call is available before emitting it (PR #170940)

2025-12-05 Thread Matt Arsenault via llvm-branch-commits
arsenm wrote: > [!WARNING] > This pull request is not mergeable via GitHub because a downstack PR is > open. Once all requirements are satisfied, merge this PR as a stack href="https://app.graphite.com/github/pr/llvm/llvm-project/170940?utm_source=stack-comment-downstack-mergeability-warning";

[llvm-branch-commits] [llvm] DAG: Check if deoptimize call is available before emitting it (PR #170940)

2025-12-05 Thread Matt Arsenault via llvm-branch-commits
https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/170940 None >From fd5029269d51e4d3f6627e25b7d6863c75a83f8b Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Thu, 4 Dec 2025 13:45:33 +0100 Subject: [PATCH] DAG: Check if deoptimize call is available before emitting

[llvm-branch-commits] [clang] [llvm] [PowerPC] Add support for AMO store builtins (PR #170933)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Maryam Moghadas (maryammo) Changes This commit adds 4 Clang builtins for PowerPC AMO store operations: __builtin_amo_stwat for 32-bit unsigned operations __builtin_amo_stdat for 64-bit unsigned operations __builtin_amo_stwat_s for 32-bit s

[llvm-branch-commits] [clang] [llvm] [PowerPC] Add support for AMO store builtins (PR #170933)

2025-12-05 Thread Maryam Moghadas via llvm-branch-commits
https://github.com/maryammo created https://github.com/llvm/llvm-project/pull/170933 This commit adds 4 Clang builtins for PowerPC AMO store operations: __builtin_amo_stwat for 32-bit unsigned operations __builtin_amo_stdat for 64-bit unsigned operations __builtin_amo_stwat_s for 32-bit signed

[llvm-branch-commits] [llvm] DAG: Use RuntimeLibcalls to legalize vector frem calls (PR #170719)

2025-12-05 Thread Matt Arsenault via llvm-branch-commits
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/170719 >From fd85d171a5c7db883e848e001243d95f4192aca9 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Thu, 4 Dec 2025 14:28:55 +0100 Subject: [PATCH] DAG: Use RuntimeLibcalls to legalize vector frem calls This cont

[llvm-branch-commits] [llvm] DAG: Use RuntimeLibcalls to legalize vector frem calls (PR #170719)

2025-12-05 Thread Matt Arsenault via llvm-branch-commits
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/170719 >From fd85d171a5c7db883e848e001243d95f4192aca9 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Thu, 4 Dec 2025 14:28:55 +0100 Subject: [PATCH] DAG: Use RuntimeLibcalls to legalize vector frem calls This cont

[llvm-branch-commits] [clang] 4c50d83 - Require darwin

2025-12-05 Thread Louis Dionne via llvm-branch-commits
Author: Louis Dionne Date: 2025-12-05T15:23:05-05:00 New Revision: 4c50d83e8ddecf0cf6f642671523e14770d1c3e7 URL: https://github.com/llvm/llvm-project/commit/4c50d83e8ddecf0cf6f642671523e14770d1c3e7 DIFF: https://github.com/llvm/llvm-project/commit/4c50d83e8ddecf0cf6f642671523e14770d1c3e7.diff

[llvm-branch-commits] [clang] 3ac8417 - Reapply "[clang][Darwin] Prefer the toolchain-provided libc++.dylib if there i…"

2025-12-05 Thread Louis Dionne via llvm-branch-commits
Author: Louis Dionne Date: 2025-12-05T15:19:05-05:00 New Revision: 3ac8417fb4d6d0916cf5082d76d9794420a9cd8e URL: https://github.com/llvm/llvm-project/commit/3ac8417fb4d6d0916cf5082d76d9794420a9cd8e DIFF: https://github.com/llvm/llvm-project/commit/3ac8417fb4d6d0916cf5082d76d9794420a9cd8e.diff

[llvm-branch-commits] [llvm] [ADT] Make use of subsetOf and anyCommon methods of BitVector (NFC) (PR #170876)

2025-12-05 Thread Jakub Kuderski via llvm-branch-commits
https://github.com/kuhar approved this pull request. https://github.com/llvm/llvm-project/pull/170876 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [ADT] Make use of subsetOf and anyCommon methods of BitVector (NFC) (PR #170876)

2025-12-05 Thread Jakub Kuderski via llvm-branch-commits
https://github.com/kuhar edited https://github.com/llvm/llvm-project/pull/170876 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [ADT] Make use of subsetOf and anyCommon methods of BitVector (NFC) (PR #170876)

2025-12-05 Thread Jakub Kuderski via llvm-branch-commits
https://github.com/kuhar commented: Can you add unit tests? https://github.com/llvm/llvm-project/pull/170876 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [compiler-rt] 12a532c - Revert "[clang][Darwin] Prefer the toolchain-provided libc++.dylib if there i…"

2025-12-05 Thread via llvm-branch-commits
Author: Kewen Meng Date: 2025-12-05T12:01:47-08:00 New Revision: 12a532cc430c3b89483ce9cc89bbfc7bea8541e5 URL: https://github.com/llvm/llvm-project/commit/12a532cc430c3b89483ce9cc89bbfc7bea8541e5 DIFF: https://github.com/llvm/llvm-project/commit/12a532cc430c3b89483ce9cc89bbfc7bea8541e5.diff LO

[llvm-branch-commits] [clang] [ExposeObjCDirect] Optimizations (PR #170619)

2025-12-05 Thread Peter Rong via llvm-branch-commits
https://github.com/DataCorrupted updated https://github.com/llvm/llvm-project/pull/170619 >From bbf2e85a9bc07a52c83d13af5db0d35878484b9a Mon Sep 17 00:00:00 2001 From: Peter Rong Date: Wed, 3 Dec 2025 22:45:04 -0800 Subject: [PATCH 1/9] [ExposeObjCDirect] Optimizations In many cases we can inf

[llvm-branch-commits] [TableGen] Slightly improve error location for a fatal error (PR #170790)

2025-12-05 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/170790 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [TableGen] Slightly improve error location for a fatal error (PR #170790)

2025-12-05 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/170790 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [clang] Use tighter lifetime bounds for C temporary arguments (PR #170518)

2025-12-05 Thread Paul Kirth via llvm-branch-commits
https://github.com/ilovepi updated https://github.com/llvm/llvm-project/pull/170518 >From d4164e5e7ae2952226e1178f0dde703290f43f55 Mon Sep 17 00:00:00 2001 From: Paul Kirth Date: Tue, 2 Dec 2025 15:14:32 -0800 Subject: [PATCH 1/6] [clang] Use tighter lifetime bounds for C temporary arguments

[llvm-branch-commits] [clang] [clang] Use tighter lifetime bounds for C temporary arguments (PR #170518)

2025-12-05 Thread Paul Kirth via llvm-branch-commits
https://github.com/ilovepi updated https://github.com/llvm/llvm-project/pull/170518 >From d4164e5e7ae2952226e1178f0dde703290f43f55 Mon Sep 17 00:00:00 2001 From: Paul Kirth Date: Tue, 2 Dec 2025 15:14:32 -0800 Subject: [PATCH 1/6] [clang] Use tighter lifetime bounds for C temporary arguments

[llvm-branch-commits] [llvm] [AMDGPU] Use different name scope for MIMGBaseOpcode (PR #170904)

2025-12-05 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Mirko Brkušanin (mbrkusanin) Changes Define MIMGBaseOpcode values with `enum class` instead of regular `enum` so they will be in a separate name scope from regular opcodes. These two groups of opcodes should not be mixed and keepin

[llvm-branch-commits] [llvm] [AMDGPU] Use different name scope for MIMGBaseOpcode (PR #170904)

2025-12-05 Thread Mirko Brkušanin via llvm-branch-commits
https://github.com/mbrkusanin created https://github.com/llvm/llvm-project/pull/170904 Define MIMGBaseOpcode values with `enum class` instead of regular `enum` so they will be in a separate name scope from regular opcodes. These two groups of opcodes should not be mixed and keeping them in diffe

[llvm-branch-commits] [llvm] release/21.x: [HEXAGON] [MachinePipeliner] Fix the DAG in case of dependent phis. (#135925) (PR #170749)

2025-12-05 Thread Ikhlas Ajbar via llvm-branch-commits
https://github.com/iajbar approved this pull request. Please merge this correctness fix. Thank you. https://github.com/llvm/llvm-project/pull/170749 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/

  1   2   >