NetBSD/pkgsrc-wip 567445b — vis-editor distinfo Makefile

editors/vis-editor: update vis-editor to 0.9
DeltaFile
+14-4vis-editor/PLIST
+4-3vis-editor/Makefile
+3-3vis-editor/distinfo
+21-103 files

HardenedBSD/ports e23381f — deskutils/p5-Goo pkg-plist, devel/php80-arcanist pkg-plist

Merge branch 'freebsd/main' into hardenedbsd/main
DeltaFile
+1,629-0devel/php80-arcanist/pkg-plist
+275-309misc/timr-tui/distinfo
+334-0lang/php80-legacy/files/patch-Zend_zend__vm__execute.h
+312-0lang/php80-legacy/pkg-plist
+140-156misc/timr-tui/Makefile
+0-287deskutils/p5-Goo/pkg-plist
+2,690-752177 files not shown
+5,337-1,164183 files

FreeBSD/src 564bbc9 — sys/conf newvers.sh, usr.bin/yacc config.h

15.2: Update stable/15 to -PRERELEASE

This marks the start of the FreeBSD 15.2 release cycle; the stable/15
tree is now in "code slush".

Developers are encouraged to prioritize fixing bugs (and/or merging bug
fixes from HEAD) over new features at this time.  Commit approval from
re@ is not required but if new features introduce problems they may be
removed from the release.

Approved by:    re (implicit)
Sponsored by:   OpenSats Initiative
DeltaFile
+2-2sys/conf/newvers.sh
+1-1usr.bin/yacc/config.h
+3-32 files

LLVM/project fff3538 — clang/test/CIR/CodeGenCoroutines coro-task.cpp, libc/docs/headers/math log.md index.rst

Merge branch 'main' into users/rnk/tre-byval-copyback
DeltaFile
+1,252-15clang/test/CIR/CodeGenCoroutines/coro-task.cpp
+1,185-0llvm/test/Transforms/IndVarSimplify/implied-nonneg-from-unsigned-bound-swapped.ll
+638-0llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/variance-8x16.ll
+0-637libc/docs/headers/math/index.rst
+630-2llvm/test/Transforms/SLPVectorizer/AArch64/loop-accumulator-reductions-before-seeds.ll
+598-0libc/docs/headers/math/log.md
+4,303-654532 files not shown
+18,744-7,849538 files

Linux/linux 3ac032e — rust bindgen_parameters, rust/kernel fwctl.rs

Merge tag 'for-linus-fwctl' of git://git.kernel.org/pub/scm/linux/kernel/git/fwctl/fwctl

Pull fwctl update from Jason Gunthorpe:

 - One bug fix for a CFI issue in the Rust bindings

* tag 'for-linus-fwctl' of git://git.kernel.org/pub/scm/linux/kernel/git/fwctl/fwctl:
  rust: fwctl: declare cfi_encoding for fwctl_rpc_scope
DeltaFile
+6-6rust/kernel/fwctl.rs
+2-0rust/bindgen_parameters
+8-62 files

OpenZFS/src 4733b98 — module/zfs bpobj.c dsl_deadlist.c, tests/runfiles common.run

dsl_deadlist_open(): clean up on error

