LLVM/project 298ee5bllvm/lib/Target/AMDGPU AMDGPURewriteAGPRCopyMFMA.cpp, llvm/test/CodeGen/AMDGPU rewrite-vgpr-mfma-to-agpr-spill-joint-dom.ll rewrite-vgpr-mfma-to-agpr-spill-joint-dom-mir.mir

[1/2][AMDGPU] Fixed crash due to virtual register defs not dominating uses (#198472)

Fixes https://github.com/llvm/llvm-project/issues/196671.

Fixes duplicate ROCM-24494, LCOMPILER-2224.

In Rewrite AGPR-Copy-MFMA pass, a spill reload may not have a dominating
spill store. If such a slot is unspilled into a vreg, the elimination
phase crashes because virtual register defs do not dominate all uses.
This patch checks for that dominance property for all reloads and skips
unspilling if such a condition is found.

This patch is adapted from 
https://github.com/llvm/llvm-project/pull/167347

Cherry-picked https://github.com/ROCm/llvm-project/commit/e5d02ddb
Authored by: Austin Kerbow <Austin.Kerbow at amd.com>

Instead of scanning through instructions within the reload basic block,

    [17 lines not shown]
DeltaFile
+1,770-0llvm/test/CodeGen/AMDGPU/rewrite-vgpr-mfma-to-agpr-spill-joint-dom-mir.mir
+159-0llvm/test/CodeGen/AMDGPU/rewrite-vgpr-mfma-to-agpr-spill-joint-dom.ll
+84-4llvm/lib/Target/AMDGPU/AMDGPURewriteAGPRCopyMFMA.cpp
+2,013-43 files

LLVM/project 5519448clang/lib/Sema SemaTemplateInstantiateDecl.cpp, clang/test/CXX/temp/temp.decls/temp.friend p6.cpp

[Clang] Prevent an assertion failure when instantiating an invalid friend function template (#216727)к

Fixes #216694

---

This patch addresses an assertion failure that occurs when instantiating
an invalid friend function template by marking its `FriendDecl` wrapper
as invalid.
DeltaFile
+9-0clang/test/CXX/temp/temp.decls/temp.friend/p6.cpp
+2-1clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+11-12 files

LLVM/project 9927fcfclang/lib/Sema SemaLifetimeSafety.h, clang/test/Sema/LifetimeSafety annotation-suggestions.cpp

macro-suggest
DeltaFile
+15-0clang/test/Sema/LifetimeSafety/annotation-suggestions.cpp
+10-2clang/lib/Sema/SemaLifetimeSafety.h
+25-22 files

FreeBSD/ports 6b50d70lang/gcc15/files patch-libgomp_affinity-fmt.c patch-include_libiberty.h

lang/gcc15: fix build after base d08296c7ab0d

After base d08296c7ab0d7bb259bf7b8cdf9ffb819c1929ab ("libc: Implement
qualifier-preserving standard library functions"), lang/gcc15 fails to
build with errors like:

  /wrkdirs/usr/ports/lang/gcc15/work/gcc-15.2.0/libgomp/affinity-fmt.c: In function 'gomp_display_affinity':
  /wrkdirs/usr/ports/lang/gcc15/work/gcc-15.2.0/libgomp/affinity-fmt.c:330:25: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
    330 |               char *q = strchr (p + 1, '}');
        |                         ^~~~~~

and:

  In file included from /wrkdirs/usr/ports/lang/gcc15/work/.build/gcc/include-fixed/stdio.h:52,
                   from cp-demangle.c:109:
  /wrkdirs/usr/ports/lang/gcc15/work/gcc-15.2.0/libstdc++-v3/../include/libiberty.h:225:14: error: expected identifier or '(' before '_Generic'
    225 | extern void *memrchr(const void *, int, size_t);
        |              ^~~~~~~


    [25 lines not shown]
DeltaFile
+11-0lang/gcc15/files/patch-libgomp_affinity-fmt.c
+11-0lang/gcc15/files/patch-include_libiberty.h
+22-02 files

FreeBSD/ports 955eda5lang/gcc15/files patch-libgomp_affinity-fmt.c patch-include_libiberty.h

lang/gcc15: fix build after base d08296c7ab0d

After base d08296c7ab0d7bb259bf7b8cdf9ffb819c1929ab ("libc: Implement
qualifier-preserving standard library functions"), lang/gcc15 fails to
build with errors like:

  /wrkdirs/usr/ports/lang/gcc15/work/gcc-15.2.0/libgomp/affinity-fmt.c: In function 'gomp_display_affinity':
  /wrkdirs/usr/ports/lang/gcc15/work/gcc-15.2.0/libgomp/affinity-fmt.c:330:25: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
    330 |               char *q = strchr (p + 1, '}');
        |                         ^~~~~~

and:

  In file included from /wrkdirs/usr/ports/lang/gcc15/work/.build/gcc/include-fixed/stdio.h:52,
                   from cp-demangle.c:109:
  /wrkdirs/usr/ports/lang/gcc15/work/gcc-15.2.0/libstdc++-v3/../include/libiberty.h:225:14: error: expected identifier or '(' before '_Generic'
    225 | extern void *memrchr(const void *, int, size_t);
        |              ^~~~~~~


    [23 lines not shown]
DeltaFile
+11-0lang/gcc15/files/patch-libgomp_affinity-fmt.c
+11-0lang/gcc15/files/patch-include_libiberty.h
+22-02 files

LLVM/project b489177llvm/lib/Target/AMDGPU SIFrameLowering.cpp

[AMDGPU] Don't use MCRegister to hold Dwarf register numbers. NFC (#216766)
DeltaFile
+3-3llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
+3-31 files

FreeBSD/src a77edebsys/geom/eli g_eli.c, sys/kern subr_hints.c kern_environment.c

SYSINIT: add SI_SUB_KENV

Since the kernel environment has its own dependencies, lurking at the end
of the SI_SUB_KMEM sequence appeared to be fragile.  Provide own subsystem
for it.  The init_dynamic_kenv() goes SI_ORDER_FIRST, and two modules that
depend on it go SI_ORDER_ANY.

PR:                     297492
Reviewed by:            imp, markj, emaste
Differential Revision:  https://reviews.freebsd.org/D58836
DeltaFile
+1-1sys/kern/subr_hints.c
+1-1sys/kern/kern_environment.c
+1-1sys/geom/eli/g_eli.c
+1-0sys/sys/kernel.h
+4-34 files

FreeBSD/ports 011dee7math/gmp/files patch-mini-gmp_mini-gmp.h patch-gmp-h.in

math/gmp: fix build after base cd0727ec709b

After base cd0727ec709bb54f8f82104f6113284a15dd3464 ("libc: Add
<stdio.h> C23 feature test macro"), math/gmp fails to build with errors
similar to:

  inp_str.c:63:10: warning: call to undeclared function '__gmpz_inp_str_nowhite'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     63 |   return mpz_inp_str_nowhite (x, stream, base, c, nread);
        |          ^
  ../gmp-impl.h:1782:29: note: expanded from macro 'mpz_inp_str_nowhite'
   1782 | #define mpz_inp_str_nowhite __gmpz_inp_str_nowhite
        |                             ^
  inp_str.c:68:1: error: conflicting types for '__gmpz_inp_str_nowhite'
     68 | mpz_inp_str_nowhite (mpz_ptr x, FILE *stream, int base, int c, size_t nread)
        | ^
  ../gmp-impl.h:1782:29: note: expanded from macro 'mpz_inp_str_nowhite'
   1782 | #define mpz_inp_str_nowhite __gmpz_inp_str_nowhite
        |                             ^
  inp_str.c:63:10: note: previous implicit declaration is here

    [20 lines not shown]
DeltaFile
+12-0math/gmp/files/patch-mini-gmp_mini-gmp.h
+12-0math/gmp/files/patch-gmp-h.in
+24-02 files

FreeBSD/ports 03ce372math/gmp/files patch-mini-gmp_mini-gmp.h patch-gmp-h.in

math/gmp: fix build after base cd0727ec709b

After base cd0727ec709bb54f8f82104f6113284a15dd3464 ("libc: Add
<stdio.h> C23 feature test macro"), math/gmp fails to build with errors
similar to:

  inp_str.c:63:10: warning: call to undeclared function '__gmpz_inp_str_nowhite'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     63 |   return mpz_inp_str_nowhite (x, stream, base, c, nread);
        |          ^
  ../gmp-impl.h:1782:29: note: expanded from macro 'mpz_inp_str_nowhite'
   1782 | #define mpz_inp_str_nowhite __gmpz_inp_str_nowhite
        |                             ^
  inp_str.c:68:1: error: conflicting types for '__gmpz_inp_str_nowhite'
     68 | mpz_inp_str_nowhite (mpz_ptr x, FILE *stream, int base, int c, size_t nread)
        | ^
  ../gmp-impl.h:1782:29: note: expanded from macro 'mpz_inp_str_nowhite'
   1782 | #define mpz_inp_str_nowhite __gmpz_inp_str_nowhite
        |                             ^
  inp_str.c:63:10: note: previous implicit declaration is here

    [18 lines not shown]
DeltaFile
+12-0math/gmp/files/patch-mini-gmp_mini-gmp.h
+12-0math/gmp/files/patch-gmp-h.in
+24-02 files

LLVM/project 4c30f45clang/lib/Sema SemaLifetimeSafety.h, clang/test/Sema/LifetimeSafety annotation-suggestions.cpp

macro-suggest
DeltaFile
+27-8clang/lib/Sema/SemaLifetimeSafety.h
+15-0clang/test/Sema/LifetimeSafety/annotation-suggestions.cpp
+42-82 files

LLVM/project 9018adcclang/include/clang/CIR/Dialect/IR CIRTypes.h, clang/lib/CIR/Dialect/Transforms CallConvLoweringPass.cpp

[CIR] Classify around a record's padding on x86_64

The x86_64 bridge refused any struct whose CIR type carries a pad member, which
is every over-aligned record and every record with a gap between two members.
The ABI library already reads each field's explicit offset, sizes the record
from its own size, and treats a gap no field overlaps as holding no user data.
However, the bridge was handing it every member as a field, padding included, so
a record's padding bytes read as data.  Now we build the field list from the
members that hold data.

Assisted-by: Cursor / claude-opus-5
DeltaFile
+151-0clang/test/CIR/CodeGen/call-conv-lowering-x86_64-padded.c
+84-0clang/test/CIR/Transforms/abi-lowering/x86_64-struct-padded.cir
+55-18clang/test/CIR/Transforms/abi-lowering/x86_64-aggregate-nyi.cir
+41-16clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
+7-0clang/include/clang/CIR/Dialect/IR/CIRTypes.h
+338-345 files

LLVM/project a6c300ellvm/lib/Target/AMDGPU AMDGPUInstructionSelector.cpp

AMDGPU: Use mi_match for selector vector-source instruction lookups (#216792)

Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
DeltaFile
+11-8llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
+11-81 files

LLVM/project 1f5296bllvm/lib/CodeGen/SelectionDAG TargetLowering.cpp

Address review comments

Only clamp negative inputs to zero when saturating. Without saturation
the result is poison, so nothing needs to be emitted and no select gets
a poison operand.

Trim the comments added by the previous commit.

Change-Id: I7b86ebd6d0b7853f4dea7312bec21aea2bb91def
DeltaFile
+11-14llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+11-141 files

LLVM/project b3bac42flang/lib/Parser basic-parsers.h Fortran-parsers.cpp, flang/test/Parser recovery09.f90

[flang] Improve error for misplaced statement after CONTAINS in derived type (#215886)

A statement after `CONTAINS` in a derived type that is not a type-bound
procedure binding (e.g. a second `CONTAINS`, an `IMPORT`, or a misplaced
subprogram) leaked the intrinsic type-spec parse failures (`expected
'COMPLEX'`, `expected 'INTEGER'`, ...) instead of reporting that a
type-bound procedure binding was expected. In the misplaced-subprogram
case flang emitted an avalanche of unrelated `expected '<type-keyword>'`
errors.

This is a diagnostic regression from #203379, which added
`DataComponentDefStmt` as a trailing alternative in the
type-bound-proc-binding parser. Its intended `fail<>()` message only
fires when `DataComponentDefStmt` fully matches; for other invalid
statement the partial parse into `declarationTypeSpec` displaced the
recovery message in `CombineFailedParses`.

This patch wraps the binding alternatives in `withMessage()` so that
when none of them match a token a single clear message is emitted:

    [17 lines not shown]
DeltaFile
+36-7flang/test/Parser/recovery09.f90
+9-6flang/lib/Parser/Fortran-parsers.cpp
+8-1flang/lib/Parser/basic-parsers.h
+53-143 files

LLVM/project e38d4c3llvm/lib/Target/RISCV RISCVVLOptimizer.cpp, llvm/test/CodeGen/RISCV/rvv vl-opt-undef-vl.mir

RISCV: Fix VL optimizer crash on an undef VL operand (#216803)

Found by AI while working on something else.

Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
DeltaFile
+18-0llvm/test/CodeGen/RISCV/rvv/vl-opt-undef-vl.mir
+4-1llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
+22-12 files

FreeBSD/src 2cefae4sbin/restore symtab.c

Fix transposed arguments in call to calloc(). Reported by GCC 15 warning.

No functional change intended.

Submitted by: Pedro Giffuni <pfg at freebsd.org>
MFC-after:    1 week
DeltaFile
+1-1sbin/restore/symtab.c
+1-11 files

LLVM/project 1b17c33llvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.cpp, llvm/test/CodeGen/SPIRV/debug-info debug-line-loop-control-intel.ll debug-line.ll

Add support for NSDI DebugLine and DebugNoLine. (#215851)

Add support for
[DebugLine](https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.Shader.DebugInfo.html#DebugLine)
and DebugNoLine.
DeltaFile
+160-0llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+96-0llvm/test/CodeGen/SPIRV/debug-info/debug-line-selection-merge.ll
+83-0llvm/test/CodeGen/SPIRV/debug-info/debug-line-calls.ll
+73-0llvm/test/CodeGen/SPIRV/debug-info/debug-line-if-phi.ll
+68-0llvm/test/CodeGen/SPIRV/debug-info/debug-line.ll
+67-0llvm/test/CodeGen/SPIRV/debug-info/debug-line-loop-control-intel.ll
+547-09 files not shown
+874-115 files

NetBSD/pkgsrc-wip 53576aaprometheus-lts PLIST Makefile, prometheus-lts/patches patch-cmd_prometheus_main.go

prometheus-lts: Downgrade to 3.5.5

Latest stable release of the 3.5.x LTS.

See TODO on build problems that are currently happening with 3.13.2.
DeltaFile
+832-2,848prometheus-lts/distinfo
+275-947prometheus-lts/go-modules.mk
+6-6prometheus-lts/patches/patch-cmd_prometheus_main.go
+4-4prometheus-lts/PLIST
+4-4prometheus-lts/Makefile
+1,121-3,8095 files

LLVM/project a10f62eclang/include/clang/CIR/Dialect/IR CIRAttrs.td, clang/lib/CIR/CodeGen CIRGenExprCXX.cpp

[CIR] Implement aligned-array-delete. (#216789)

This ends up being a pretty trivial implementation, since we just have
to add the additional i64 argument to the call. This patch adds that,
after threading the alignment through CIR.

Also, the type-aware and destroying deletes aren't valid on a array
delete, so replace those checks with 'assert' instead.
DeltaFile
+140-0clang/test/CIR/CodeGen/delete-array-aligned.cpp
+10-4clang/lib/CIR/Dialect/Transforms/CXXABILowering.cpp
+9-1clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp
+1-1clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+160-64 files

LLVM/project d7594bfclang/test/OpenMP reverse_codegen.cpp interchange_codegen.cpp

[Clang][CodeGen] Use ptrtoaddr for pointer diff (#210729)

We don't have to expose the provenance of pointers for pointer
subtraction, so use ptrtoaddr instead of ptrtoint if -fwrapv-pointer is
not set.
DeltaFile
+1,049-1,049clang/test/OpenMP/parallel_for_codegen.cpp
+124-118clang/test/OpenMP/tile_codegen.cpp
+124-118clang/test/OpenMP/stripe_codegen.cpp
+82-78clang/test/OpenMP/fuse_codegen.cpp
+58-57clang/test/OpenMP/interchange_codegen.cpp
+36-36clang/test/OpenMP/reverse_codegen.cpp
+1,473-1,45611 files not shown
+1,569-1,52017 files

NetBSD/src Di2uebNsys/arch/amd64/amd64 db_interface.c, sys/arch/i386/i386 db_interface.c

   crash(8): Add support for `mach cpu N' on x86.

   Requires core dump to have the registers saved on cpuN.  This happens
   with the ddb `sync' command, but not with the kern.dump_on_panic=1
   ddb.onpanic=0 path yet -- TBD.

   PR bin/58010: crash(8) doesn't support `mach cpu N' to examine
   registers/stack of other CPUs
VersionDeltaFile
1.5+91-3usr.sbin/crash/arch/x86.c
1.91+6-2sys/arch/i386/i386/db_interface.c
1.43+6-2sys/arch/amd64/amd64/db_interface.c
1.55+6-1usr.sbin/crash/Makefile
+109-84 files

LLVM/project aa2c1b5llvm/include/llvm/CodeGen LiveIntervals.h, llvm/lib/CodeGen MachineBasicBlock.cpp LiveIntervals.cpp

[CodeGen] Fix stale LiveIntervals regmask tables after MachineBasicBl… (#209610)

MachineBasicBlock::splitAt() moves the tail of a block -- including any
call instructions carrying register-mask operands -- into a newly
created block. When LiveIntervals is attached it calls
LIS->insertMBBInMaps() for the new block, which records the block with
zero regmask slots. That is only correct for a fresh, empty block:
because the tail (and its regmasks) was *moved* out of the original
block, the per-block RegMaskBlocks index for both blocks is left stale,
so checkRegMaskInterference() can miss a call clobber and the register
allocator can assign a live value to a clobbered physical register.

Add a LiveIntervals::splitAt(Orig, SplitBB) entry point that inserts
SplitBB into the SlotIndexes/regmask maps and then re-slices the moved
regmask slots out of Orig's RegMaskBlocks entry into SplitBB's
(RegMaskSlots is sorted, so the slots that moved are those at/after
SplitBB's start index). MachineBasicBlock::splitAt() now calls it in
place of insertMBBInMaps().


    [13 lines not shown]
DeltaFile
+39-0llvm/lib/CodeGen/LiveIntervals.cpp
+33-0llvm/unittests/MI/LiveIntervalTest.cpp
+19-4llvm/include/llvm/CodeGen/LiveIntervals.h
+1-1llvm/lib/CodeGen/MachineBasicBlock.cpp
+92-54 files

FreeBSD/ports 492bb54x11/lightdm Makefile distinfo, x11/lightdm/files patch-src_vt.c

x11/lightdm: Update to 1.33.1

- VT fix has been merged upstream
DeltaFile
+0-13x11/lightdm/files/patch-src_vt.c
+3-3x11/lightdm/distinfo
+1-1x11/lightdm/Makefile
+4-173 files

LLVM/project a7ef89alldb/test/API/functionalities/breakpoint/hardware_breakpoints/write_memory_with_hw_breakpoint TestWriteMemoryWithHWBreakpoint.py

Revert "[lldb][test] Fix skip in TestWriteMemoryWithHWBreakpoint.py" (#216806)

Reverts llvm/llvm-project#216723
DeltaFile
+3-2lldb/test/API/functionalities/breakpoint/hardware_breakpoints/write_memory_with_hw_breakpoint/TestWriteMemoryWithHWBreakpoint.py
+3-21 files

LLVM/project 992a291utils/bazel/llvm-project-overlay/clang BUILD.bazel

[bazel] Fixes #215349 (#216811)
DeltaFile
+1-0utils/bazel/llvm-project-overlay/clang/BUILD.bazel
+1-01 files

LLVM/project 12da120flang/lib/Semantics resolve-directives.cpp, flang/test/Semantics/OpenACC acc-attach-unresolved.f90

[flang][OpenACC] Fix crash on ATTACH/DETACH with an unresolved name (#216801)

`AccAttributeVisitor::EnsureAllocatableOrPointer()` passes the last name of the
designator to `IsAllocatableOrObjectPointer()`, which accepts a null `Symbol`
pointer and returns `false` for it. When the argument of an `ATTACH` or `DETACH`
clause fails name resolution -- for example a component reference whose derived
type could not be resolved -- that name's symbol is null, so control reaches the
error-reporting path, which then dereferences the same null symbol and crashes
the compiler.

Because the crash happens during name resolution, it precedes the point where
semantic diagnostics are emitted, so the compiler dies with no output at all
rather than reporting the errors that caused the name to be unresolved.

Reproducer:

```fortran
subroutine test_attach_unresolved
  type :: ty

    [13 lines not shown]
DeltaFile
+17-0flang/test/Semantics/OpenACC/acc-attach-unresolved.f90
+5-0flang/lib/Semantics/resolve-directives.cpp
+22-02 files

NetBSD/pkgsrc-wip d86b86aprometheus-lts TODO

prometheus-lts: Point out the version tested

(Redundant right now, but this package will go back to 3.5.5 that seems
fine and still LTS probably!)
DeltaFile
+1-1prometheus-lts/TODO
+1-11 files

LLVM/project b71ce8fclang/lib/CodeGen CodeGenModule.cpp CGCUDANV.cpp, llvm/include/llvm/IR GlobalVariable.h

[llvm] Remove GlobalVariable::getAlignment (NFC) (#213300)
DeltaFile
+8-7clang/lib/CodeGen/CGCUDANV.cpp
+4-4clang/lib/CodeGen/CodeGenModule.cpp
+0-6llvm/include/llvm/IR/GlobalVariable.h
+3-2llvm/lib/Transforms/IPO/Instrumentor.cpp
+1-1llvm/lib/Target/DirectX/DXILFlattenArrays.cpp
+1-1llvm/lib/Target/DirectX/DXILDataScalarization.cpp
+17-213 files not shown
+20-249 files

LLVM/project ae05cdellvm/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 0132a93llvm/test/Transforms/PGOProfile/Inputs memprof_loop_unroll.memprofraw memprof_loop_unroll.exe

[NFC][MemProf] Remove unused memprofraw test file (#216778)

`llvm/test/Transforms/PGOProfile/Inputs/memprof_loop_unroll.memprofraw`
was created in https://github.com/llvm/llvm-project/pull/79433 for the
`llvm/test/Transforms/PGOProfile/memprof_loop_unroll.ll` test, but the
usage was removed in https://github.com/llvm/llvm-project/pull/165338 in
favor of an inline `.yaml` file. Remove the `.memprofraw` file and the
generator script.
DeltaFile
+0-29llvm/test/Transforms/PGOProfile/Inputs/update_memprof_inputs.sh
+0-0llvm/test/Transforms/PGOProfile/Inputs/memprof_loop_unroll.memprofraw
+0-0llvm/test/Transforms/PGOProfile/Inputs/memprof_loop_unroll.exe
+0-293 files