LLVM/project 5822426llvm/lib/Target/Hexagon HexagonEarlyIfConv.cpp, llvm/test/CodeGen/Hexagon early-if-phi-undef.mir

Hexagon: Fix early if-conversion crash on an undef PHI operand

Found by AI while working on something else.

Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
DeltaFile
+42-0llvm/test/CodeGen/Hexagon/early-if-phi-undef.mir
+3-3llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp
+45-32 files

LLVM/project 1f1ed16clang/lib/Basic TargetID.cpp, clang/lib/Basic/Targets AMDGPU.h AMDGPU.cpp

clang/AMDGPU: Use feature bitset for xnack/sramecc queries

Complete the conversion of clang from the manual ArchAttr field
to the generated feature bitset.

Co-authored-by: Claude (Claude-Opus-4.8)
DeltaFile
+4-3clang/lib/Driver/ToolChains/AMDGPU.cpp
+4-3clang/lib/Basic/TargetID.cpp
+3-2llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+2-1llvm/lib/Target/AMDGPU/AMDGPU.td
+1-1clang/lib/Basic/Targets/AMDGPU.h
+1-1clang/lib/Basic/Targets/AMDGPU.cpp
+15-116 files

LLVM/project 22c13f6utils/bazel MODULE.bazel.lock MODULE.bazel