Since c33a55b0c2, dsl_deadlist_open() can fail, but when
dmu_bonus_hold() fails it leaves dl_os set.  dsl_deadlist_is_open()
then returns true, and the error paths of dsl_dataset_hold_obj() and
dsl_dir_hold_obj() call dsl_deadlist_close(), which does
dmu_buf_rele(NULL).  For a livelist, dsl_dir_livelist_close() also
destroys dd_pending_allocs and dd_pending_frees, which were never
created.  Importing a pool with a damaged deadlist object can thus
crash the kernel (#17809).

Make dsl_deadlist_open() set dl_os, dl_object and dl_lock only once
it has succeeded, also for an old-format deadlist whose bpobj_open()
fails, so that a failed open leaves the deadlist not open.  Likewise
initialize bpo_lock only once bpobj_open() has succeeded.

Add a test that damages the MOS dnode block holding a snapshot's
deadlist object and holds that snapshot.


    [5 lines not shown]
DeltaFile
+218-0tests/zfs-tests/tests/functional/cli_root/zpool_import/import_deadlist_damaged.ksh
+15-8module/zfs/dsl_deadlist.c
+1-1module/zfs/bpobj.c
+1-0tests/zfs-tests/tests/Makefile.am
+1-0tests/runfiles/common.run
+236-95 files

Linux/linux fcb92ec — drivers/infiniband/hw/erdma erdma_verbs.c, drivers/infiniband/hw/ionic ionic_controlpath.c

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma

Pull rdma updates from Jason Gunthorpe:
 "A smaller cycle for features, still mostly AI and tool found bug fixes
  for long standing issues:

   - Bug fixes and minor cleanups across bnxt_re, cxgb4, EFA, ERDMA,
     HFI1, HNS, ionic, iRDMA, mlx4/mlx5, rdmavt, rtrs, RXE, SIW, SRP,
     isert and IPoIB. Lots of error unwind leaks, integer overflows, and
     use after free during teardown from timers/work that was not
     cancelled

   - Core fixes for uverbs DMABUF lifetime, RMPP reassembly use after
     free, multicast rb-tree corruption, restrack, and a user
     triggerable NULL deref when creating a WQ without a CQ

   - Prevent userspace from getting a writable mmap of the cxgb4 status
     page and the mlx4 clock page


    [54 lines not shown]
DeltaFile
+601-229drivers/infiniband/hw/ionic/ionic_controlpath.c
+330-253drivers/infiniband/hw/erdma/erdma_verbs.c
+400-0drivers/net/ethernet/mellanox/mlx5/core/data_direct.c
+285-111drivers/infiniband/hw/mana/cq.c
+0-227drivers/infiniband/hw/mlx5/data_direct.c
+55-143drivers/infiniband/hw/mlx5/main.c
+1,671-963148 files not shown
+3,829-2,054154 files

OpenZFS/src 5135029 — module/zfs zfs_ioctl.c, tests/zfs-tests/tests/functional/zoned_uid zoned_uid_021_neg.ksh

zoned_uid: preserve global-only zoning property checks (#19521)

The UID-based property policy returns before the global-zone check for
zoned. A namespace owner with delegated zoned permission can change it
through ZFS_IOC_SET_PROP, although the CLI rejects the request.

Check both zoning properties before choosing the UID or regular policy.
Use dsl_deleg_access() instead of repeating its dataset-hold sequence,
retaining the delegation-disabled rejection.

Grant zoned permission in the existing negative test so absence of the
grant does not hide the property restriction.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Kamil Monicz <kamil at monicz.dev>
Closes #19521
DeltaFile
+7-50module/zfs/zfs_ioctl.c
+3-4tests/zfs-tests/tests/functional/zoned_uid/zoned_uid_021_neg.ksh
+10-542 files

LLVM/project 4c444a6 — lldb/include/lldb/Target TargetGroupList.h TargetGroup.h, lldb/source/Plugins/Process/gdb-remote ProcessGDBRemote.cpp

[lldb] Track CPU and accelerator target relationships (#232906)

### Summary

This PR adds the relationship between CPU and accelerator targets.

## Test

Added unit and end to end testing
DeltaFile
+77-0lldb/unittests/Target/TargetGroupTest.cpp
+42-10lldb/include/lldb/Target/TargetGroup.h
+45-0lldb/source/Target/TargetGroup.cpp
+38-0lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+19-0lldb/test/API/accelerator/mock/TestMockAcceleratorActions.py
+19-0lldb/include/lldb/Target/TargetGroupList.h
+240-103 files not shown
+260-179 files

Linux/linux 1021679 — drivers/iommu/arm/arm-smmu-v3 arm-smmu-v3-iommufd.c, drivers/iommu/generic_pt iommu_pt.h

Merge tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd

Pull iommufd updates from Jason Gunthorpe:
 "Several bug fixes, probably found by AI based on the emails:

   - Several edge cases in the self test

   - Reject malformed invalidation commands in case the VMM let them
     through

   - Rework how the invalidation interface works to the drivers to be
     more robust and fix several Sashiko issues

   - Correct several error unwind paths

   - UAF during eventq file release

   - Reject more malformed usage of the dirty tracking by the VMM"


    [16 lines not shown]
DeltaFile
+157-42drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
+79-84drivers/iommu/iommufd/selftest.c
+28-22drivers/iommu/intel/nested.c
+8-22drivers/iommu/generic_pt/iommu_pt.h
+24-2drivers/iommu/iommufd/iova_bitmap.c
+15-10drivers/iommu/iommufd/hw_pagetable.c
+311-1829 files not shown
+379-20215 files

LLVM/project d4d0215 — lldb/include/lldb/Core Module.h, lldb/source/Core Module.cpp

[lldb] Use std::string for Module's ObjectName (#234301)
DeltaFile
+13-14lldb/source/Core/Module.cpp
+6-6lldb/source/Symbol/Symtab.cpp
+6-6lldb/source/Symbol/ObjectFile.cpp
+5-6lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+5-5lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
+4-4lldb/include/lldb/Core/Module.h
+39-4111 files not shown
+60-6017 files

LLVM/project eb5d3e2 — llvm/utils/TableGen/Common CodeGenRegisters.cpp

TableGen: Skip disjoint register classes before intersecting them

inferCommonSubClass intersects the member lists of a register class
with every other class, and most pairs are disjoint. Check that with
the member bit vectors first, which avoids loading the members and
allocating the intersection.

AMDGPU tablegen runs that build the register bank:

            Gigainstructions  Gigacycles     CPU seconds
  Before    576               346            111
  After     573 (-0.6%)       343 (-0.7%)    110 (-0.6%)

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+4-0llvm/utils/TableGen/Common/CodeGenRegisters.cpp
+4-01 files

LLVM/project bfacc3a — llvm/utils/TableGen/Common CodeGenRegisters.h CodeGenRegisters.cpp

TableGen: Compute register sizes once for the sub-register size check

checkSubRegIndexSizes found the size of each register by scanning every
register class for one containing it, about 18 million class membership
tests for AMDGPU. Compute the size of all registers in one pass over
the members of each register class instead, and pass it in.

AMDGPU tablegen runs that build the register bank:

            Gigainstructions  Gigacycles     CPU seconds
  Before    578               355            113
  After     576 (-0.2%)       345 (-2.8%)    110 (-2.4%)

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+26-24llvm/utils/TableGen/Common/CodeGenRegisters.cpp
+3-2llvm/utils/TableGen/Common/CodeGenRegisters.h
+29-262 files

LLVM/project f68fa89 — llvm/utils/TableGen/Common CodeGenRegisters.h CodeGenRegisters.cpp

TableGen: Test register sub-classes with the member bit vectors

computeSubClasses checks whether one register class contains another
for most pairs of classes, by walking both sorted member lists. That
reads every member register, which is slow for AMDGPU's 913 classes.
Each class already has a bit vector of its members, so compare those
instead.

AMDGPU tablegen runs that build the register bank:

            Gigainstructions  Gigacycles     CPU seconds
  Before    596               365            117
  After     577 (-3.1%)       353 (-3.4%)    112 (-3.7%)

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+4-1llvm/utils/TableGen/Common/CodeGenRegisters.cpp
+3-0llvm/utils/TableGen/Common/CodeGenRegisters.h
+7-12 files

LLVM/project 94755de — llvm/utils/TableGen/Common CodeGenRegisters.h CodeGenRegisters.cpp

TableGen: Skip redundant addComposite calls for secondary sub-registers

computeSecondarySubRegs calls addComposite for every index of every new
sub-register, and almost all of these calls repeat a composition that
is already known. For AMDGPU, only about 15000 of 29.8 million calls add
anything. Skip the call if the composition is known and its result has
an offset in every mode, since it would do nothing.

AMDGPU tablegen runs that build the register bank:

            Gigainstructions  Gigacycles     CPU seconds
  Before    603               367            116
  After     595 (-1.3%)       362 (-1.2%)    115 (-1.0%)

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+6-0llvm/utils/TableGen/Common/CodeGenRegisters.cpp
+1-1llvm/utils/TableGen/Common/CodeGenRegisters.h
+7-12 files

LLVM/project 64799a3 — llvm/utils/TableGen/Common CodeGenRegisters.cpp

TableGen: Index registers by sub-register index enum value when inferring sub-classes

inferSubClassWithSubReg groups the members of a register class by each
of their sub-register indices, and looked up every index of every member
in a std::map. Sub-register indices are numbered densely, so use a
vector indexed by enum value instead. Also count the members once
instead of once per index.

AMDGPU tablegen runs that build the register bank:

            Gigainstructions  Gigacycles     CPU seconds
  Before    622               380            120
  After     604 (-3.0%)       367 (-3.4%)    115 (-3.7%)

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+12-16llvm/utils/TableGen/Common/CodeGenRegisters.cpp
+12-161 files

LLVM/project a7ce27b — llvm/utils/TableGen RegisterInfoEmitter.cpp, llvm/utils/TableGen/Common CodeGenRegisters.h CodeGenRegisters.cpp

TableGen: Store super-register class sets as bit vectors

extendSuperRegClasses adds the super-register classes of each register
class's super-classes to its own, by merging their sets. The sets were
DenseSets, so most of the time went to hashing classes that were already
present.

Store the sets as bit vectors instead, so merging is a bitwise or. They
are indexed by a new CreationIndex, since EnumValue isn't assigned until
all classes have been inferred.

AMDGPU tablegen runs that build the register bank:

            Gigainstructions  Gigacycles     CPU seconds
  Before    700               435            135
  After     622 (-11.1%)      381 (-12.5%)   120 (-11.2%)

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+20-12llvm/utils/TableGen/Common/CodeGenRegisters.cpp
+24-5llvm/utils/TableGen/Common/CodeGenRegisters.h
+1-1llvm/utils/TableGen/RegisterInfoEmitter.cpp
+45-183 files

LLVM/project 3df0f7e — llvm/utils/TableGen/Common CodeGenRegisters.h CodeGenRegisters.cpp

TableGen: Avoid binary searches for sub-registers of similar registers

inferMatchingSuperRegClass looks up the sub-register at one index for
every member of a register class. Members of a class almost always have
the same sub-register indices, so the index is usually at the same
position in each member's sorted array. Pass the position found in the
previous member as a hint, and only binary search if it doesn't match.

AMDGPU tablegen runs that build the register bank:

            Gigainstructions  Gigacycles     CPU seconds
  Before    720               442            138
  After     701 (-2.7%)       437 (-1.2%)    137 (-1.2%)

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+8-3llvm/utils/TableGen/Common/CodeGenRegisters.cpp
+6-2llvm/utils/TableGen/Common/CodeGenRegisters.h
+14-52 files

LLVM/project f7a819b — llvm/utils/TableGen/Common CodeGenRegisters.h

Return conflicting compositions from addComposite immediately

Check for an existing composition up front: return a conflicting one
right away, instead of after updating B's ranges from a composition that
isn't recorded. This no longer needs the try_emplace result. The
generated code for all in-tree targets is unchanged, and the instruction
count is the same.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+13-7llvm/utils/TableGen/Common/CodeGenRegisters.h
+13-71 files

LLVM/project 215eb38 — llvm/utils/TableGen/Common CodeGenRegisters.h

TableGen: Look up sub-register index compositions in an array

compose() looked up each composition in a std::map. It is called for
every super-register class set in extendSuperRegClasses, and by
addComposite. Sub-register indices are numbered densely, so also keep
each index's compositions in an array indexed by enum value. For
AMDGPU's 400 indices this is about 1 MB.

AMDGPU tablegen runs that build the register bank:

            Gigainstructions  Gigacycles     CPU seconds
  Before    746               474            148
  After     721 (-3.4%)       446 (-6.1%)    139 (-5.8%)

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+13-6llvm/utils/TableGen/Common/CodeGenRegisters.h
+13-61 files

LLVM/project c9f21d9 — llvm/utils/TableGen/Common CodeGenRegisters.h

Reword the hasSuperRegClass comment to match the other overload

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+2-1llvm/utils/TableGen/Common/CodeGenRegisters.h
+2-11 files

LLVM/project fef84fc — llvm/utils/TableGen RegisterBankEmitter.cpp, llvm/utils/TableGen/Common CodeGenRegisters.h CodeGenRegisters.cpp

TableGen: Skip classes without matching super-register classes in RegisterBankEmitter

visitRegisterBankClasses checks every sub-register index for every pair
of register classes. Skip the per-index loop if RC is not in any of the
class's super-register class sets.

AMDGPU tablegen run for AMDGPUGenRegisterBank.inc:

            Gigacycles     CPU seconds
  Before    51.7           16.0
  After     48.4 (-6.4%)   14.9 (-6.9%)

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+6-0llvm/utils/TableGen/Common/CodeGenRegisters.cpp
+3-0llvm/utils/TableGen/RegisterBankEmitter.cpp
+3-0llvm/utils/TableGen/Common/CodeGenRegisters.h
+12-03 files

LLVM/project 67a773d — llvm/utils/TableGen/Common CodeGenRegisters.cpp

TableGen: Insert super-register class sets in one step (#232816)

extendSuperRegClasses added each super-register class to the composed
index's set with a separate addSuperRegClass call, which looks up the
set in the DenseMap every time. Look up the set once and insert the
whole range.

AMDGPU tablegen runs that build the register bank:

            Gigainstructions  Gigacycles     CPU seconds
  Before    800               491            154
  After     758 (-5.3%)       482 (-1.7%)    151 (-1.9%)

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+1-2llvm/utils/TableGen/Common/CodeGenRegisters.cpp
+1-21 files

LLVM/project aeb1582 — llvm/utils/TableGen/Common CodeGenRegisters.h

TableGen: Return early from addComposite for known compositions (#232815)

computeComposites calls addComposite for each pair of sub-registers of
every register with a distinct sub-register structure, so most calls
repeat a composition that is already known. Each call still did three
std::map lookups per hardware mode to update the sub-register ranges.
If the composition already exists and its result has an offset in every
mode, the rest of the function has no effect, so return early. Cache
whether the result has an offset in every mode, since offsets are never
cleared once set.

AMDGPU tablegen runs that build the register bank:

            Gigainstructions  Gigacycles     CPU seconds
  Before    918               541            169
  After     800 (-12.8%)      491 (-9.3%)    154 (-8.8%)

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+21-1llvm/utils/TableGen/Common/CodeGenRegisters.h
+21-11 files

LLVM/project f1621eb — libcxx/docs ReleaseNotes.rst

[libc++][docs] Remove stale release notes from toctree (#234792)

#234169 deleted the release notes for LLVM 20, 21 and 22 but left them
listed in the hidden toctree in `ReleaseNotes.rst`. This results in
Sphinx doc build warnings, which show up as permerge failures.

Remove the three stale toctree entries to fix the doc build warnings.

LLM-aided
DeltaFile
+0-3libcxx/docs/ReleaseNotes.rst
+0-31 files

LLVM/project f0d79af — llvm/lib/CodeGen/SelectionDAG LegalizeDAG.cpp, llvm/lib/Target/LoongArch LoongArchFloat32InstrInfo.td LoongArchISelLowering.h

SelectionDAG: Build FP immediates from integer bits in the legalizer

Teach the generic legalizer to legalize FP immediates as a bitcast of
an opaque integer constant. Migrate LoongArch to use the new helper
instead of doing it in custom lowering.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+33-34llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+25-15llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+5-0llvm/lib/Target/LoongArch/LoongArchISelLowering.h
+2-2llvm/lib/Target/LoongArch/LoongArchFloat32InstrInfo.td
+65-514 files

LLVM/project 624b895 — llvm/lib/Analysis ScalarEvolution.cpp, llvm/test/Transforms/IndVarSimplify implied-nonneg-from-unsigned-bound.ll implied-nonneg-from-unsigned-bound-swapped.ll

[SCEV] Derive x >=s 0 from x <u y and y <=u 2^(n-1) (#231631)

Let `n` be the bit width of `x` and `y`.  
If `x <u y` and `y <=u 2^(n-1)`, then `x <u 2^(n-1)`, so `x >=s 0`.  
Here `y <=u 2^(n-1)` means `y >=s 0` or `y == INT_MIN`.  
In the same way, if `x <=u y` and `y <u 2^(n-1)`, then `x >=s 0`.

This lets a guard like `x <u len` prove `x >=s 0` when `len` is
non-negative.

First, we prove the `x >=s 0` fact, and then try to imply the fact that
SCEV was asked about from this fact.
This is to allow implication of weaker bounds, e.g. `x >=s c, c <= 0`.

`y` is checked via ranges only, to keep compile time low.

Alive2 check - [link](https://alive2.llvm.org/ce/z/RScq69).

---------

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+1,185-0llvm/test/Transforms/IndVarSimplify/implied-nonneg-from-unsigned-bound-swapped.ll
+275-0llvm/test/Transforms/IndVarSimplify/implied-nonneg-from-unsigned-bound.ll
+21-0llvm/lib/Analysis/ScalarEvolution.cpp
+1,481-03 files

LLVM/project 09d21f1 — llvm/include/llvm/Analysis ScalarEvolution.h, llvm/lib/Analysis ScalarEvolution.cpp

[SCEV] Prove signed/unsigned implications in either operand order (#234208)

SCEV could prove these implications only with the operands in the same
order:
- If `a <u b` and `a`, `b` have the same sign, then `a <s b`.
- If `a <s b` and `a`, `b` have the same sign, then `a <u b`.
- If `a <u b` and `b >=s 0`, then `a <s b`.
- If `a <s b` and `b <s 0`, then `a <u b`.

For example, it proved `a <s b` from `a <u b` and `b >=s 0`, but not `b
>s a`.

Now it proves them in either order.

---------

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+149-0llvm/test/Transforms/IndVarSimplify/implied-cond-different-signedness.ll
+46-40llvm/lib/Analysis/ScalarEvolution.cpp
+8-0llvm/include/llvm/Analysis/ScalarEvolution.h
+203-403 files

LLVM/project 1ebe9b9 — mlir/lib/Conversion/GPUCommon GPUToLLVMConversion.cpp, mlir/test/Conversion/GPUCommon lower-alloc-to-gpu-runtime-calls.mlir

[mlir][gpu] Fix address space casts in gpu.alloc/gpu.dealloc lowering (#234394)
DeltaFile
+19-0mlir/test/Conversion/GPUCommon/lower-alloc-to-gpu-runtime-calls.mlir
+6-1mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp
+25-12 files

LLVM/project 6aaeed0 — llvm/lib/Target/LoongArch LoongArchMergeBaseOffset.cpp, llvm/test/CodeGen/LoongArch merge-base-offset-fold-large-offset-debug.mir

[LoongArch] Ignore debug uses when folding large offsets (#230290)

A `DBG_VALUE` can currently make `foldLargeOffset` reject an otherwise
foldable offset because the pass uses `hasOneUse()`. As a result,
equivalent MIR with and without debug information can produce different
instruction sequences.

Use `hasOneNonDBGUse()` for the profitability check. Since the fold
erases the offset-producing instructions, mark their debug users undef
before erasing them.

The new MIR test covers the case where a large offset has one ordinary
use and one debug use. Without the change, the offset remains
materialized with `LU12I_W` and `ADD_W`; with the change, it is folded
into `PCADDU12I` and `ADDI_W`, and the invalidated `DBG_VALUE` uses
`$noreg`. The checks were generated with
`utils/update_mir_test_checks.py`.

Tests: `check-llvm-codegen-loongarch` (958 passed), `git clang-format

    [3 lines not shown]
DeltaFile
+46-0llvm/test/CodeGen/LoongArch/merge-base-offset-fold-large-offset-debug.mir
+5-2llvm/lib/Target/LoongArch/LoongArchMergeBaseOffset.cpp
+51-22 files