LLVM/project fe52428clang/lib/CIR/Dialect/IR CIRAttrs.cpp, clang/test/CIR/CodeGen int128-global-const.cpp

[CIR] Round-trip wide cir.int attributes (#206602)

printIntLiteral printed a cir.int value with APInt::getSExtValue() /
getZExtValue(), both of which assert once the value needs more than 64
bits, and parseIntLiteral parsed into int64_t/uint64_t. So a cir.int
attribute holding a value wider than 64 bits -- for example an __int128
constant like (__int128)1 << 70 -- aborted whenever the module was
printed (-emit-cir, cir-opt, round-trip verification) and could not be
parsed back. The trigger is the value magnitude, not the declared type
width: a 128-bit-typed attribute holding a small value printed fine,
which is why the existing 128-bit cir.int tests never caught it.

The fix prints through APInt::toString and parses through
AsmParser::parseOptionalInteger into an APInt fitted to the type width
(mirroring how the builtin IntegerAttr handles arbitrary widths), so a
cir.int of any width round-trips. The old int64_t/uint64_t parse path is
removed.

global.cir gains signed and unsigned 128-bit globals with values that

    [2 lines not shown]
DeltaFile
+18-33clang/lib/CIR/Dialect/IR/CIRAttrs.cpp
+35-0clang/test/CIR/IR/invalid-int-attr.cir
+15-0clang/test/CIR/CodeGen/int128-global-const.cpp
+8-0clang/test/CIR/IR/global.cir
+76-334 files

LLVM/project 2abfdb5utils/bazel/llvm-project-overlay/libc BUILD.bazel

[Bazel] Port 58203500b5bd1628401c1a103eb264b7d78ea3bb (#207018)
DeltaFile
+0-2utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+0-21 files

LLVM/project ead99b0clang/lib/CIR/Dialect/Transforms FlattenCFG.cpp, clang/test/CIR/CodeGen switch-range.c

[CIR] Fix unsigned/wide switch case-range lowering (#206575)

A `switch` over an unsigned (or wider-than-32-bit) integer with a GNU
`case lo ... hi` range was miscompiled. SingleSource `pr34154.c` is the
witness: it switches on an `unsigned long long` with
`case 1000000000000000000ULL ... 9999999999999999999ULL`, and under `-fclangir`
every value took the default.

The flattening pass decided whether a range was empty with a signed compare,
`lowerBound.sgt(upperBound)` in `CIRSwitchOpFlattening`. The upper bound
`9999999999999999999` is larger than `INT64_MAX`, so as a signed value it is
negative and the range looked empty -- it was dropped and the case body left
unreachable, so control always reached the default. Behind that sat three more
width/signedness slips: the small-range size gate compared a 64-bit difference
against a 32-bit `APInt`, the expansion loop advanced a signed `APInt` cursor
that looped forever for a range ending at the type's maximum (the cursor wraps
past the top of the domain), and `condBrToRangeDestination` built the
lower-bound and range-length constants and the subtraction at a hardcoded
32-bit width, which truncates a 64-bit range.

    [7 lines not shown]
DeltaFile
+126-0clang/test/CIR/CodeGen/switch-range.c
+42-20clang/lib/CIR/Dialect/Transforms/FlattenCFG.cpp
+53-0clang/test/CIR/Transforms/switch.cir
+221-203 files

LLVM/project 6bdb63fclang/lib/Basic Warnings.cpp

[Clang] Try to fix data race on HasColors after #202441 (#206975)

Summary:
The clangd users call these functions in multi-thraeded contexts. The
raw_fd_stream has_colors query is cached, which was giving some data
races. Just use the process-level check for now.
DeltaFile
+5-1clang/lib/Basic/Warnings.cpp
+5-11 files

LLVM/project 8ba6f7bllvm/include/llvm/DebugInfo/LogicalView/Readers LVIRReader.h, utils/bazel/llvm-project-overlay/llvm BUILD.bazel

[Bazel] Port e7290b1f1815626c4461d38671d93093590bf405 (#207014)

We also need to add a header or otherwise we end up with incomplete
types for template instanation in modules builds which are used for
header parsing.
DeltaFile
+4-0utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+1-0llvm/include/llvm/DebugInfo/LogicalView/Readers/LVIRReader.h
+5-02 files

LLVM/project 1548349clang/lib/Driver/ToolChains Flang.cpp, flang/lib/Frontend CompilerInvocation.cpp

[Flang][OpenMP][MLIR] Improve SPMD-No-Loop handling (#206953)

This patch modifies the handling of the
`-fopenmp-assume-teams-oversubscription` and
`-fopenmp-assume-threads-oversubscription` compiler options in Flang and
the corresponding `omp.flags` MLIR attribute to have this information
present on both host and target device MLIR modules. This is necessary
to ensure SPMD to SPMD-No-Loop kernel promotion happens uniformly and no
divergence between host and device representations of the same target
region is introduced.

The identification of the kernel type in Flang lowering is updated to
address some broken edge cases. In particular, no SPMD to SPMD-No-Loop
transformation is performed on `target parallel do [simd]` kernels. A
split `target + parallel loop` is now marked SPMD, which was a case
missed previously, and the trip count on `target teams ompx_bare`
kernels isn't host evaluated even if removing the `ompx_bare` clause
would result in a valid SPMD kernel.
DeltaFile
+336-0flang/test/Lower/OpenMP/target-kernel-types.f90
+47-25flang/lib/Lower/OpenMP/OpenMP.cpp
+13-11clang/lib/Driver/ToolChains/Flang.cpp
+22-1mlir/test/Dialect/OpenMP/invalid.mlir
+10-12flang/lib/Frontend/CompilerInvocation.cpp
+13-6mlir/test/Dialect/OpenMP/ops.mlir
+441-556 files not shown
+482-8512 files

LLVM/project dd8f611libcxx/utils/libcxx/test/features misc.py

[libcxx] Enable std module test on FreeBSD (#206269)

We updated the CI to 15.1, and it should work now.
DeltaFile
+0-1libcxx/utils/libcxx/test/features/misc.py
+0-11 files

LLVM/project d15004alldb/test/API/commands/register/register_command TestRegisters.py

[lldb][Windows] allow test_convenience_registers to PASS (#206956)

`RegisterCommandsTestCase.test_convenience_registers` passes when using
`LLDB_USE_LLDB_SERVER=1` since
https://github.com/llvm/llvm-project/pull/203498 was merged.

rdar://180307995
DeltaFile
+1-1lldb/test/API/commands/register/register_command/TestRegisters.py
+1-11 files

LLVM/project d8f0e08llvm/test/CodeGen/AArch64 machine-cp-spill-chain-across-call.mir

[MCP] Add test case to demonstrate issue with spill copy elimination (NFC) (#206855)

Show the bug not preserving a caller-save register across a call.
DeltaFile
+53-0llvm/test/CodeGen/AArch64/machine-cp-spill-chain-across-call.mir
+53-01 files

LLVM/project 276bcc7llvm/include/llvm/IR Intrinsics.td, llvm/lib/IR Verifier.cpp IRBuilder.cpp

[LLVM] Fix signature for `gc.get.pointer.base` intrinsic (#206991)

`experimental.gc.get.pointer.base` intrinsic requires that the return
and argument type are the same pointer types. Currently this is checked
explicitly in Verifier.cpp. Instead, change the type signature of
`.gc.get.pointer.base` to use `LLVMMatchType` to enforce this
restriction.
DeltaFile
+0-7llvm/lib/IR/Verifier.cpp
+2-2llvm/test/Verifier/intrinsic-bad-arg-type1.ll
+2-2llvm/test/Transforms/RewriteStatepointsForGC/intrinsics-bare.ll
+1-2llvm/lib/IR/IRBuilder.cpp
+3-0llvm/test/Assembler/auto_upgrade_intrinsics.ll
+1-1llvm/include/llvm/IR/Intrinsics.td
+9-146 files

LLVM/project adc037cllvm/lib/Target/SPIRV SPIRVUtils.cpp SPIRVPreLegalizer.cpp

[SPIR-V] Use MathExtras helpers for bit arithmetic (NFC) (#206968)
DeltaFile
+4-5llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+2-1llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp
+2-1llvm/lib/Target/SPIRV/SPIRVAuxDataHandler.cpp
+8-73 files

LLVM/project c248ca1llvm/lib/Target/SPIRV SPIRVStructurizer.cpp SPIRVCallLowering.cpp

[SPIR-V] Use llvm STLExtras range algorithms (NFC) (#206969)
DeltaFile
+9-8llvm/lib/Target/SPIRV/SPIRVStructurizer.cpp
+4-7llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
+2-7llvm/lib/Target/SPIRV/SPIRVSubtarget.cpp
+4-4llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp
+4-4llvm/lib/Target/SPIRV/SPIRVLegalizeImplicitBinding.cpp
+2-1llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+25-316 files

LLVM/project f147853llvm/lib/Target/AArch64 AArch64Arm64ECCallLowering.cpp, llvm/test/CodeGen/AArch64 arm64ec-entry-thunks.ll arm64ec-exit-thunks.ll

Change mangling and add extra tests
DeltaFile
+113-3llvm/test/CodeGen/AArch64/arm64ec-entry-thunks.ll
+5-5llvm/test/CodeGen/AArch64/arm64ec-exit-thunks.ll
+4-2llvm/lib/Target/AArch64/AArch64Arm64ECCallLowering.cpp
+122-103 files

LLVM/project a675a66flang-rt/include/flang-rt/runtime allocator-registry.h, flang-rt/lib/cuda allocator.cpp

[Flang-RT] Change alignment for allocatable and pointer arrays to 64 … (#206525)

…bytes

in https://github.com/llvm/llvm-project/pull/194969 the default array
alignment was changed to 64bytes for Fortran globals. In this PR the
malloc wrapper in the flang runtime is modified to accept an alignment
argument (0 default) and for cases above 16 byte (std::max_align_t) uses
`aligned_alloc` instead of malloc.

The issue of alignment was discussed in this RFC:
https://discourse.llvm.org/t/rfc-alignment-of-global-arrays/90397/13

Assisted-by: Opus 4.6
DeltaFile
+29-0flang-rt/unittests/Runtime/Pointer.cpp
+25-0flang-rt/unittests/Runtime/Allocatable.cpp
+12-8flang-rt/lib/cuda/allocator.cpp
+16-3flang-rt/include/flang-rt/runtime/allocator-registry.h
+4-4flang/include/flang/Runtime/CUDA/allocator.h
+5-3flang-rt/lib/runtime/pointer.cpp
+91-186 files not shown
+105-2212 files

LLVM/project 3848a2fllvm/lib/Transforms/InstCombine InstCombineCalls.cpp, llvm/test/Transforms/InstCombine assume.ll

[InstCombine] Don't try to fold alignment assumptions containing adds (#207001)

The fold seems to not actually be that useful in real code.
DeltaFile
+6-14llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+5-2llvm/test/Transforms/InstCombine/assume.ll
+11-162 files

LLVM/project 8fc5ad0clang-tools-extra/clang-tidy/modernize UseOverrideCheck.cpp UseOverrideCheck.h, clang-tools-extra/docs ReleaseNotes.rst

[clang-tidy] Add AllowVirtualAndOverride to modernize-use-override (#206111)

Add an `AllowVirtualAndOverride` option to `modernize-use-override` so
codebases can keep virtual on methods that are also marked override.

AI Usage: Test cases assisted by Codex.
Closes https://github.com/llvm/llvm-project/issues/202030
DeltaFile
+42-0clang-tools-extra/test/clang-tidy/checkers/modernize/use-override-allow-virtual-and-override.cpp
+10-2clang-tools-extra/clang-tidy/modernize/UseOverrideCheck.cpp
+5-0clang-tools-extra/docs/ReleaseNotes.rst
+5-0clang-tools-extra/docs/clang-tidy/checks/modernize/use-override.rst
+1-0clang-tools-extra/clang-tidy/modernize/UseOverrideCheck.h
+63-25 files

LLVM/project ad021b6.ci/green-dragon lldb-windows.groovy

[lldb][Windows][CI] refine timeouts (#206942)

Add/refine timeouts on each step of the lldb on Windows CI script. This
should help avoid runaway builds which timeout after 24h.
DeltaFile
+17-9.ci/green-dragon/lldb-windows.groovy
+17-91 files

LLVM/project 41f1d13clang/lib/CIR/Dialect/Transforms HoistAllocas.cpp, clang/test/CIR/CodeGenOpenMP omp-llvmir.c

[CIR][OpenMP] Prevent HoistAllocas pass from hoisting above OpenMP regions (#206168)

This patch modifies the HoistAllocas pass to prevent it from hoisting
allocas outside OpenMP regions, since this may break isolated from above
requirements and affect privatization semantics.

Assisted-by: Cursor / claude-4.8-opus-medium
DeltaFile
+85-0clang/test/CIR/Transforms/hoist-allocas.cir
+15-19clang/test/CIR/CodeGenOpenMP/omp-llvmir.c
+26-4clang/lib/CIR/Dialect/Transforms/HoistAllocas.cpp
+126-233 files

LLVM/project eff826emlir/lib/Dialect/Vector/Transforms LowerVectorBroadcast.cpp, mlir/test/Conversion/VectorToLLVM vector-to-llvm.mlir

[MLIR][Vector] Generalize broadcast lowering for single-element vector to nD (#206501)
DeltaFile
+36-0mlir/test/Dialect/Vector/vector-broadcast-lowering-transforms.mlir
+11-12mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
+2-3mlir/lib/Dialect/Vector/Transforms/LowerVectorBroadcast.cpp
+49-153 files

LLVM/project 0c2d34dflang/lib/Optimizer/Transforms CMakeLists.txt, mlir/include/mlir/Dialect/LLVMIR/Transforms InlinerInterfaceImpl.h

Reland "[mlir][nvvm] extract NVVM inliner interface from LLVM dialect" with flang fixes (#206782)
DeltaFile
+11-0mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
+0-7mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp
+0-6mlir/include/mlir/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.h
+1-1utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+1-0flang/lib/Optimizer/Transforms/CMakeLists.txt
+0-1mlir/lib/Dialect/LLVMIR/Transforms/CMakeLists.txt
+13-151 files not shown
+13-167 files

LLVM/project ac9a204lldb/source/Plugins/SymbolFile/DWARF SymbolFileWasm.cpp SymbolFileWasm.h, lldb/test/API/functionalities/breakpoint/cpp TestCPPBreakpointLocations.py

[lldb] Recover mangled symbol names from DWARF on WebAssembly (#206832)

The Wasm "name" section stores only demangled names, so the symbols
ObjectFileWasm builds from it have no mangled name. Without one, the
symbol table indexes neither the mangled name nor the C++ base and
method name variants derived from it, so looking up a symbol by mangled
name fails and breakpoints set by a template or operator name find no
locations.

Override SymbolFileWasm::AddSymbols to copy each function's mangled name
from its DWARF DW_AT_linkage_name onto the matching symbol, matched by
file address. This is confined to the Wasm symbol file, so other targets
are unaffected.
DeltaFile
+40-0lldb/source/Plugins/SymbolFile/DWARF/SymbolFileWasm.cpp
+5-0lldb/source/Plugins/SymbolFile/DWARF/SymbolFileWasm.h
+3-0lldb/test/API/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
+48-03 files

LLVM/project 0c69421lldb/packages/Python/lldbsuite/test/tools/lldb_dap dap_types.py session_helpers.py, lldb/test/API/tools/lldb-dap/utils TestDAPUtils_Types.py

[lldb-dap] Add a new lldb-dap test infrastructure (#203978)

Introduce a new test infrastructure under lldbsuite/test/tools/lldb_dap
that replaces the dict-based dap_server. Initially the new and legacy
version will live side by side.
Once all tests are ported, the legacy version will be removed. The new
infrastructure has four files:
- dap_types.py: DAP protocol messages as frozen dataclasses, plus
serializer/deserializer functions to and from JSON.
- utils.py: Helper classes for launching and managing lldb-dap process
and its connection.
- session.py: DAP session layer. Owns the per-session state.
- session_helpers.py: Higher-level helpers for writing tests.

Using dataclasses for protocol types lets us catch unexpected or missing
fields at deserialization time instead of at use-site.

Adds a new environment flag, LLDBDAP_RUN_AS_SERVER, that runs the test
suite against lldb-dap in server mode for test cases with

    [10 lines not shown]
DeltaFile
+2,026-0lldb/packages/Python/lldbsuite/test/tools/lldb_dap/dap_types.py
+1,698-0lldb/packages/Python/lldbsuite/test/tools/lldb_dap/session_helpers.py
+847-0lldb/packages/Python/lldbsuite/test/tools/lldb_dap/utils.py
+492-0lldb/packages/Python/lldbsuite/test/tools/lldb_dap/session.py
+452-0lldb/test/API/tools/lldb-dap/utils/TestDAPUtils_Types.py
+209-0lldb/packages/Python/lldbsuite/test/tools/lldb_dap/lldb_dap_testcase.py
+5,724-02 files not shown
+5,738-78 files

LLVM/project fc5798ellvm/lib/Analysis ScalarEvolution.cpp, llvm/test/Analysis/ScalarEvolution add-like-or.ll

[SCEV] Cancel common addend/multiplier in SimplifyICmpOperands (#205014)

Simplify:
```
  (K + A) pred (K + B)  ->  A pred B
  (C * A) pred (C * B)  ->  A pred B
```

when no-wrap flags allow it: NSW for signed predicates, NUW for
unsigned. Also requires C > 0 for signed in the multiplication case.

For equality comparisons, `(K + A) eq/ne (K + B)` simplifies to `A eq/ne
B` without requiring any no-wrap flags.

Alive2 proofs: https://alive2.llvm.org/ce/z/KmyqsD
DeltaFile
+121-0llvm/unittests/Analysis/ScalarEvolutionTest.cpp
+46-0llvm/lib/Analysis/ScalarEvolution.cpp
+30-3llvm/test/Transforms/LoopUnroll/X86/high-cost-expansion.ll
+4-4llvm/test/Analysis/ScalarEvolution/add-like-or.ll
+201-74 files

LLVM/project 5f282celibcxx/include wchar.h

[libc++] Assume that <wchar.h> in llvm-libc has const-overloads. (#206805)

See discussion in https://github.com/llvm/llvm-project/pull/201236 -
we're close to enabling wide characters in libc++ when it's built on top
of llvm-libc.

llvm-libc headers use `const wchar_t*` return type for selected wchar
functions, so we need to configure libc++ to assume that const-overloads
for these functions are available in this case, and the implementations
in libc++ wrapper around `<wchar.h>` are not needed.
DeltaFile
+2-0libcxx/include/wchar.h
+2-01 files

LLVM/project 3b0c457libc/shared builtins.h, libc/shared/builtins divdf3.h

[libc] add shared divdf3 builtin (#205675)

Re-exposes LLVM-libc's `__divdf3` as `shared::divdf3` for reuse by
compiler-rt's builtins.

Stacked change - merge these first:
- #200094
- #205669
- #205670
- #205671
- #205672
- #205673
- #205674

Part of #197824
DeltaFile
+32-0libc/src/__support/builtins/divdf3.h
+29-0libc/shared/builtins/divdf3.h
+9-0libc/src/__support/builtins/CMakeLists.txt
+1-0libc/test/shared/CMakeLists.txt
+1-0libc/shared/builtins.h
+1-0libc/test/shared/shared_builtins_test.cpp
+73-06 files

LLVM/project 8a3b715llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 combine-fcmp-uno-self.ll bitcast-vector-bool.ll

[X86] Fold FP UNORD/ORD compare against known-non-NaN to self-compare (#206943)

Replace a known-non-NaN operand of an UNORD/ORD FP compare with the
other operand, so we emit `cmpp a, a` instead of materializing the
constant with `vxorpd`. Matches GCC.

Added combine-fcmp-uno-self.ll which covers the folding and a negative
case.

Fixes #202756
DeltaFile
+83-0llvm/test/CodeGen/X86/combine-fcmp-uno-self.ll
+11-15llvm/test/CodeGen/X86/bitcast-vector-bool.ll
+6-0llvm/lib/Target/X86/X86ISelLowering.cpp
+100-153 files

LLVM/project 4ddf664mlir/lib/ABI ABITypeMapper.cpp, mlir/unittests/ABI ABITypeMapperTest.cpp

[mlir][ABI] Fix scalable vector mapping in ABITypeMapper (#206617)

mapVectorType in ABITypeMapper incorrectly used ElementCount::getFixed
for all vector types, including scalable ones (e.g. vector<[4]xf32>).
This results in scalable vectors being mapped as fixed-size vectors,
which produces incorrect ABI lowering for SVE and RISC-V V targets.
DeltaFile
+30-0mlir/unittests/ABI/ABITypeMapperTest.cpp
+8-1mlir/lib/ABI/ABITypeMapper.cpp
+38-12 files

LLVM/project bb6868alibcxx/include/__memory temporary_buffer.h, libcxx/test/std/utilities/memory/temporary.buffer temporary_buffer.pass.cpp overaligned.pass.cpp

[libc++] Fix behavior for `get_temporary_buffer` with non-positive size (#206871)

Per C++17 [depr.temporary.buffer]/4, `get_temporary_buffer` is required
to return `{nullptr, 0}` when the size argument is zero or negative.
libc++ used to correctly handle this, but the refactoring in
94e7c0b051c79fd56205f115771980f2e7812306 got this wrong.

GCC generally warns on negative size due to `-Walloc-size-larger-than=`,
which is false positive due to incomplete control flow analysis. The
warning is coupled with optimizations, and this patch make tests
suppress it instead.
DeltaFile
+30-0libcxx/test/std/utilities/memory/temporary.buffer/temporary_buffer.pass.cpp
+21-0libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp
+3-0libcxx/include/__memory/temporary_buffer.h
+54-03 files

LLVM/project 525f5a1clang/lib/Driver/ToolChains Clang.cpp, clang/test/Driver hip-toolchain-no-rdc.hip

Revert "[HIP][AMDGPU] Use non-LTO pipeline for non-RDC in the linker wrapper (#201135)" (#206961)

I believe I fixed the immediate issues that were causing regressions
with this, and now this is leading to its own regressions in building
Pytorch apparently. This was explicitly marked as a hack, and this
should resolve an ongoing issue so we should revert this for now.

Should fix LCOMPILER-2396

This reverts commit eaff67c9838f98d221aa563c9e5d4e714d636674.
DeltaFile
+0-23clang/test/OffloadTools/clang-linker-wrapper/linker-wrapper-hip-no-rdc-amdgcnspirv.c
+0-17clang/test/Driver/hip-toolchain-no-rdc.hip
+0-13clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+0-13clang/lib/Driver/ToolChains/Clang.cpp
+0-12clang/test/OffloadTools/clang-linker-wrapper/linker-wrapper-hip-no-rdc.c
+0-3clang/tools/clang-linker-wrapper/LinkerWrapperOpts.td
+0-816 files

LLVM/project b54d6aflibc/config/darwin/aarch64 entrypoints.txt, libc/config/darwin/x86_64 entrypoints.txt

Protect overlap check against overflow and add some missing entrypoints
DeltaFile
+4-3libc/src/string/strcpy_s.cpp
+1-0libc/config/darwin/aarch64/entrypoints.txt
+1-0libc/config/darwin/x86_64/entrypoints.txt
+6-33 files