LLVM/project ea74310 — clang/include/clang/AST ASTContext.h RecordLayout.h, clang/lib/AST ASTContext.cpp RecordLayout.cpp

[Clang][Windows] Preserve natural alignment for vector and x86_fp80 arrays under #pragma pack. (#208256)

This is to fix a misalignment issue when using `-mlong-double-80` on
Windows with types containing `long double` inside STL containers or
structures with `#pragma pack(8)`.
On Windows, MSVC STL headers use `#pragma pack(8)` which limits struct
alignment to 8
bytes. When `-mlong-double-80` is used, `long double` becomes `x86_fp80`
which requires 16-byte alignment for correctness (movaps instructions).
This creates a conflict:
- Array allocated with 8-byte alignment (due to pragma pack)
  - Element type requires 16-byte alignment
- memcpy assumes 16-byte alignment
- Result: Crash due to misaligned access
Example:
```cpp
#include <array>
struct Klass { long double a; };
void test() {

    [2 lines not shown]
DeltaFile
+168-0clang/test/CodeGen/pragma-pack-array-alignment-msvc.cpp
+37-7clang/lib/AST/RecordLayoutBuilder.cpp
+11-10clang/lib/AST/RecordLayout.cpp
+13-2clang/include/clang/AST/RecordLayout.h
+8-2clang/include/clang/AST/ASTContext.h
+8-1clang/lib/AST/ASTContext.cpp
+245-221 files not shown
+252-227 files

LLVM/project 6a6534c — clang/lib/StaticAnalyzer/Core SimpleSValBuilder.cpp, clang/test/Analysis PR38208.c aggressive-binop-simpl-complexity.c

[analyzer] Respect symbol complexity bound in tryRearrange (#227367)

The `tryRearrange` logic of the `SValBuilder` lets the analyzer engine
conclude e.g. that `(x + 1) - x` is equal to 1. Unfortunately it had to
be disabled by default because it used low-level `SymMgr.acquire` calls
to construct symbols, which did not respect the symbol complexity limit
and could cause exponential slowdowns in corner cases.

This commit switches to using `SValBuilder::makeSymExprValNN` instead of
those `acquire` calls, because that higher-level method respects the
symbol complexity limits.

This patch only affects the analysis in the case when off-by-default
option aggressive-binary-operation-simplification is enabled. In the
future I intend to enable this simplification by default, at least for
the case of additive operations (which are mathematically "simpler").
DeltaFile
+26-18clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
+30-0clang/test/Analysis/aggressive-binop-simpl-complexity.c
+5-2clang/test/Analysis/PR38208.c
+61-203 files

LLVM/project 1726325 — compiler-rt/lib/asan/tests asan_fake_stack_test.cpp

[compiler-rt][asan] Disable FakeStack CreateDestroy test on AArch64 Linux (#231118)

Is flaky, see https://github.com/llvm/llvm-project/issues/231115.
DeltaFile
+4-0compiler-rt/lib/asan/tests/asan_fake_stack_test.cpp
+4-01 files

LLVM/project b58dd0d — clang/lib/StaticAnalyzer/Checkers CStringChecker.cpp, clang/test/Analysis PR228865.cpp

[analyzer] Ignore nonstandard function named 'memset' (#229119)

Previously CStringChecker ran into an assertion failure when it
encountered a function named 'memset' whose third argument was a `const
int &` instead of the standard `size_t`.

This PR introduces an early return to avoid this.

Fixes #228865

Reported-by: k-arrows
DeltaFile
+20-0clang/test/Analysis/PR228865.cpp
+5-0clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
+25-02 files

LLVM/project 448a654 — llvm/lib/Target/Mips MipsRegisterBankInfo.cpp, llvm/test/CodeGen/Mips/GlobalISel/regbankselect debug-uses.mir

[Mips][GlobalISel] Ignore debug uses in register bank inference (#229948)

Mips GlobalISel currently considers debug instructions when inferring
register banks for ambiguous generic instructions. A `DBG_VALUE` can
therefore cause an ordinary floating-point value to be assigned to
`gprb` instead of `fprb`.

Ignore debug instructions when walking direct uses and COPY chains. This
also handles an unconstrained 32-bit `G_IMPLICIT_DEF` as an ambiguous
value, mapping it to `gprb` instead of asserting after its debug-only
use is ignored.

The MIR test covers a direct debug use, a COPY with only a debug use,
and a 32-bit `G_IMPLICIT_DEF` with only a debug use.

Fixes #229625

Assisted-by: OpenAI Codex 5.6 Sol, co-reviewed by Claude and Yongqiang
Tian.
DeltaFile
+125-0llvm/test/CodeGen/Mips/GlobalISel/regbankselect/debug-uses.mir
+5-4llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp
+130-42 files

LLVM/project dcc3317 — llvm/lib/Transforms/Vectorize LoopVectorizationLegality.cpp

Address comments.
DeltaFile
+4-4llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
+4-41 files

LLVM/project 1737935 — llvm/lib/Passes PassBuilderPipelines.cpp, llvm/test/Other new-pm-lto-defaults.ll

[Passes] Run MergeICmps/ExpandMemCmps in LTO post-link pipeline (#230562)

Otherwise memcmp will never get expanded if running the combination of
ThinLTO pre-link and LTO post-link, which is what Rust does, and what
unified LTO does.

The pipeline position is chosen to roughly match what the module
optimization pipeline does. There is no compile-time impact.

For https://github.com/rust-lang/rust/issues/163677.
DeltaFile
+56-0llvm/test/Transforms/PhaseOrdering/X86/expand-memcmp-middle-end.ll
+7-1llvm/lib/Passes/PassBuilderPipelines.cpp
+2-0llvm/test/Other/new-pm-lto-defaults.ll
+65-13 files

LLVM/project 5f42176 — lldb/test/API/api/multithreaded TestMultithreaded.py

[lldb][test] Disable another part of TestMultithreaded.py on Windows (#231114)

Due to flaky results. See
https://github.com/llvm/llvm-project/issues/231113.

Fails on Windows on Arm mostly but I don't see why it wouldn't fail on
x86_64 too.
DeltaFile
+1-0lldb/test/API/api/multithreaded/TestMultithreaded.py
+1-01 files

LLVM/project d8749d7 — clang/docs ReleaseNotes.md, clang/lib/Sema SemaTemplate.cpp

[Clang] Suggest missing typename to dependent packs (#230766)

We were not correctly handling packs in the error-recovery path

Fixes https://github.com/llvm/llvm-project/issues/75248
DeltaFile
+18-0clang/test/SemaTemplate/typename-specifier.cpp
+13-3clang/lib/Sema/SemaTemplate.cpp
+3-1clang/docs/ReleaseNotes.md
+34-43 files

LLVM/project 9386502 — llvm/lib/Target/NVPTX NVPTXInstrInfo.td, llvm/test/CodeGen/NVPTX i1-select.ll atomics-b128.ll

[NVPTX] Fold predicate boolean operations into comparisons (#229769)

Select the fused setp.CmpOp.BoolOp forms for integer and floating-point
comparisons followed by predicate AND, OR, or XOR to optimise away these
separate predicate operations.
DeltaFile
+92-108llvm/test/CodeGen/NVPTX/i128.ll
+186-0llvm/test/CodeGen/NVPTX/setp-bool.ll
+83-2llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
+37-47llvm/test/CodeGen/NVPTX/i1-icmp.ll
+28-36llvm/test/CodeGen/NVPTX/atomics-b128.ll
+15-19llvm/test/CodeGen/NVPTX/i1-select.ll
+441-2126 files

LLVM/project 95a6d39 — llvm/lib/Target/SPIRV SPIRVModuleAnalysis.h SPIRVAsmPrinter.cpp

[SPIR-V] Move MIR rewrites out of SPIRVModuleAnalysis (#229736)

Analysis pass must not change the IR it analyzes

Move all modifications from there to a new separate
spirv-prepare-module-analysis pass

Discussed in https://github.com/llvm/llvm-project/pull/227376
DeltaFile
+86-77llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
+13-1llvm/lib/Target/SPIRV/SPIRVMCInstLower.cpp
+11-0llvm/lib/Target/SPIRV/SPIRV.h
+0-10llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+5-2llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h
+7-0llvm/lib/Target/SPIRV/SPIRVAsmPrinter.cpp
+122-908 files not shown
+141-9414 files

LLVM/project 4bb26aa — libc/config/linux/x86_64 entrypoints.txt, libc/include time.yaml

[libc] Implement clock_getres in time (#230826)

Implement the standard POSIX.1-2008 / POSIX.1-2024 function
`clock_getres` in `<time.h>` on Linux and register it in the Linux
target entrypoints.

Fixes #230532
DeltaFile
+32-0libc/src/time/linux/clock_getres.cpp
+16-0libc/src/time/linux/CMakeLists.txt
+7-1libc/test/src/time/clock_getres_test.cpp
+7-0libc/include/time.yaml
+2-0libc/test/src/time/CMakeLists.txt
+1-0libc/config/linux/x86_64/entrypoints.txt
+65-12 files not shown
+67-18 files

LLVM/project 23ad5c8 — libcxx/include __hash_table, libcxx/test/benchmarks/containers/associative unordered_multiset.bench.cpp associative_container_benchmarks.h

[libc++] Avoid key_eq calls in hash_table rehash (#216551)

Use the cached hash to avoid calling `key_eq` which might be costly.

Per `[unord.req.general]#9`, for `unordered_multiset` and
`unordered_multimap`,
rehashing preserves the relative ordering of equivalent elements. These
elements
are contiguous and share the same key and hash.

