LLVM/project b19a36amlir/include/mlir/Dialect/Affine/IR AffineOps.td, mlir/test/Dialect/Bufferization/Transforms buffer-loop-hoisting.mlir

[mlir][Affine] Prevent buffer hoisting out of affine.parallel (#225324)

I noticed that `buffer-loop-hoisting` can move allocations out of
`affine.parallel`, making a buffer that should be local to each
iteration shared between the parallel iterations.

`AffineParallelOp` implements `LoopLikeOpInterface` but was missing the
`HasParallelRegion` trait, so `isSequentialLoop` treated it as
sequential. This adds the missing trait to `affine.parallel`, allowing
the pass to recognize the parallel boundary without changing the
hoisting logic.

I’ve added a regression test based on the reproducer in #225149, which
checks that the allocation stays inside `affine.parallel` and that the
store and load still use that allocation.

Fixes #225149.
DeltaFile
+24-0mlir/test/Dialect/Bufferization/Transforms/buffer-loop-hoisting.mlir
+2-1mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
+26-12 files

LLVM/project 569085fclang/lib/Headers riscv_packed_simd.h, clang/test/CodeGen/RISCV rvp-intrinsics.c

[Clang][RISCV] Add packed widening subtraction accumulate intrinsics (#225764)

Add Clang header intrinsics for the RISC-V P-extension packed widening
subtraction accumulate operations:

- __riscv_pwsuba_i16x4
- __riscv_pwsuba_i32x2
- __riscv_pwsubau_u16x4
- __riscv_pwsubau_u32x2

Each computes rd + (a - b). The header wrappers use generic LLVM IR,
so RV32 selects the direct `pwsuba.*` / `pwsubau.*` instructions while
RV64 lowers the generic IR to the decomposition specified by the
P-extension intrinsic spec.
DeltaFile
+121-0clang/test/CodeGen/RISCV/rvp-intrinsics.c
+85-0llvm/test/CodeGen/RISCV/rvp-widening-sub-acc.ll
+57-0llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+40-0cross-project-tests/intrinsic-header-tests/riscv_packed_simd.c
+16-0llvm/lib/Target/RISCV/RISCVInstrInfoP.td
+13-0clang/lib/Headers/riscv_packed_simd.h
+332-06 files

LLVM/project cdd0cc7clang/lib/Headers riscv_packed_simd.h, clang/test/CodeGen/RISCV rvp-intrinsics.c

[Clang][RISCV] Add packed subvector insert intrinsics (#225771)

Add __riscv_pset_i8x4_i8x8, __riscv_pset_u8x4_u8x8,
__riscv_pset_i16x2_i16x4 and __riscv_pset_u16x2_u16x4, which insert a
32-bit packed subvector into a 64-bit packed vector. The index selects
the low or high half and must be a constant, enforced with
__enable_if__ as for the element insert intrinsics.
DeltaFile
+306-0clang/test/CodeGen/RISCV/rvp-intrinsics.c
+56-0cross-project-tests/intrinsic-header-tests/riscv_packed_simd.c
+38-0clang/lib/Headers/riscv_packed_simd.h
+400-03 files

LLVM/project a3ac598flang/include/flang/Optimizer/Transforms Passes.td, flang/lib/Optimizer/Builder FIRBuilder.cpp

[flang][cuda] Defer data-transfer conversion in OpenACC routines (#225906)

Add an option so cuf-convert can leave cuf.data_transfer in the
host copy of an OpenACC routine until host/device specialization.
After that, transfers in a specialized device body become
assignments. Place allocas inside IsolatedFromAbove offload
regions so later FIR lowering does not store into a temporary
defined outside acc.compute_region.
DeltaFile
+101-0flang/test/Fir/CUDA/cuda-data-transfer-defer-acc-routine.mlir
+46-1flang/lib/Optimizer/Transforms/CUDA/CUFOpConversion.cpp
+9-2flang/include/flang/Optimizer/Transforms/Passes.td
+6-0flang/lib/Optimizer/Builder/FIRBuilder.cpp
+162-34 files

FreeBSD/src 784f570usr.bin/split split.1

split.1: grammar

PR:             294757
Reported by:    Ulrich Eduard
MFC after:      1 week

(cherry picked from commit c0c7d1e1af4e42deb9c5a95c735602100c3cc1f2)
DeltaFile
+1-1usr.bin/split/split.1
+1-11 files

LLVM/project 5b8f372llvm/lib/Target/RISCV RISCVInstrInfoP.td, llvm/test/CodeGen/RISCV rvp-simd-64.ll rvp-ppaireo-w.ll

[RISCV][P-ext] Select PPAIREO.W when packing with the high word of a value (#225763)

The low-half packed subvector insert is a v2i32 whose low word is the
subvector and whose high word is the high word of the wide vector,
which is exactly `ppaireo.w` (the low word comes from `rs1`, the high
word from `rs2`). Select it directly instead of `srli` + `pack`.

Adds `rvp-ppaireo-w.ll`; `rvp-simd-64.ll` is updated because the scalar
low insert in `test_insert_vector_32` now selects `ppaireo.w`.
DeltaFile
+46-0llvm/test/CodeGen/RISCV/rvp-ppaireo-w.ll
+5-0llvm/lib/Target/RISCV/RISCVInstrInfoP.td
+1-2llvm/test/CodeGen/RISCV/rvp-simd-64.ll
+52-23 files

LLVM/project 3b26448libc/src/sys/stat CMakeLists.txt mknod.h, libc/src/sys/stat/linux CMakeLists.txt mknod.cpp

[libc] Implement mknod in sys/stat (#225677)

Implement the standard POSIX.1-2008 / POSIX.1-2024 function `mknod` in
`<sys/stat.h>`.

Fixes #225664
DeltaFile
+72-0libc/test/src/sys/stat/mknod_test.cpp
+35-0libc/src/sys/stat/linux/mknod.cpp
+27-0libc/src/sys/stat/mknod.h
+23-0libc/test/src/sys/stat/CMakeLists.txt
+17-0libc/src/sys/stat/linux/CMakeLists.txt
+7-0libc/src/sys/stat/CMakeLists.txt
+181-04 files not shown
+190-010 files

LLVM/project d41ee5cllvm/lib/Transforms/Scalar ConstraintElimination.cpp, llvm/test/Transforms/ConstraintElimination srem.ll sdiv.ll

[ConstraintElim] Add facts for sdiv with a positive divisor. (#225535)

Add signed bounds for `sdiv x, n`:

  * `x s>= 0` and `n s> 0`  =>  result s>= 0 and result s<= x
    https://alive2.llvm.org/ce/z/Tvb3Nq
  * `x s>  0` and `n s> 1`  => result s= 0 and result s< x
   https://alive2.llvm.org/ce/z/sL-XyG

PR: https://github.com/llvm/llvm-project/pull/225535
DeltaFile
+492-0llvm/test/Transforms/ConstraintElimination/sdiv.ll
+29-2llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+0-20llvm/test/Transforms/ConstraintElimination/srem.ll
+521-223 files

LLVM/project 9edbab8llvm/lib/Transforms/Utils SCCPSolver.cpp, llvm/test/Transforms/SCCP fastmath-flags.ll

[SCCP] Call correct simplifyBinOp in FP operation

This simplify FPOps with correct FMF, which covers non-inlined function
that can not be simplified by InstComb pass.

Also, update the TODO as we have cover that case in simplifyBinOp. But
per-element optimization is not enable as we don't have structure-like
LatticeMap for vector.
DeltaFile
+189-0llvm/test/Transforms/SCCP/fastmath-flags.ll
+10-4llvm/lib/Transforms/Utils/SCCPSolver.cpp
+199-42 files

LLVM/project 8333d8bllvm/lib/Target/AMDGPU AMDGPUInstCombineIntrinsic.cpp

Update again
DeltaFile
+39-45llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
+39-451 files

LLVM/project c334dd4llvm/lib/Target/AMDGPU AMDGPUInstCombineIntrinsic.cpp, llvm/test/Transforms/InstCombine/AMDGPU llvm.amdgcn.sudot.ll

[AMDGPU] Fold a constant add/sub into the sudot4/sudot8 accumulator

Fold a constant add into the accumulator operand of sudot4 and sudot8 when
clamping is disabled:
```
  sudot(a, b, C1, false) + C2 -> sudot(a, b, C1 + C2, false)
```
Subtraction by a constant is canonicalized to addition of its negation.
DeltaFile
+10-20llvm/test/Transforms/InstCombine/AMDGPU/llvm.amdgcn.sudot.ll
+26-0llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
+36-202 files

LLVM/project ea25346llvm/lib/Target/AMDGPU AMDGPUInstCombineIntrinsic.cpp

Update for comments
DeltaFile
+3-3llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
+3-31 files

LLVM/project 20d7f6cllvm/lib/Target/AMDGPU AMDGPUInstCombineIntrinsic.cpp, llvm/test/Transforms/InstCombine/AMDGPU llvm.amdgcn.dot.ll

[AMDGPU][InstCombine] Fold zero dot operands to accumulator

Fold AMDGPU dot intrinsics when either operand is zero.

`dot(a, 0) = 0` and `dot(0, b) = 0`, so replace the intrinsic with its accumulator.
This avoids unrelated clamp and add/sub reassociation cases.
DeltaFile
+15-30llvm/test/Transforms/InstCombine/AMDGPU/llvm.amdgcn.dot.ll
+3-0llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
+18-302 files

LLVM/project 8e7008allvm/lib/Target/AMDGPU AMDGPUInstCombineIntrinsic.cpp, llvm/test/Transforms/InstCombine/AMDGPU llvm.amdgcn.dot.ll

[AMDGPU][InstCombine] Canonicalize dot constant operands (#225083)

Move constant dot product source operands to the right hand side
and add tests for signed and unsigned dot intrinsics.
DeltaFile
+12-12llvm/test/Transforms/InstCombine/AMDGPU/llvm.amdgcn.dot.ll
+10-0llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
+22-122 files

LLVM/project 3113e3bflang/test/Fir if-constant-condition-fold.fir, flang/test/Fir/CUDA predefined-variables.mlir

[flang] Fold fir.if with a constant condition (#225542)

Use `populateRegionBranchOpInterfaceInliningPattern` to fold `fir.if`
when the condition is a constant. It inlines the region the condition
selects, replacing uses of the `fir.if` results with the operands of
that region's `fir.result`, and erases the `fir.result`. A false
condition with no else region leaves nothing behind.
DeltaFile
+156-0flang/test/Fir/if-constant-condition-fold.fir
+10-50flang/test/Lower/Intrinsics/ieee_flag.f90
+8-40flang/test/Lower/Intrinsics/ieee_max_min.f90
+33-0flang/test/Lower/if-constant-condition.f90
+2-6flang/test/Fir/CUDA/predefined-variables.mlir
+1-5flang/test/Lower/Intrinsics/ieee_logb.f90
+210-1011 files not shown
+212-1017 files

LLVM/project a56224cllvm/lib/Analysis InstructionSimplify.cpp

[InstSimplify] Add missing FRem in FMF overload
DeltaFile
+2-0llvm/lib/Analysis/InstructionSimplify.cpp
+2-01 files

LLVM/project e8d8ea3orc-rt/include/orc-rt-internal/bedrock/sys/darwin StandaloneMachOUnwindInfoRegistrar.h, orc-rt/include/orc-rt/bedrock StandaloneMachOUnwindInfoRegistrar.h

[orc-rt] Make StandaloneMachOUnwindInfoRegistrar internal. (#225982)

StandaloneMachOUnwindInfoRegistrar depends on libunwind's
__unw_add_find_dynamic_unwind_sections, which is only available on
Darwin, and is only consumed within the runtime. Move its header to
orc-rt-internal/bedrock/sys/darwin/ (no longer installed), and its
sources and unit test to the corresponding sys/darwin/ directories.

The SPS CI adder header stays public, but is now installed only on Apple
platforms.
DeltaFile
+0-234orc-rt/lib/bedrock/StandaloneMachOUnwindInfoRegistrar.cpp
+234-0orc-rt/lib/bedrock/sys/darwin/StandaloneMachOUnwindInfoRegistrar.cpp
+0-188orc-rt/test/unit/bedrock/StandaloneMachOUnwindInfoRegistrarTest.cpp
+188-0orc-rt/test/unit/bedrock/sys/darwin/StandaloneMachOUnwindInfoRegistrarTest.cpp
+0-132orc-rt/include/orc-rt/bedrock/StandaloneMachOUnwindInfoRegistrar.h
+132-0orc-rt/include/orc-rt-internal/bedrock/sys/darwin/StandaloneMachOUnwindInfoRegistrar.h
+554-5545 files not shown
+606-60111 files

LLVM/project 4802f8fllvm/lib/Target/RISCV RISCVInstrInfoXqci.td, llvm/test/MC/RISCV xqciio-invalid.s xqciio-valid.s

[RISCV][MC] Allow x0 as the destination of qc.inw (#225602)

According to the Xqciio specification, `qc.inw` does not impose any
restriction that excludes `x0` as the destination register. In
`qc.inw.yaml`, `rd` is defined as:

```
- name: rd
  location: 11-7
```

This commit removes the incorrect `x0` restriction for `qc.inw`.

Link:
https://github.com/qualcomm/riscv-unified-db/blob/main/arch_overlay/qc_iu/inst/Xqci/qc.inw.yaml
DeltaFile
+0-4llvm/test/MC/RISCV/xqciio-invalid.s
+4-0llvm/test/MC/RISCV/xqciio-valid.s
+1-1llvm/lib/Target/RISCV/RISCVInstrInfoXqci.td
+5-53 files

LLVM/project 34d9eabllvm/lib/Target/RISCV RISCVInstrInfo.h RISCVInstrInfo.cpp, llvm/test/CodeGen/RISCV machine-sink-jumptable-edge-split.ll

[RISCV] Support getJumpTableIndex (#224197)

This patch implements getJumpTableIndex hook for RISC-V; it trace from
PseudoBRIND back to the %jump-table.N.

The li instruction in jumptable dispatch block exists because the phi
constant is emitted during instruction selection. LLVM chooses the
source block in which to place the phi constant, then postpones moving
it to MachineSink, which relocates the phi constant closer to its use
site. However, to sink it out of the jump table dispatch block,
MachineSink needs to split the critical edge, which requires updating
the jump table entry. It needs the getJumpTableIndex hook to know which
jump table to update.

This avoids unnecessary instructions in the hot path (the jump table
dispatch block).
DeltaFile
+169-0llvm/test/CodeGen/RISCV/machine-sink-jumptable-edge-split.ll
+75-0llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
+2-0llvm/lib/Target/RISCV/RISCVInstrInfo.h
+246-03 files

LLVM/project 15c447eflang/include/flang/Optimizer/Dialect FIROps.td, flang/lib/Optimizer/CodeGen CodeGen.cpp

[flang][FIR] Make global section an inherent attribute (#225963)

Preserve the section when lowering fir.global to an LLVM global.

Assisted-by: Codex
DeltaFile
+2-6flang/lib/Optimizer/Transforms/CUDA/CUFAddConstructor.cpp
+6-0flang/test/Fir/global-attributes.fir
+2-0flang/lib/Optimizer/CodeGen/CodeGen.cpp
+1-0flang/include/flang/Optimizer/Dialect/FIROps.td
+11-64 files

LLVM/project 9c2e2cfllvm/lib/Target/AArch64 AArch64CodeLayoutOpt.cpp, llvm/test/CodeGen/AArch64 code-layout-opt.ll

Disable AArch64CodeLayoutOpt for Windows targets. (#225974)

The pass is not compatible with Windows unwind info.

Fixes #212819
DeltaFile
+108-0llvm/test/CodeGen/AArch64/code-layout-opt.ll
+5-0llvm/lib/Target/AArch64/AArch64CodeLayoutOpt.cpp
+113-02 files

LLVM/project 79cd206llvm/lib/Target/AMDGPU GCNHazardRecognizer.h GCNHazardRecognizer.cpp, llvm/test/CodeGen/AMDGPU rewrite-vgpr-mfma-to-agpr.ll mai-hazards-gfx942.mir

[AMDGPU] Measure MFMA read hazards at each producer

Introduce more sophisticated traversal to avoid the following traps:
 - order-dependent traversal and discarding seen BBs despite shorter path
 - mis-matching distance and window of different producers

Record the best distance per BB instead of a visited flag and sweep the
arrivals in nondecreasing distance (bucket queue). This pairs producers
with their actual distance to a consumer in one go.

Fixed scenarios:
 - MFMA reading an MFMA result as srcA, srcB or srcC
 - VALU, memory or export instruction reading an MFMA result

rewrite-vgpr-mfma-to-agpr.ll gains an s_nop 2: a 4-pass XDL write that
partially overlaps the srcC read two slots later requires five wait
states, and none were emitted because the nearest producer wrote the
register in full.

AI-assisted.
DeltaFile
+623-0llvm/test/CodeGen/AMDGPU/mai-hazards-gfx90a.mir
+206-76llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
+78-0llvm/test/CodeGen/AMDGPU/mai-hazards-gfx942.mir
+10-0llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h
+3-2llvm/test/CodeGen/AMDGPU/rewrite-vgpr-mfma-to-agpr.ll
+920-785 files

LLVM/project dd5f58ellvm/lib/Target/AMDGPU GCNHazardRecognizer.h GCNHazardRecognizer.cpp

[AMDGPU][NFC] Extract the MFMA read-window calculation

Move the wait states a consumer needs before reading an MFMA result out
of checkMAIHazards90A into getMFMAReadWaitStates, taking the producer as
an argument, so a caller can ask about a specific producer. The partial
srcC overlap half moves into getMFMAOverlappedSrcCWaitStates. The caller
passes the producer the walk recorded, so nothing changes.

AI-assisted.
DeltaFile
+145-137llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
+11-0llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h
+156-1372 files

LLVM/project c85fe98llvm/lib/Target/AMDGPU GCNHazardRecognizer.cpp, llvm/test/CodeGen/AMDGPU mai-hazards-gfx90a.mir mai-hazards-gfx942.mir

[AMDGPU] Measure MFMA overwrite hazards at each instruction

Apply previously established processing to:
 - VALU overwriting an MFMA result
 - VALU overwriting a register an MFMA took as srcC

AI-assisted.
DeltaFile
+52-54llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
+58-0llvm/test/CodeGen/AMDGPU/mai-hazards-gfx942.mir
+51-0llvm/test/CodeGen/AMDGPU/mai-hazards-gfx90a.mir
+161-543 files

LLVM/project 8cfc65ellvm/lib/Target/AMDGPU GCNHazardRecognizer.cpp

[AMDGPU][NFC] Avoid duplicate MAI hazard checks

PreEmitNoopsCommon called checkMAIVALUHazards twice whenever padding was
required.

AI-assisted.
DeltaFile
+3-4llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
+3-41 files

LLVM/project 28fec94llvm/test/tools/llvm-profgen lit.local.cfg, llvm/test/tools/llvm-profgen/AArch64 cs-bogus-trace.test

[llvm-profgen] Fix bogus trace check (#225569)
DeltaFile
+160-0llvm/test/tools/llvm-profgen/AArch64/cs-bogus-trace.test
+30-5llvm/tools/llvm-profgen/PerfReader.cpp
+3-18llvm/tools/llvm-profgen/PerfReader.h
+5-0llvm/test/tools/llvm-profgen/lit.local.cfg
+198-234 files

HardenedBSD/src c6e1e91release Makefile.vm, release/tools vmimage.subr

HBSD: Resolve merge conflicts

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+0-4release/Makefile.vm
+0-3release/tools/vmimage.subr
+0-72 files

HardenedBSD/src fe1f30crelease Makefile.vm, release/tools ec2_setpass vmimage.subr

Merge remote-tracking branch 'rad/freebsd/15-stable/main' into hardened/15-stable/main

Conflicts:
        release/Makefile.vm (unresolved)
        release/tools/vmimage.subr (unresolved)
DeltaFile
+73-0release/tools/ec2-desktop.conf
+60-0release/tools/vmimage.subr
+60-0release/tools/ec2_desktop_extras
+58-0release/tools/ec2_setpass
+5-0release/Makefile.vm
+256-05 files

LLVM/project 9058b9cllvm/lib/Target/RISCV/GISel RISCVLegalizerInfo.cpp, llvm/test/CodeGen/RISCV/GlobalISel half-convert.ll

[RISCV][GlobalISel] Fix fptosi/fptoui from half to i64 on RV32 (#222316)

The fcvt.l[u].h patterns are RV64-only, so RV32 had no rule for
`G_FPTOSI/G_FPTOUI` with `{s64, s16}.` The magnitude of a half is at
most `65504`, so with Zfh the i32 result of `fcvt.w[u].h` never
overflows and can simply be extended to i64.
DeltaFile
+75-0llvm/test/CodeGen/RISCV/GlobalISel/half-convert.ll
+5-0llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
+80-02 files

LLVM/project 22108b5llvm/test/TableGen AMDGPUTargetDefGenericClassification.td AMDGPUTargetDefGenericFeatures.td

[AMDGPU] Use synthetic fixtures for generic feature validation tests  (#225551)

Remove the classification test that includes the full AMDGPU target.
Real targets are validated when generating AMDGPUTargetParserDef.inc
during the build.

Extend the lightweight generic feature tests to cover inherited
classifications of backend-only features, support through member-side
implications, and unsupported generic-side implied features.

Addresses the timeout reported on #223179
DeltaFile
+64-16llvm/test/TableGen/AMDGPUTargetDefGenericFeatures.td
+0-71llvm/test/TableGen/AMDGPUTargetDefGenericClassification.td
+64-872 files