LLVM/project 0a6eec1clang/lib/AST Decl.cpp, clang/lib/Sema SemaDecl.cpp

[Sema] Skip expansion statements when determing local extern context (#210512)

This bug showed up as a failed assertion that was asserting that if
not in a function or method context we should be in the global/file
context.

The root cause is that when determining the linkage context for a
decl we were failing to account for the existence of expansion
contexts. Ignoring the assertion failure, the functional effect of
this is that we would fail to detect incorrect local extern
declarations inside expansion contexts. The fix here is to make
sure that we use `getEnclosingNonExpansionStatementContext()` to
find the true DeclContext for the current scope.

The initial report only identified local extern function declarations
but the same bug occurred with extern var decls, but the path did
not lead to an assertion firing, just incorrect behaviour.

Thanks to Sirraide for explaining why this was going wrong, and

    [3 lines not shown]
DeltaFile
+73-0clang/test/SemaCXX/expansion-statements-local-extern-decls.cpp
+3-1clang/lib/AST/Decl.cpp
+1-1clang/lib/Sema/SemaDecl.cpp
+77-23 files

LLVM/project 6d2df92bolt/include/bolt/Core BinaryContext.h

Format
DeltaFile
+2-2bolt/include/bolt/Core/BinaryContext.h
+2-21 files

LLVM/project 9e5db7dlibc/src/__support/CPP string.h, libc/test/src/__support/CPP string_test.cpp

[libc][cpp::string] Do not include null terminator in capacity()

Currently, `capacity()` includes the null terminator of the backing buffer, which does not align with C++20's `std::string`. That is, `s.reserve(s.capacity())` should be a no-op. While there's no requirement these be in-sync, it is less surprising to align its behavior.

Also, this fixes the case where `reserve()` is called on an empty string, where previously the null terminator was not set.
DeltaFile
+28-10libc/src/__support/CPP/string.h
+21-3libc/test/src/__support/CPP/string_test.cpp
+49-132 files

LLVM/project 7273146bolt/include/bolt/Core BinaryContext.h, bolt/lib/Rewrite PseudoProbeRewriter.cpp SDTRewriter.cpp

[BOLT] Release pseudo-probe decoder after emit

Summary:
PseudoProbeRewriter builds sizable data structures and then
hold onto them after they are needed.
PseudoProbeRewriter::postEmitFinalizer() parses the input
.pseudo_probe sections into an MCPseudoProbeDecoder whose
address-to-probe and GUID-to-function-desc maps can be very large
(tens of GiB on big binaries with many probes). This is not used again
once probes have been updated, yet they survive into the memory-heavy
DWARF rewrite (updateDebugInfo), directly inflating BOLT's peak RSS at
the worst possible time.

This frees them at the end of the postEmitFinalizer() calls, before
updateDebugInfo runs.
DeltaFile
+7-0bolt/lib/Rewrite/PseudoProbeRewriter.cpp
+5-0bolt/include/bolt/Core/BinaryContext.h
+2-0bolt/lib/Rewrite/SDTRewriter.cpp
+14-03 files

LLVM/project a65c720llvm/include/llvm/ProfileData SampleProfReader.h, llvm/lib/ProfileData SampleProfReader.cpp

[ProfileData] Split EagerSampleProfileNameTable by key type (NFC) (#211126)

This patch splits EagerSampleProfileNameTable into two separate
classes, EagerStringSampleProfileNameTable and
EagerMD5SampleProfileNameTable.  This patch is meant to be a
preparation patch for centralizing and speeding up symbol membership
queries like "is this symbol in the name table?".

Currently, we have two problems with these membership queries:

- Customers build their own data structures like DenseSet<uint64_t> of
  MD5 values and StringSet<> to serve those queries.  That is, the
  sample profile loader does not directly serve those queries.

- There are two places, namely SampleProfileLoader::doInitialization
  and SampleProfileNameSet, where we build identical StringSet<> of the
  name table entries, costing compilation time at both construction and
  destruction time.


    [17 lines not shown]
DeltaFile
+20-3llvm/include/llvm/ProfileData/SampleProfReader.h
+8-4llvm/lib/ProfileData/SampleProfReader.cpp
+28-72 files

LLVM/project da798c2clang/lib/AST Decl.cpp, clang/lib/Sema SemaDecl.cpp

[Sema] Skip expansion statements when determing local extern context (#210512) (#211745)

This bug showed up as a failed assertion that was asserting that if
not in a function or method context we should be in the global/file
context.

The root cause is that when determining the linkage context for a
decl we were failing to account for the existence of expansion
contexts. Ignoring the assertion failure, the functional effect of
this is that we would fail to detect incorrect local extern
declarations inside expansion contexts. The fix here is to make
sure that we use `getEnclosingNonExpansionStatementContext()` to
find the true DeclContext for the current scope.

The initial report only identified local extern function declarations
but the same bug occurred with extern var decls, but the path did
not lead to an assertion firing, just incorrect behaviour.

Thanks to Sirraide for explaining why this was going wrong, and

    [2 lines not shown]
DeltaFile
+73-0clang/test/SemaCXX/expansion-statements-local-extern-decls.cpp
+3-1clang/lib/AST/Decl.cpp
+1-1clang/lib/Sema/SemaDecl.cpp
+77-23 files

LLVM/project b9222a4llvm/lib/Target/AMDGPU AMDGPU.td GCNSubtarget.h, llvm/test/MC/AMDGPU gfx13_asm_vds.s gfx13_asm_vds_err.s

[AMDGPU][GFX13] Remove support for LDS atomic add f64 (#211922)

This are not supported by gfx13.

Fixes ROCM-28488.
DeltaFile
+0-39llvm/test/MC/AMDGPU/gfx13_asm_vds.s
+8-5llvm/lib/Target/AMDGPU/AMDGPU.td
+8-0llvm/test/MC/AMDGPU/gfx13_asm_vds_err.s
+0-5llvm/lib/Target/AMDGPU/GCNSubtarget.h
+16-494 files

LLVM/project 1e7e6b3llvm/test/Analysis/CostModel/AArch64 min-max.ll fminmax.ll

[AArch64] Update min/max cost tests. NFC (#211931)
DeltaFile
+236-566llvm/test/Analysis/CostModel/AArch64/min-max.ll
+328-0llvm/test/Analysis/CostModel/AArch64/fminmax.ll
+564-5662 files

LLVM/project f138dedclang/include/clang/Analysis/Analyses/LifetimeSafety Loans.h Facts.h, clang/lib/Analysis/LifetimeSafety LoanPropagation.cpp Facts.cpp

[LifetimeSafety] Support field-sensitivity in lifetime tracking

This patch enables field-sensitivity when tracking lifetimes of nested objects.

- FactsGenerator now generates `PathElement::getField` for `MemberExpr` accesses, mapping fields to loans.
- LoanPropagation now propagates field paths along flow facts, appending fields to base loans.
- Removes false-positive warnings in `invalidations.cpp` where modifications to one field were incorrectly reported as invalidating iterators/pointers to another field.
- Adds comprehensive unit tests checking nested field access and placeholder fields.

TAG=agy
CONV=2cfd8d00-18d7-4a03-8d78-2aba2f9a8f23
DeltaFile
+106-36clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp
+72-30clang/unittests/Analysis/LifetimeSafetyTest.cpp
+82-10clang/test/Sema/LifetimeSafety/invalidations.cpp
+29-0clang/include/clang/Analysis/Analyses/LifetimeSafety/Loans.h
+15-11clang/lib/Analysis/LifetimeSafety/Facts.cpp
+24-0clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h
+328-874 files not shown
+362-9510 files

LLVM/project 3670a2bclang/lib/Analysis/LifetimeSafety FactsGenerator.cpp Loans.cpp, clang/test/Sema/LifetimeSafety invalidations.cpp

[LifetimeSafety] Support container interior paths and invalidations

This patch completes the implementation of path-sensitive lifetime tracking by supporting container interior paths (`.*`) and deep-nested invalidation.

- Enables `PathElement::getInterior` generation in `FactsGenerator` for GSL Owners and Views (e.g. member functions, function parameters, lambda captures).
- Removes bypass checks in `FactsGenerator::handleInvalidatingCall` to track container invalidation on fields.
- Updates `Checker` to use strict prefix comparison (`isStrictPrefixOf`) for container invalidations, ensuring invalidation of container contents (interior) correctly invalidates iterators but not other sibling fields.
- Reorganizes tests in `invalidations.cpp` by resolving duplicates and distributing them logically.
- Updates unit tests and sema tests with correct expectations for interior paths.

TAG=agy
CONV=2cfd8d00-18d7-4a03-8d78-2aba2f9a8f23
DeltaFile
+243-64clang/test/Sema/LifetimeSafety/invalidations.cpp
+228-67clang/unittests/Analysis/LifetimeSafetyTest.cpp
+30-10clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+9-4clang/test/Sema/LifetimeSafety/Inputs/lifetime-analysis.h
+12-0clang/lib/Analysis/LifetimeSafety/Loans.cpp
+9-2clang/lib/Analysis/LifetimeSafety/Checker.cpp
+531-1476 files

LLVM/project 0cacfedclang/include/clang/Analysis/Analyses/LifetimeSafety Loans.h Facts.h, clang/lib/Analysis/LifetimeSafety LoanPropagation.cpp Facts.cpp

[LifetimeSafety] Support field-sensitivity in lifetime tracking

This patch enables field-sensitivity when tracking lifetimes of nested objects.

- FactsGenerator now generates `PathElement::getField` for `MemberExpr` accesses, mapping fields to loans.
- LoanPropagation now propagates field paths along flow facts, appending fields to base loans.
- Removes false-positive warnings in `invalidations.cpp` where modifications to one field were incorrectly reported as invalidating iterators/pointers to another field.
- Adds comprehensive unit tests checking nested field access and placeholder fields.

TAG=agy
CONV=2cfd8d00-18d7-4a03-8d78-2aba2f9a8f23
DeltaFile
+106-36clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp
+72-30clang/unittests/Analysis/LifetimeSafetyTest.cpp
+82-10clang/test/Sema/LifetimeSafety/invalidations.cpp
+29-0clang/include/clang/Analysis/Analyses/LifetimeSafety/Loans.h
+15-11clang/lib/Analysis/LifetimeSafety/Facts.cpp
+24-0clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h
+328-874 files not shown
+362-9510 files

LLVM/project 7a225fcclang/lib/Analysis/LifetimeSafety FactsGenerator.cpp Loans.cpp, clang/test/Sema/LifetimeSafety invalidations.cpp

[LifetimeSafety] Support container interior paths and invalidations

This patch completes the implementation of path-sensitive lifetime tracking by supporting container interior paths (`.*`) and deep-nested invalidation.

- Enables `PathElement::getInterior` generation in `FactsGenerator` for GSL Owners and Views (e.g. member functions, function parameters, lambda captures).
- Removes bypass checks in `FactsGenerator::handleInvalidatingCall` to track container invalidation on fields.
- Updates `Checker` to use strict prefix comparison (`isStrictPrefixOf`) for container invalidations, ensuring invalidation of container contents (interior) correctly invalidates iterators but not other sibling fields.
- Reorganizes tests in `invalidations.cpp` by resolving duplicates and distributing them logically.
- Updates unit tests and sema tests with correct expectations for interior paths.

TAG=agy
CONV=2cfd8d00-18d7-4a03-8d78-2aba2f9a8f23
DeltaFile
+243-64clang/test/Sema/LifetimeSafety/invalidations.cpp
+228-67clang/unittests/Analysis/LifetimeSafetyTest.cpp
+30-10clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+9-4clang/test/Sema/LifetimeSafety/Inputs/lifetime-analysis.h
+12-0clang/lib/Analysis/LifetimeSafety/Loans.cpp
+9-2clang/lib/Analysis/LifetimeSafety/Checker.cpp
+531-1476 files

LLVM/project 0209269clang/lib/Analysis/LifetimeSafety Checker.cpp MovedLoans.cpp

[LifetimeSafety][NFC] Update Checker to use prefix comparison interfaces

This patch switches the Checker's expiry and invalidation checks to use `AccessPath::isPrefixOf` instead of equality (`==`).

Since all generated access paths are currently empty, `isPrefixOf` is behaviorally identical to `==` (NFC). This prepares the checker to handle nested paths (fields and container interiors) in subsequent commits.

TAG=agy
CONV=2cfd8d00-18d7-4a03-8d78-2aba2f9a8f23
DeltaFile
+3-3clang/lib/Analysis/LifetimeSafety/Checker.cpp
+1-1clang/lib/Analysis/LifetimeSafety/MovedLoans.cpp
+4-42 files

LLVM/project 7d3f6ddclang/include/clang/Analysis/Analyses/LifetimeSafety Loans.h, clang/lib/Analysis/LifetimeSafety Loans.cpp Checker.cpp

[LifetimeSafety][NFC] Refactor AccessPath and Loan representations

This patch refactors the internal representations of `AccessPath` and `Loan` to support path elements, preparing for field-sensitive and interior-sensitive lifetime tracking.

- Introduces `PathElement` representing a field or interior dereference.
- Refactors `AccessPath` to contain a base and a list of `PathElement`s.
- Updates `Loan` and `LoanManager` to use the new `AccessPath` structure.
- Refactors debug dump formatting to output path elements if present.
- Updates Checker and FactsGenerator to compile with the new interfaces, keeping logic behaviorally identical (NFC).

TAG=agy
CONV=2cfd8d00-18d7-4a03-8d78-2aba2f9a8f23
DeltaFile
+156-70clang/include/clang/Analysis/Analyses/LifetimeSafety/Loans.h
+45-21clang/lib/Analysis/LifetimeSafety/Loans.cpp
+17-10clang/lib/Analysis/LifetimeSafety/Checker.cpp
+2-5clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+220-1064 files

LLVM/project 3af6879lldb/include/lldb/Utility FileSpec.h, lldb/source/API SBStringList.cpp

Revert "[lldb] Remove ConstString from FileSpec" (#211927)

Reverts llvm/llvm-project#211394 as this introduces use-after-frees in
LLDB because we expect the underlying filename and directory to outlive
the FileSpec.
DeltaFile
+28-30lldb/source/Utility/FileSpec.cpp
+4-6lldb/include/lldb/Utility/FileSpec.h
+2-2lldb/source/Target/Statistics.cpp
+0-1lldb/source/API/SBStringList.cpp
+0-1lldb/source/Plugins/ObjectContainer/Big-Archive/ObjectContainerBigArchive.h
+0-1lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp
+34-419 files not shown
+34-5015 files

LLVM/project d3bddd7flang-rt/lib/cuda allocator.cpp, flang-rt/unittests/Runtime/CUDA AllocatorCUF.cpp

[flang-rt][cuda] Keep device-context cleanup probe from leaking a last-error (#211910)

The CUDA device runtime probes primary-context state during scope-exit
cleanup via a one-time
cudaGetDriverEntryPoint(`cuDevicePrimaryCtxGetState`) lookup. On some
runtime/driver combinations (e.g. a CUDA runtime newer than the
installed driver) that lookup fails and leaves a sticky error in the
thread's last-error slot. Since the probe runs between user kernel
launches, the user's next `cudaGetLastError()` misattributes the
leftover error to the launch, causing a spurious `invalid argument`
failure.

Fix: snapshot the last-error on entry and consume an error only if the
slot started clean, so the probe never leaks its own error and never
discards a pre-existing one.

Reproducer: a local device variable forces the guarded scope-exit device
cleanup on every call, so the probe's one-time lookup runs between the
two launches; the second `cudaGetLastError()` then observes the stale

    [38 lines not shown]
DeltaFile
+29-21flang-rt/lib/cuda/allocator.cpp
+12-0flang-rt/unittests/Runtime/CUDA/AllocatorCUF.cpp
+41-212 files

LLVM/project 9032e94libc/src/__support/CPP string.h, libc/test/src/__support/CPP string_test.cpp

[libc][cpp::string] Do not include null terminator in capacity()

Currently, `capacity()` includes the null terminator of the backing buffer, which does not align with C++20's `std::string`. That is, `s.reserve(s.capacity())` should be a no-op. While there's no requirement these be in-sync, it is less surprising to align its behavior.

Also, this fixes the case where `reserve()` is called on an empty string, where previously the null terminator was not set.
DeltaFile
+27-10libc/src/__support/CPP/string.h
+21-3libc/test/src/__support/CPP/string_test.cpp
+48-132 files

LLVM/project 84b931cclang-tools-extra/clang-doc JSONGenerator.cpp, clang-tools-extra/test/clang-doc/Inputs invalid-utf8-comment.cpp

Fix clang-doc crash when comment contains invalid UTF-8 bytes (#210886)

When a source file comment contains non-UTF-8 bytes (e.g., byte 0x97),
clang-doc's JSONGenerator would crash with an assertion failure:

  Assertion `false && "Invalid UTF-8 in value used as JSON"' failed.

This happens because json::Value(StringRef) asserts on invalid UTF-8
input in debug builds. While the release-build path calls fixUTF8()
automatically, the assertion crash affects developers and fuzzer runs.

Fix by following the same pattern used elsewhere in LLVM (lldb, clangd):
check isUTF8() before constructing a json::Value, and call fixUTF8() to
sanitize the string if invalid bytes are detected. This avoids an
unnecessary copy for the common case of valid UTF-8.

The fix covers all paths in serializeComment() where user-written text
from source comments enters JSON objects:
  - CK_TextComment (I.Text)

    [15 lines not shown]
DeltaFile
+46-0clang-tools-extra/test/clang-doc/json/invalid-utf8-comment.cpp
+10-4clang-tools-extra/clang-doc/JSONGenerator.cpp
+2-0clang-tools-extra/test/clang-doc/Inputs/invalid-utf8-comment.cpp
+58-43 files

LLVM/project 8e34b2clibunwind/include/mach-o compact_unwind_encoding.h, libunwind/src UnwindCursor.hpp Registers.hpp

[libunwind][arm64e] Mach-O Support unwinding PAuth_LR frames (#202772)

Under PAuth_LR, compact unwind entries marked UNWIND_ARM64_MODE_FRAME_PAUTH_LR are signed with the PC of the pacibsppc at the start of the range. The compiler may emit those entries with UNWIND_IS_NOT_FUNCTION_START when the pacibsppc is not the first instruction in the function; the unwinder must scan backwards past such entries to find the actual function start (and its LSDA pointer).

When unwinding a PAuth_LR frame, authenticate and re-sign using setIPPAuthLR(), which calls __builtin_ptrauth_auth_with_pc_and_resign when available, falling back to inline asm (autib171615 + pacib) for compilers that lack the builtin.

To reduce the size of Compact Unwind entries for shrinkwrapped frames, new offset bits encode the distance in multiples of 4 bytes from the range start to the pacibsppc. The compiler emits paired FRAMELESS/FRAMELESS+PAUTH_LR entries that the linker merges into a single FRAME_PAUTH_LR | (offset/4) << 12 encoding.

rdar://161907302&169746432&171118419
DeltaFile
+79-28libunwind/src/UnwindCursor.hpp
+31-10libunwind/src/Registers.hpp
+25-13libunwind/include/mach-o/compact_unwind_encoding.h
+18-5libunwind/src/DwarfInstructions.hpp
+17-2libunwind/src/CompactUnwinder.hpp
+170-585 files

LLVM/project a96af04clang/test/SemaHIP builtins-amdgcn-gfx1250-cooperative-atomics-templated.hip amdgpu-builtin-in-lambda-with-unsupported-attribute.hip

clang/AMDGPU: Migrate cc1 tests to subarch triples (8)

Rewrite SemaHIP cc1 test RUN lines to the new subarch triple form,
dropping the redundant -target-cpu.

Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
DeltaFile
+2-2clang/test/SemaHIP/builtins-amdgcn-gfx1250-cooperative-atomics-templated.hip
+2-2clang/test/SemaHIP/amdgpu-builtin-in-lambda-with-unsupported-attribute.hip
+2-2clang/test/SemaHIP/amdgpu-builtin-in-lambda.hip
+2-2clang/test/SemaHIP/amdgpu-feature-builtins-return-type-deduction.hip
+1-1clang/test/SemaHIP/amdgpu-global-load-lds-template.hip
+1-1clang/test/SemaHIP/builtins-amdgcn-buffer-format.hip
+10-1015 files not shown
+25-2521 files

LLVM/project a5ee360clang/test/CodeGenCXX amdgpu-float16.cpp sret_cast_with_nonzero_alloca_as.cpp, clang/test/Misc amdgcn.languageOptsOpenCL.cl

clang/AMDGPU: Migrate cc1 tests to subarch triples (7)

Rewrite the remaining small test directories (CodeGenCXX, Misc, Sema,
SemaCUDA, SemaCXX) cc1 RUN lines to the new subarch triple form, dropping
the redundant -target-cpu.

Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
DeltaFile
+4-4clang/test/CodeGenCXX/amdgpu-float16.cpp
+2-2clang/test/SemaCUDA/openmp-target.cu
+2-2clang/test/Sema/sizeof-struct-non-zero-as-member.cl
+1-1clang/test/SemaCUDA/builtins-unsafe-atomics-gfx90a.cu
+1-1clang/test/CodeGenCXX/sret_cast_with_nonzero_alloca_as.cpp
+1-1clang/test/Misc/amdgcn.languageOptsOpenCL.cl
+11-115 files not shown
+16-1611 files

LLVM/project 4a0e561clang/test/CIR/CodeGenHIP builtins-amdgcn-vi-f16.hip attr-target-amdgpu.hip

clang/AMDGPU: Migrate cc1 tests to subarch triples (6)

Rewrite CIR/CodeGenHIP cc1 test RUN lines to the new subarch triple form,
dropping the redundant -target-cpu, and regenerate autogenerated CHECK
lines.

Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
DeltaFile
+24-24clang/test/CIR/CodeGenHIP/builtins-amdgcn-vi-f16.hip
+23-22clang/test/CIR/CodeGenHIP/attr-target-amdgpu.hip
+15-14clang/test/CIR/CodeGenHIP/target-features.hip
+6-6clang/test/CIR/CodeGenHIP/builtins-amdgcn-logb-scalbn.hip
+6-6clang/test/CIR/CodeGenHIP/builtins-amdgcn.hip
+6-6clang/test/CIR/CodeGenHIP/amdgcn-buffer-rsrc-type.hip
+80-786 files not shown
+106-10412 files

LLVM/project 8ba8c16compiler-rt/lib/tsan/rtl tsan_rtl_ppc64.S

[tsan][ppc64] Fix copy-paste bug in __sigsetjmp OPD TOC loading (#210589)

In `__sigsetjmp`'s big-endian OPD path, the TOC was loaded from
`_setjmp`'s OPD entry instead of `__sigsetjmp`'s own entry, due to a
copy-paste error.

```diff
-        addis   r2,r2,_setjmp-1b at ha
-        addi    r2,r2,_setjmp-1b at l
+        addis   r2,r2,__sigsetjmp-1b at ha
+        addi    r2,r2,__sigsetjmp-1b at l
```

This caused an incorrect TOC pointer to be loaded on big-endian PPC64
when `__sigsetjmp`/sigsetjmp was intercepted by TSan. The corresponding
`_setjmp` path (which uses label `0b`) correctly references its own
symbol for the OPD lookup.

Co-authored-by: pmr <prabhas at pmrs-MacBook.local>
DeltaFile
+2-2compiler-rt/lib/tsan/rtl/tsan_rtl_ppc64.S
+2-21 files

LLVM/project 03efec4lldb/include/lldb/Host HostInfoBase.h, lldb/include/lldb/Utility FileSpec.h

Revert "[lldb] Remove ConstString from FileSpec (#211394)"

This reverts commit 8231fda982ba419bc8ac05a45ec752e00218db8b.
DeltaFile
+28-30lldb/source/Utility/FileSpec.cpp
+4-6lldb/include/lldb/Utility/FileSpec.h
+2-2lldb/source/Target/Statistics.cpp
+0-1lldb/source/API/SBCommunication.cpp
+0-1lldb/include/lldb/Host/HostInfoBase.h
+0-1lldb/source/API/SBBroadcaster.cpp
+34-419 files not shown
+34-5015 files

LLVM/project 2921002libc/src/__support/GPU allocator.cpp

[libc] Small correctness tweaks to GPU allocator (#211610)

Summary:
Small bugs, like more strict C++ lifetime ordering for the header and
fixing a bug in alignment sizing.
DeltaFile
+29-20libc/src/__support/GPU/allocator.cpp
+29-201 files

LLVM/project 8c6ecefclang/lib/AST Decl.cpp, clang/lib/Sema SemaDecl.cpp

[Sema] Skip expansion statements when determing local extern context (#210512)

This bug showed up as a failed assertion that was asserting that if
not in a function or method context we should be in the global/file
context.

The root cause is that when determining the linkage context for a
decl we were failing to account for the existence of expansion
contexts. Ignoring the assertion failure, the functional effect of
this is that we would fail to detect incorrect local extern
declarations inside expansion contexts. The fix here is to make
sure that we use `getEnclosingNonExpansionStatementContext()` to
find the true DeclContext for the current scope.

The initial report only identified local extern function declarations
but the same bug occurred with extern var decls, but the path did
not lead to an assertion firing, just incorrect behaviour.

Thanks to Sirraide for explaining why this was going wrong, and

    [3 lines not shown]
DeltaFile
+73-0clang/test/SemaCXX/expansion-statements-local-extern-decls.cpp
+3-1clang/lib/AST/Decl.cpp
+1-1clang/lib/Sema/SemaDecl.cpp
+77-23 files

LLVM/project 83a944aclang/lib/AST Decl.cpp, clang/lib/Sema SemaDecl.cpp

[Sema] Skip expansion statements when determing local extern context (#210512)

This bug showed up as a failed assertion that was asserting that if
not in a function or method context we should be in the global/file
context.

The root cause is that when determining the linkage context for a
decl we were failing to account for the existence of expansion
contexts. Ignoring the assertion failure, the functional effect of
this is that we would fail to detect incorrect local extern
declarations inside expansion contexts. The fix here is to make
sure that we use `getEnclosingNonExpansionStatementContext()` to
find the true DeclContext for the current scope.

The initial report only identified local extern function declarations
but the same bug occurred with extern var decls, but the path did
not lead to an assertion firing, just incorrect behaviour.

Thanks to Sirraide for explaining why this was going wrong, and

    [6 lines not shown]
DeltaFile
+75-0clang/test/SemaCXX/expansion-statements-local-extern-decls.cpp
+4-34clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
+35-0clang/test/SemaCXX/Inputs/initializer-list.h
+3-1clang/lib/AST/Decl.cpp
+1-1clang/lib/Sema/SemaDecl.cpp
+118-365 files

LLVM/project c20b302llvm/lib/Target/AArch64 AArch64InstrInfo.cpp SVEInstrFormats.td, llvm/lib/Target/AArch64/MCTargetDesc AArch64MCTargetDesc.h

[AArch64] Add a OPERAND_IMM_UINT4p1 operand type (#211925)
DeltaFile
+6-0llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+6-0llvm/test/CodeGen/AArch64/verify-imm.mir
+4-0llvm/lib/Target/AArch64/SVEInstrFormats.td
+3-0llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp
+1-0llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.h
+20-05 files

LLVM/project b545f9flibc/include/llvm-libc-macros limits-macros.h endian-macros.h, libc/include/llvm-libc-macros/linux sys-stat-macros.h unistd-macros.h

[libc] Add missing standard and Linux header macros (#211862)

Add missing header macro constants:

* endian-macros.h: __BYTE_ORDER, __LITTLE_ENDIAN, and __BIG_ENDIAN
* sys-stat-macros.h: S_IREAD, S_IWRITE, S_IEXEC, and ACCESSPERMS
* limits-macros.h: _POSIX_HOST_NAME_MAX and HOST_NAME_MAX
* unistd-macros.h: TEMP_FAILURE_RETRY

POSIX.1-2017 specifies _POSIX_HOST_NAME_MAX as 255. The Linux
gethostname(2) man page specifies HOST_NAME_MAX as 64. The
double-underscore byte order macros and TEMP_FAILURE_RETRY macro follow
the Linux and GNU C library conventions.

Assisted-by: Automated tooling, human reviewed.
DeltaFile
+14-1libc/include/llvm-libc-macros/limits-macros.h
+12-1libc/include/llvm-libc-macros/linux/sys-stat-macros.h
+10-1libc/include/llvm-libc-macros/endian-macros.h
+11-0libc/include/llvm-libc-macros/linux/unistd-macros.h
+47-34 files

LLVM/project 9a46117llvm/lib/Target/AMDGPU AMDGPU.td GCNSubtarget.h, llvm/test/MC/AMDGPU gfx13_asm_vds.s gfx13_asm_vds_err.s

[AMDGPU][GFX13] Remove support for LDS atomic add f64

This are not supported by gfx13.

Fixes ROCM-28488.
DeltaFile
+0-39llvm/test/MC/AMDGPU/gfx13_asm_vds.s
+8-5llvm/lib/Target/AMDGPU/AMDGPU.td
+8-0llvm/test/MC/AMDGPU/gfx13_asm_vds_err.s
+0-5llvm/lib/Target/AMDGPU/GCNSubtarget.h
+16-494 files