For elements with the same hash but different keys (if any), their
relative order
is not required, but it is preserved for simplicity.

This is still not applied to unique-key containers (`unordered_set` and
`unordered_map`), where same-hash contiguous blocks are rare and the
extra
check would not be worthwhile.


    [2 lines not shown]
DeltaFile
+24-0libcxx/test/benchmarks/containers/associative/associative_container_benchmarks.h
+1-3libcxx/include/__hash_table
+2-0libcxx/test/benchmarks/containers/associative/unordered_multiset.bench.cpp
+27-33 files

LLVM/project ff97c6f — llvm/docs LangRef.md

[LangRef] Clarify poison input elements give poison in llvm.mask.beforefirst (#230551)

This matches #223935 and reflects the generic expansion.
DeltaFile
+2-0llvm/docs/LangRef.md
+2-01 files

LLVM/project e400d74 — llvm/lib/Target/X86 X86FastPreTileConfig.cpp, llvm/test/CodeGen/X86/AMX amx-fastconfig-spill.mir amx-fastconfig-debug-use.mir

[X86][AMX] Fix use iteration when reloading tiles in FastPreTileConfig (#228724)

`reload()` moved the rewritten operand off the use list being iterated,
so only the first use of a tile was reloaded. A DBG_VALUE was also
treated as a use; when it came first, the real use kept the clobbered
tile and `FastRegAlloc` crashed.

Iterate the non-debug uses with `make_early_inc_range`. Debug uses are
no longer reloaded, so `FastRegAlloc` drops their location.

Fixes #228712

Assisted-by: Claude Opus 5.5
DeltaFile
+72-0llvm/test/CodeGen/X86/AMX/amx-fastconfig-debug-use.mir
+52-0llvm/test/CodeGen/X86/AMX/amx-fastconfig-spill.mir
+3-1llvm/lib/Target/X86/X86FastPreTileConfig.cpp
+127-13 files

LLVM/project 00a6906 — llvm/test/CodeGen/AMDGPU amdgcn.bitcast.96bit.ll amdgcn.bitcast.128bit.ll, llvm/test/CodeGen/X86 atomic-load-store.ll

[SelectionDAG] avoid rounding exact f32->bf16 (STRICT_)FP_ROUND

For f32-to-bf16, DAGTypeLegalizer::SoftPromoteHalfRes_FP_ROUND currently
ignores the Trunc flag and unconditionally lowers ISD::FP_ROUND to
ISD::FP_TO_BF16 as follows:

- On X86 targets with +avx512bf16 or +avxneconvert, ISD::FP_TO_BF16
  lowers to vcvtneps2bf16, which is lossy (it flushes subnormals to
  zero and quietens sNaNs.)

- On targets without hardware bf16 conversion instructions, it performs
  rounding via a runtime libcall (e.g. __truncsfbf2) or a software
  rounding sequence (which can also be lossy, e.g. quieting sNaNs).

The above is unnecessary and lossy; bitcasting to i32 and extracting
the upper 16 bits is cheaper and lossless. Do that.

Tested:


    [13 lines not shown]
DeltaFile
+14,652-16,958llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+4,672-5,733llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.512bit.ll
+1,624-2,114llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.256bit.ll
+893-1,241llvm/test/CodeGen/X86/atomic-load-store.ll
+747-992llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.128bit.ll
+424-549llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.96bit.ll
+23,012-27,58731 files not shown
+26,423-32,77737 files

LLVM/project 2cc8bae — llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 bfloat.ll

[X86] Keep upper-16-bit f32 extractions in XMM for f16/v8i16

Teach combineBitcast and combineVectorInsert to keep this upper-16-bit
f32 extraction in XMM registers rather than bouncing through a GPR.

Depends on PR: https://github.com/llvm/llvm-project/pull/231112
Follow-up PR:  https://github.com/llvm/llvm-project/pull/230557
DeltaFile
+8-29llvm/test/CodeGen/X86/bfloat.ll
+32-0llvm/lib/Target/X86/X86ISelLowering.cpp
+40-292 files

LLVM/project 533bab2 — clang/lib/CIR/CodeGen CIRGenBuiltinAMDGPU.cpp, clang/test/CIR/CodeGenHIP builtins-amdgcn-raw-buffer-store-format.hip

[CIR][AMDGPU] Add support for AMDGCN raw buffer store format builtins (#223112)

Adds codegen for the following AMDGCN raw buffer store format builtins:

- __builtin_amdgcn_raw_buffer_store_format_v4f32 (v4f32)
- __builtin_amdgcn_raw_buffer_store_format_v4f16 (v4f16)

These are lowered to the corresponding
`llvm.amdgcn.raw.ptr.buffer.store.format` intrinsic.
DeltaFile
+89-0clang/test/CIR/CodeGenHIP/builtins-amdgcn-raw-buffer-store-format.hip
+12-0clang/lib/CIR/CodeGen/CIRGenBuiltinAMDGPU.cpp
+101-02 files

LLVM/project 71e68dd — clang/lib/CIR/CodeGen CIRGenBuiltinAMDGPU.cpp, clang/test/CIR/CodeGenHIP builtins-amdgcn-gfx13.hip builtins-amdgcn-raw-buffer-atomic-max.hip

[CIR][AMDGPU] Add support for raw ptr buffer atomic builtins (#223137)

Adds codegen for the following AMDGCN raw pointer buffer atomic
builtins:

- __builtin_amdgcn_raw_ptr_buffer_atomic_add_i32
- __builtin_amdgcn_raw_ptr_buffer_atomic_fadd_{f32,f64,v2f16}
- __builtin_amdgcn_raw_ptr_buffer_atomic_fmin_{f32,f64}
- __builtin_amdgcn_raw_ptr_buffer_atomic_fmax_{f32,f64}

These are lowered to the corresponding
`llvm.amdgcn.raw.ptr.buffer.atomic.*` intrinsics.

Co-Authored-By: Claude Opus 5

---------

Co-authored-by: Claude Opus 5 <noreply at anthropic.com>
DeltaFile
+93-0clang/test/CIR/CodeGenHIP/builtins-amdgcn-raw-buffer-atomic-add.hip
+73-0clang/test/CIR/CodeGenHIP/builtins-amdgcn-raw-buffer-atomic-max.hip
+16-24clang/lib/CIR/CodeGen/CIRGenBuiltinAMDGPU.cpp
+40-0clang/test/CIR/CodeGenHIP/builtins-amdgcn-gfx13.hip
+222-244 files

LLVM/project 4e8e856 — mlir/lib/Dialect/Tosa/IR TosaCanonicalizations.cpp, mlir/test/Dialect/Tosa canonicalize.mlir

[mlir][tosa] Fix no op clamp canonicalization when nan_mode = ignore (#229887)

When nan_mode = ignore, a no op clamp should not be folded. This is
because if a value of NaN is specified in the input, the output becomes
the minimum specified value. A regression test with clamp bounds of
infinity is provided.
DeltaFile
+19-0mlir/test/Dialect/Tosa/canonicalize.mlir
+3-0mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
+22-02 files

LLVM/project bbfb5f9 — llvm/test/CodeGen/X86 bfloat.ll

[X86] pre-commit tests for upper-16-bit f32 extractions (NFC)

Follow-up PR: https://github.com/llvm/llvm-project/pull/230698
DeltaFile
+92-0llvm/test/CodeGen/X86/bfloat.ll
+92-01 files

LLVM/project cf0b9d3 — libc/src/__support/OSUtil/linux exit.cpp, libc/src/__support/OSUtil/linux/syscall_wrappers CMakeLists.txt exit_group.h

[libc] Add linux syscall wrappers for exit and exit_group (#230528)

Add dedicated linux syscall wrappers for SYS_exit and SYS_exit_group,
and update existing call sites to call the appropriate one instead of
using raw syscall_impl:

- exit_group terminates all threads in the thread group (process), so it
is used by internal::exit, posix_spawn child error exits, and do_start
initialization failure paths.
- exit terminates only the calling thread, so it is used in thread_exit
and tls init error paths.

Assisted-by: Gemini
DeltaFile
+33-0libc/src/__support/OSUtil/linux/syscall_wrappers/exit_group.h
+33-0libc/src/__support/OSUtil/linux/syscall_wrappers/exit.h
+20-0libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt
+5-5libc/src/__support/threads/linux/thread.cpp
+2-6libc/src/spawn/linux/posix_spawn.cpp
+2-6libc/src/__support/OSUtil/linux/exit.cpp
+95-1711 files not shown
+112-2317 files

LLVM/project 909898e — llvm/lib/CodeGen/SelectionDAG SelectionDAG.cpp, llvm/test/CodeGen/AArch64 sign-bits-demanded-elts.ll

[SelectionDAG] Preserve demanded lanes in sign-bit queries (#230093)

Forward demanded lanes through multiplication and truncation.

Assisted by: GPT 6.1 Sol

---------

Co-authored-by: Matt Arsenault <arsenm2 at gmail.com>
DeltaFile
+223-0llvm/test/CodeGen/AArch64/sign-bits-demanded-elts.ll
+6-3llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+229-32 files

LLVM/project e974cfe — llvm/test/CodeGen/Mips r6-fp-condition-subregs.ll

[Mips] Update R6 FP condition checks after kill flag removal (#231107)

The instruction-selection checks added by #226838 still expect `killed`
operand flags. #229069 removed those flags from SelectionDAG emission
before #226838 landed, causing `r6-fp-condition-subregs.ll` to fail on
the CI after land.

Remove the five stale `killed` expectations.

Assisted-by: OpenAI Codex
DeltaFile
+5-5llvm/test/CodeGen/Mips/r6-fp-condition-subregs.ll
+5-51 files

LLVM/project 61b4fea — clang/test/CodeGenOpenCL spirv-enqueue-kernel-local-size.cl, llvm/lib/Target/SPIRV SPIRVBuiltins.cpp

[SPIR-V] Fix enqueue_kernel crash on clang -O0 local sizes (#230924)

Clang -O0 passes local sizes as a pointer to the first element, not to
the array
DeltaFile
+24-0clang/test/CodeGenOpenCL/spirv-enqueue-kernel-local-size.cl
+8-4llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
+9-0llvm/test/CodeGen/SPIRV/transcoding/enqueue_kernel.ll
+41-43 files

LLVM/project 565ee7c — llvm/test/CodeGen/AMDGPU load-global-i16.ll fcanonicalize.ll

Merge branch 'main' into users/lukel97/instcombine-lshr-trunc-sext-to-ashr-sext-test-target-agnostic
DeltaFile
+32,088-15,710llvm/test/CodeGen/AMDGPU/frem.ll
+5,274-5,643llvm/test/CodeGen/AMDGPU/load-global-i8.ll
+5,761-3,731llvm/test/CodeGen/AMDGPU/srem.ll
+6,118-2,908llvm/test/CodeGen/AMDGPU/clmul.ll
+1,505-5,320llvm/test/CodeGen/AMDGPU/fcanonicalize.ll
+3,366-3,401llvm/test/CodeGen/AMDGPU/load-global-i16.ll
+54,112-36,7133,095 files not shown
+265,022-130,6163,101 files

LLVM/project f7d913b — llvm/lib/IR Instructions.cpp, llvm/test/Verifier shufflevector-mask.ll

Fix overflow issues associated with shufflevector for landing PR #229662 (#230410)

Consider the motivating case here: https://godbolt.org/z/7rTsxT4sG

I will provide some context why shufflevector APIs need to be modified.

PR #229662 detects adjacent loads `%L1`/`%L2`, feeding as shuffle
operands, and converts 2 loads into single load(say `%L`). Shufflevector
also needs to be modified so that 0th operand is `%L` and 1st operand is
poison. `ShuffleVectorInst::isValidOperands` API checks if the index
mask for the new shuffle is in range of `concat(%L, poison)`. Computing
range of concat i.e. `2 * sizeof(%L)` creates signed overflow.

For the same case, while computing the new shuffle cost,
`isSingleSourceMaskImpl` API also computes `2 * sizeof(%L)` and
oveflows.

This patch fixes these issues.

Note that such overflow issues, asssociated with shufflevector, are
present elsewhere I am not planning to fix them here
DeltaFile
+8-10llvm/lib/IR/Instructions.cpp
+14-0llvm/test/Verifier/shufflevector-mask.ll
+22-102 files

LLVM/project eeb18b0 — llvm/include/llvm/Target CGPassBuilderOption.h, llvm/lib/Passes CodeGenPassBuilder.cpp

[CodeGen][AMDGPU][NPM] Wire up SSAMachineSchedulerPass in optimized regalloc pipeline
DeltaFile
+19-4llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+4-0llvm/lib/Passes/CodeGenPassBuilder.cpp
+3-0llvm/include/llvm/Target/CGPassBuilderOption.h
+2-0llvm/test/CodeGen/AMDGPU/mul.ll
+2-0llvm/test/CodeGen/AMDGPU/add.ll
+30-45 files

LLVM/project 5a5fe6c — llvm/include/llvm/IR RuntimeLibcalls.td

RuntimeLibcalls: Fix wrong types of some vector math functions (#231095)

The f32 x86 libmvec __expf_finite, __logf_finite and __powf_finite
variants were assigned to the f64 libcalls, and amd_vrd4_erf and
amd_vrd8_erf to the f32 ones.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+10-13llvm/include/llvm/IR/RuntimeLibcalls.td
+10-131 files

LLVM/project 83abec2 — libc/src/__support/OSUtil/linux/syscall_wrappers CMakeLists.txt sync.h, libc/src/unistd sync.h

[libc] Implement sync in unistd (#230908)

Implement the standard POSIX function `void sync(void);` in
`<unistd.h>`.

Fixes #230854
DeltaFile
+30-0libc/src/__support/OSUtil/linux/syscall_wrappers/sync.h
+25-0libc/src/unistd/sync.h
+24-0libc/src/unistd/linux/sync.cpp
+20-0libc/test/src/unistd/sync_test.cpp
+12-0libc/src/unistd/linux/CMakeLists.txt
+11-0libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt
+122-07 files not shown
+149-013 files