[bazel] Update versions for mpfr and python (#217674)

Update mpfr and rules_python:
* mpfr: pick up
https://github.com/bazelbuild/bazel-central-registry/pull/9861 to fix
float128 support when using a local (external) build of mpfr (thx
@UebelAndre for merging)
* rules_python: update to resolve the warning `the root module requires
module version rules_python at 1.8.0, but got rules_python at 1.8.4 in the
resolved dependency graph`
DeltaFile
+2-2utils/bazel/MODULE.bazel.lock
+2-2utils/bazel/MODULE.bazel
+4-42 files

LLVM/project 7472f6dllvm/include/llvm/ADT FoldingSet.h

[ADT] Remove default argument from FoldingSetBase constructor (NFC) (#217523)

FoldingSetBase is never default-constructed directly; its subclasses and
helpers always pass Log2InitSize explicitly.

Assisted-by: Antigravity
DeltaFile
+1-1llvm/include/llvm/ADT/FoldingSet.h
+1-11 files

LLVM/project cdb50b4llvm/include/llvm/ADT FoldingSet.h, llvm/lib/Support FoldingSet.cpp

[ADT] Fix and clarify FoldingSet::reserve (#217522)

This patch fixes an off-by-one comparison in FoldingSetBase::reserve.
Without this patch, calling reserve(capacity()) allocates more buckets
even though the table can already hold capacity() nodes without
rebucketing. Changing '<' to '<=' correctly treats requests up to the
existing capacity as a no-op.

In addition, this patch clarifies the comments for reserve() by
replacing the awkward ordinal with a simple element count.

Assisted-by: Antigravity
DeltaFile
+9-2llvm/unittests/ADT/FoldingSet.cpp
+4-6llvm/include/llvm/ADT/FoldingSet.h
+1-1llvm/lib/Support/FoldingSet.cpp
+14-93 files

LLVM/project 58d7047llvm/include/llvm/IR IntrinsicsAMDGPU.td, llvm/test/CodeGen/AMDGPU llvm.amdgcn.wmma.target-features.ll

[NFC][AMDGPU] Use target features to guard WMMA intrinsics (#217681)
DeltaFile
+32-20llvm/include/llvm/IR/IntrinsicsAMDGPU.td
+39-0llvm/test/CodeGen/AMDGPU/llvm.amdgcn.wmma.target-features.ll
+71-202 files

LLVM/project dd582cdllvm/include/llvm/MC MCGOFFObjectWriter.h, llvm/lib/MC MCAsmBackend.cpp MCObjectFileInfo.cpp

[SystemZ][z/OS] Add split DWARF support for GOFF (#215337)

Adds split DWARF support to the GOFF object writer for z/OS.
When a .dwo file is requested, DWO sections go there and the rest stay
in the main object. Without one, everything stays in the single .o
as before.
DeltaFile
+132-0llvm/test/DebugInfo/GOFF/fission-cu.ll
+100-0llvm/test/DebugInfo/GOFF/fission-sections.ll
+70-12llvm/lib/MC/GOFFObjectWriter.cpp
+17-0llvm/lib/MC/MCObjectFileInfo.cpp
+9-0llvm/include/llvm/MC/MCGOFFObjectWriter.h
+4-1llvm/lib/MC/MCAsmBackend.cpp
+332-136 files

LLVM/project 6837886llvm/include/llvm/Support raw_ostream.h, llvm/lib/ObjCopy/ELF ELFObject.h ELFObject.cpp

[llvm-objcopy] Stream ELF output to regular files

Write ELF output directly to seekable regular files instead of first allocating a buffer for the entire output. Keep buffered output for stdout and other non-seekable streams, and materialize regenerated metadata one section at a time.

Track written ranges so unwritten gaps are zero-filled and the final file is resized exactly. Surface file stream failures as Error values so temporary outputs are discarded instead of producing destructor-time fatal errors.

On a synthetic stamping-style ELF containing a 1 GiB payload, three warm-cache no-op copies had median peak RSS of 2,102,916 KiB before and 1,053,844 KiB after (49.9% lower). Median wall time improved from 1.06 s to 0.77 s, and the outputs were byte-identical.

Co-authored-by: Jeremy Braun <jtbraun at meta.com>

Assisted-by: OpenAI Codex
DeltaFile
+215-81llvm/lib/ObjCopy/ELF/ELFObject.cpp
+66-0llvm/unittests/Support/raw_ostream_test.cpp
+62-0llvm/unittests/ObjCopy/ObjCopyTest.cpp
+38-13llvm/lib/ObjCopy/ELF/ELFObject.h
+47-3llvm/lib/Support/raw_ostream.cpp
+7-0llvm/include/llvm/Support/raw_ostream.h
+435-976 files

LLVM/project 636a3c6llvm/lib/Target/NVPTX NVPTXISelLowering.cpp, llvm/test/CodeGen/NVPTX atomicrmw-ignore-denormal-mode.ll

[NVPTX] Honor !atomic.ignore.denormal.mode on atomicrmw fadd

PTX atom.add has a fixed denormal behavior that the program cannot
control: atom.add.f32 flushes denormals on global memory but not on
shared, and atom.add.f16 never flushes. When that disagrees with the
function's denormal mode, the backend expands the atomic into a CAS loop
so the denormal behavior is preserved.

!atomic.ignore.denormal.mode says the denormal behavior of this
particular atomic does not matter, so use the native instruction even
when it disagrees. This is the same thing -nvptx-allow-ftz-atomics does,
except per-instruction instead of per-compilation, which lets a frontend
opt in only the operations it knows about -- notably CUDA's atomicAdd(),
which is defined in terms of atom.add.

Note that -nvptx-allow-ftz-atomics defaults to true, so the new behavior
is only observable with -nvptx-allow-ftz-atomics=false.

Co-authored-by: Artem Belevich <tra at google.com>
DeltaFile
+258-0llvm/test/CodeGen/NVPTX/atomicrmw-ignore-denormal-mode.ll
+11-3llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+269-32 files

LLVM/project d553b12mlir/include/mlir/Dialect/LLVMIR LLVMOpBase.td LLVMOps.td, mlir/lib/Dialect/LLVMIR/IR LLVMDialect.cpp

[mlir][LLVM] Add ignore_denormal_mode UnitAttr to LLVM::AtomicRMWOp
DeltaFile
+22-5mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+8-7mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
+8-0mlir/test/Dialect/LLVMIR/invalid.mlir
+7-0mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
+4-0mlir/test/Target/LLVMIR/Import/instructions.ll
+4-0mlir/test/Dialect/LLVMIR/roundtrip.mlir
+53-121 files not shown
+55-127 files

LLVM/project bafeed9clang/lib/CodeGen TargetInfo.cpp TargetInfo.h, clang/lib/CodeGen/TargetBuiltins NVPTX.cpp

[clang][NVPTX] Emit !atomic.ignore.denormal.mode for CUDA atomics

CUDA's atomicAdd() family is defined in terms of PTX atom.add, whose
denormal behavior is fixed by the hardware. Without any annotation the
backend has to assume the function's denormal mode must be honored and
expands these into CAS loops whenever the two disagree. Mark them with
!atomic.ignore.denormal.mode so the native instruction is used.

That covers the __nvvm_atom_*_add_gen_f builtins that atomicAdd(),
atomicAdd_block() and atomicAdd_system() are written in terms of, plus
C11/C++11 atomics under -fatomic-ignore-denormal-mode and the
[[clang::atomic(ignore_denormal_mode)]] attribute, which requires
teaching the NVPTX target about AtomicOptions.

The condition for when the metadata is meaningful is now shared with the
AMDGPU and SPIR-V targets in addAtomicIgnoreDenormalModeMetadata(). It
takes an AllowHalf flag because whether f16 denormals are observable is
target specific: PTX exposes no FTZ control for f16 operations, so
atom.add.f16 never flushes and the opt-in is meaningful there, whereas

    [3 lines not shown]
DeltaFile
+321-0clang/test/CodeGenCUDA/atomic-ignore-denormal-mode-nvptx.cu
+19-4clang/lib/CodeGen/TargetBuiltins/NVPTX.cpp
+18-0clang/lib/CodeGen/TargetInfo.h
+15-0clang/lib/CodeGen/TargetInfo.cpp
+12-0clang/lib/CodeGen/Targets/NVPTX.cpp
+2-4clang/lib/CodeGen/Targets/SPIR.cpp
+387-85 files not shown
+402-1711 files

LLVM/project 089a425llvm/test/Transforms/AtomicExpand/AMDGPU expand-atomic-v2f16-agent.ll expand-atomic-f64-system.ll

[IR] Generalize !amdgpu.ignore.denormal.mode into !atomic.ignore.denormal.mode

The !amdgpu.ignore.denormal.mode metadata tells the backend that an
atomicrmw fadd need not honor the function's denormal mode, so a native
atomic instruction whose denormal behavior is fixed in hardware may be
used instead of a CAS loop. Nothing about that is AMDGPU specific: NVPTX
has exactly the same problem with atom.add, whose FTZ behavior depends on
the address space and cannot be controlled.

Promote it to a target independent fixed metadata kind,
!atomic.ignore.denormal.mode, and switch the AMDGPU, SPIR-V and OpenMP
producers and consumers over to it. Document it in LangRef, and point
AMDGPUUsage at that description rather than duplicating it.

Existing IR keeps working: AutoUpgrade renames the metadata on atomicrmw
instructions when parsing textual IR and when materializing bitcode. The
upgrade is deliberately scoped to atomicrmw rather than being applied to
every attachment of that name, since that is the only place the metadata
was ever meaningful. Because bitcode can be materialized one function at

    [6 lines not shown]
DeltaFile
+84-84llvm/test/Transforms/AtomicExpand/AMDGPU/expand-atomic-f32-agent.ll
+78-78llvm/test/Transforms/AtomicExpand/AMDGPU/expand-atomic-f32-system.ll
+44-44llvm/test/Transforms/AtomicExpand/AMDGPU/expand-atomic-f64-agent.ll
+43-43llvm/test/Transforms/AtomicExpand/AMDGPU/expand-atomic-rmw-fadd.ll
+41-41llvm/test/Transforms/AtomicExpand/AMDGPU/expand-atomic-f64-system.ll
+34-34llvm/test/Transforms/AtomicExpand/AMDGPU/expand-atomic-v2f16-agent.ll
+324-32467 files not shown
+904-64873 files

LLVM/project 9280ff2utils/bazel/llvm-project-overlay/llvm config.bzl BUILD.bazel

[Bazel] Configure Windows targets by CPU and compiler (#217557)

## Summary

- add Windows AArch64 configuration settings for clang/MinGW, clang-cl,
and msvc-cl
- select AArch64 native initializer symbols and compiler-appropriate
host/default triples
- select the GNU triple for x86_64 MinGW while preserving the existing
generic Windows fallback

## Motivation

This came out while implementing full windows cross compilation from
Linux using Bazel and the hermetic-llvm project.

The Bazel overlay currently selects LLVM's native architecture and
triples using only the Windows OS constraint. As a result, every Windows
target receives X86 native initializer symbols and the `x86_64-pc-win32`

    [7 lines not shown]
DeltaFile
+27-0utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+4-0utils/bazel/llvm-project-overlay/llvm/config.bzl
+31-02 files

LLVM/project 4e9ded1mlir/include/mlir/Target/LLVMIR ModuleTranslation.h, mlir/lib/Target/LLVMIR ModuleTranslation.cpp

[MLIR][LLVM] Translate LLVMFuncOp function metadata (#203021)

Materialize LLVMFuncOp function_metadata through ModuleTranslation
metadata conversion. Attach function metadata after module-level symbols
are mapped so metadata references to functions, globals, aliases, and
ifuncs can be resolved.
DeltaFile
+104-0mlir/test/Target/LLVMIR/function-metadata.mlir
+39-5mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
+1-0mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
+144-53 files

LLVM/project af54e20flang/lib/Optimizer/Transforms FIRToSCF.cpp, flang/test/Fir/FirToSCF do-extra.fir normalize.fir

Revert "Revert "[flang][FIRToSCF] Recompute a typed induction variable in clo…"

This reverts commit 60faf067b9fdacf09c8de10c7a90a9c8ea7d4033.
DeltaFile
+85-19flang/test/Fir/FirToSCF/do-loop.fir
+19-18flang/lib/Optimizer/Transforms/FIRToSCF.cpp
+4-4flang/test/Fir/FirToSCF/normalize.fir
+3-3flang/test/Fir/FirToSCF/do-extra.fir
+111-444 files

LLVM/project 78f210eclang/lib/CodeGen CodeGenModule.cpp, clang/test/CodeGen ubsan-function.cpp ubsan-function-sugared.cpp

clang: Emit "target-abi" module flag for ARM (#217601)

Previously only RISCV emitted the "target-abi" module flag.
We probably should just generally emit this for non-empty ABI names
but that's a broader behavior change. I'm also confused because the
clang side defines a non-empty value for many targets with no apparent
use in llvm.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+19-0clang/test/CodeGen/arm-target-abi-module-flag.c
+11-3clang/lib/CodeGen/CodeGenModule.cpp
+1-1clang/test/CodeGen/ubsan-function.cpp
+1-1clang/test/CodeGen/ubsan-function-sugared.cpp
+32-54 files

LLVM/project 9d60067llvm/lib/ObjCopy/ELF ELFObject.h ELFObject.cpp

[llvm-objcopy] Propagate section write errors

Return Error from SectionWriter::writeSectionContents and propagate failures through all visitor call sites. This lets a later streaming writer report seek and write failures without fatal destructor-time handling.

Co-authored-by: Jeremy Braun <jtbraun at meta.com>

Assisted-by: OpenAI Codex
DeltaFile
+15-20llvm/lib/ObjCopy/ELF/ELFObject.cpp
+1-1llvm/lib/ObjCopy/ELF/ELFObject.h
+16-212 files

LLVM/project 454e6e1llvm/lib/ObjCopy/ELF ELFObject.h ELFObject.cpp, llvm/test/tools/llvm-objcopy/ELF many-sections.test

[llvm-objcopy] Route section copies through writeSectionContents

Centralize section byte copies behind a virtual helper so ELF output can later target either a memory buffer or a seekable stream. Materialize SHT_SYMTAB_SHNDX entries using the target ELF word type to preserve output endianness.

Co-authored-by: Jeremy Braun <jtbraun at meta.com>

Assisted-by: OpenAI Codex
DeltaFile
+26-15llvm/lib/ObjCopy/ELF/ELFObject.cpp
+2-0llvm/test/tools/llvm-objcopy/ELF/many-sections.test
+1-0llvm/lib/ObjCopy/ELF/ELFObject.h
+29-153 files

LLVM/project 00f7178libc/src/__support/FPUtil float80.h, libc/test/src/__support/FPUtil float80_test.cpp

suggestions and add more operators
DeltaFile
+40-16libc/src/__support/FPUtil/float80.h
+34-5libc/test/src/__support/FPUtil/float80_test.cpp
+74-212 files

LLVM/project 5d608eblibc/src/__support/FPUtil float80.h, libc/test/src/__support/FPUtil float80_test.cpp

add tests
DeltaFile
+21-0libc/src/__support/FPUtil/float80.h
+13-0libc/test/src/__support/FPUtil/float80_test.cpp
+34-02 files

LLVM/project 8c0a5aelibc/src/__support/FPUtil float80.h, libc/test/src/__support/FPUtil float80_test.cpp

feat: add negation and a test for it
DeltaFile
+7-0libc/src/__support/FPUtil/float80.h
+2-0libc/test/src/__support/FPUtil/float80_test.cpp
+9-02 files

LLVM/project f5291c7libc/src/__support/FPUtil dyadic_float.h

test: limit EXTRA_FRAC_LEN to be non-negative

test

test

nit

revert

revert

only add >0 condition

format
DeltaFile
+6-8libc/src/__support/FPUtil/dyadic_float.h
+6-81 files

LLVM/project 7d144c1libc/src/__support/FPUtil dyadic_float.h

nit
DeltaFile
+2-1libc/src/__support/FPUtil/dyadic_float.h
+2-11 files

LLVM/project 8ddcc2alibc/src/__support/FPUtil dyadic_float.h

nit
DeltaFile
+1-0libc/src/__support/FPUtil/dyadic_float.h
+1-01 files

LLVM/project de753bblibc/src/__support/FPUtil dyadic_float.h

add explicit bit handling for dyadic_float as per FPBits
DeltaFile
+2-0libc/src/__support/FPUtil/dyadic_float.h
+2-01 files

LLVM/project 850b3f4libc/src/__support/FPUtil float80.h, libc/test/src/__support/FPUtil float80_test.cpp

feat: add tests
DeltaFile
+16-69libc/src/__support/FPUtil/float80.h
+59-0libc/test/src/__support/FPUtil/float80_test.cpp
+75-692 files

LLVM/project 2a8946alibc/src/__support/FPUtil cast.h

add fputiL::cast support
DeltaFile
+3-1libc/src/__support/FPUtil/cast.h
+3-11 files

LLVM/project 168dd15libc/src/__support/FPUtil FPBits.h

formatting
DeltaFile
+5-5libc/src/__support/FPUtil/FPBits.h
+5-51 files

LLVM/project 8145315libc/src/__support/FPUtil FPBits.h

nit
DeltaFile
+5-5libc/src/__support/FPUtil/FPBits.h
+5-51 files

LLVM/project ae7f912libc/src/__support/FPUtil dyadic_float.h FPBits.h

test
DeltaFile
+4-4libc/src/__support/FPUtil/FPBits.h
+2-1libc/src/__support/FPUtil/dyadic_float.h
+6-52 files