LLVM/project 79e9d33llvm/lib/Analysis LoopAccessAnalysis.cpp, llvm/test/Analysis/LoopAccessAnalysis int64-min-stride.ll

[LAA] Avoid std::abs(INT64_MIN) signed-overflow UB in stride scaling. (#215640)

getDependenceDistanceStrideAndSize scaled the strides via
std::abs(StridePtrInt), which is UB for INT64_MIN. Use
llvm::AbsoluteValue, which negates in the unsigned domain.

Fixes an UBSan failure for the added test case.
DeltaFile
+40-0llvm/test/Analysis/LoopAccessAnalysis/int64-min-stride.ll
+3-2llvm/lib/Analysis/LoopAccessAnalysis.cpp
+43-22 files

LLVM/project ae07052llvm/include/llvm/TargetParser AMDGPUTargetParser.h, llvm/lib/Target/AMDGPU GCNProcessors.td

[AMDGPU] Move EU and Wave Queries into TargetParser

Change-Id: Iea2ec6bca713b89f5309a701fef6837b9b9c3270
DeltaFile
+71-0llvm/lib/Target/AMDGPU/GCNProcessors.td
+12-37llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+36-0llvm/unittests/TargetParser/TargetParserTest.cpp
+23-0llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+18-0llvm/test/TableGen/AMDGPUTargetDefErrors.td
+12-0llvm/include/llvm/TargetParser/AMDGPUTargetParser.h
+172-377 files not shown
+193-5313 files

LLVM/project fba7f95llvm/lib/Target/NVPTX NVPTXPassRegistry.def NVPTXTargetMachine.cpp

[NVPTX] Add NewPM boilerplate to NVPTXProxyRegErasure (#215336)
DeltaFile
+38-27llvm/lib/Target/NVPTX/NVPTXProxyRegErasure.cpp
+9-2llvm/lib/Target/NVPTX/NVPTX.h
+2-2llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
+1-0llvm/lib/Target/NVPTX/NVPTXPassRegistry.def
+50-314 files

LLVM/project f3eaf3blibc/config/linux/arm entrypoints.txt

test: arm
DeltaFile
+1-0libc/config/linux/arm/entrypoints.txt
+1-01 files

LLVM/project dce48c9llvm/lib/Target/RISCV RISCVCodeGenPassBuilder.cpp RISCVOptWInstrs.h, llvm/test/CodeGen/RISCV O3-newpm-pipeline.ll O1-newpm-pipeline.ll

[RISCV] Port Opt W Instrs to NewPM

Assisted-by: AI
DeltaFile
+44-22llvm/lib/Target/RISCV/RISCVOptWInstrs.cpp
+35-0llvm/lib/Target/RISCV/RISCVOptWInstrs.h
+3-3llvm/lib/Target/RISCV/RISCVCodeGenPassBuilder.cpp
+4-0llvm/test/CodeGen/RISCV/prefer-w-inst.mir
+2-1llvm/test/CodeGen/RISCV/O3-newpm-pipeline.ll
+2-1llvm/test/CodeGen/RISCV/O1-newpm-pipeline.ll
+90-277 files not shown
+97-3113 files

LLVM/project 8aa75callvm/lib/Target/RISCV RISCV.h RISCVTargetMachine.cpp, llvm/test/CodeGen/RISCV fold-mem-offset.mir

[RISCV] Port Fold Memory Offset Pass to NewPM

Assisted-by: AI
DeltaFile
+37-16llvm/lib/Target/RISCV/RISCVFoldMemOffset.cpp
+36-0llvm/lib/Target/RISCV/RISCVFoldMemOffset.h
+0-3llvm/lib/Target/RISCV/RISCV.h
+2-1llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+2-1llvm/lib/Target/RISCV/RISCVCodeGenPassBuilder.cpp
+1-0llvm/test/CodeGen/RISCV/fold-mem-offset.mir
+78-213 files not shown
+81-219 files

LLVM/project a3e6d21llvm/lib/Target/RISCV RISCV.h RISCVTargetMachine.cpp, llvm/test/CodeGen/RISCV/rvv vmv.v.v-peephole.mir

[RISCV] Port Vector Peephole to NewPM

Assisted-by: AI
DeltaFile
+66-44llvm/lib/Target/RISCV/RISCVVectorPeephole.cpp
+39-0llvm/lib/Target/RISCV/RISCVVectorPeephole.h
+0-3llvm/lib/Target/RISCV/RISCV.h
+2-1llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+2-1llvm/lib/Target/RISCV/RISCVCodeGenPassBuilder.cpp
+2-0llvm/test/CodeGen/RISCV/rvv/vmv.v.v-peephole.mir
+111-497 files not shown
+119-4913 files

LLVM/project c45dbf3llvm/lib/Target/RISCV RISCVTargetMachine.cpp RISCVCodeGenPassBuilder.cpp, llvm/test/CodeGen/RISCV/rvv vl-opt.mir

[RISCV] Port VL Optimizer to NewPM

Assisted-by: AI
DeltaFile
+56-31llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
+36-0llvm/lib/Target/RISCV/RISCVVLOptimizer.h
+1-3llvm/lib/Target/RISCV/RISCV.h
+2-1llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+2-1llvm/lib/Target/RISCV/RISCVCodeGenPassBuilder.cpp
+1-0llvm/test/CodeGen/RISCV/rvv/vl-opt.mir
+98-363 files not shown
+101-369 files

LLVM/project 24fdf76llvm/lib/Target/RISCV RISCV.h RISCVTargetMachine.cpp, llvm/test/CodeGen/RISCV/rvv fixed-vectors-strided-load-store.ll

[RISCV] Port Gather/Scatter Lowering to NewPM

This also adds some missing pass dependencies to the legacy version of
the pass, to reflect needed analyses.

Assisted-by: AI
DeltaFile
+77-48llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
+40-0llvm/lib/Target/RISCV/RISCVGatherScatterLowering.h
+0-3llvm/lib/Target/RISCV/RISCV.h
+2-1llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+2-1llvm/lib/Target/RISCV/RISCVCodeGenPassBuilder.cpp
+2-0llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-load-store.ll
+123-535 files not shown
+129-5311 files

LLVM/project 540aaf1flang/test/Evaluate fold-transfer-partial.f90

[flang] Add TRANSFER folding value tests for MOLD longer than SOURCE (#213573)

Constant folding of TRANSFER has value tests for same-size and
mold-shorter cases (flang/test/Evaluate/fold-transfer.f90) and shape
tests (folding10.f90), but nothing pins the result values when the
physical representation of the result is longer than SOURCE's. F2023
16.9.212 p.5 makes the leading part normative (including the
TRANSFER(TRANSFER(E,D),E) round-trip identities), and the Examples
paragraph's Case (ii) pins a partially covered trailing array element;
flang zero-fills the processor-dependent remainder (scalar, array,
derived, and CHARACTER molds, including derived-type components wholly
beyond SOURCE's representation).

All checks are byte-order independent: round trips prove leading-part
placement, and the two-endian .or. checks (the fold-transfer.f90
test_c2i_s idiom) are portable value/zero-fill pins.

These tests pass at head; their purpose is to guard these semantics
through upcoming refactoring of the Evaluate library's scalar

    [3 lines not shown]
DeltaFile
+83-0flang/test/Evaluate/fold-transfer-partial.f90
+83-01 files

LLVM/project 1c79787clang/docs ReleaseNotes.md, clang/lib/Sema SemaExprCXX.cpp

[Clang] Implement CWG 2282 (#215157)

Link: https://wg21.link/cwg2282

For non-over-aligned types, overload resolution now falls back to
aligned allocation functions.
DeltaFile
+22-9clang/lib/Sema/SemaExprCXX.cpp
+26-0clang/test/CXX/drs/cwg22xx.cpp
+12-2clang/test/SemaCXX/std-align-val-t-in-operator-new.cpp
+4-4clang/test/CXX/expr/expr.unary/expr.new/p14.cpp
+3-0clang/docs/ReleaseNotes.md
+1-1clang/www/cxx_dr_status.html
+68-162 files not shown
+70-188 files

FreeBSD/src 3e67b90sys/dev/sound/usb uaudio.c, sys/dev/usb usbdevs

snd_uaudio: Define USB IDs in usbdevs

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
DeltaFile
+67-67sys/dev/sound/usb/uaudio.c
+53-0sys/dev/usb/usbdevs
+120-672 files

FreeBSD/src f4bf1dasys/dev/ixgbe ixgbe_phy.c

ixgbe: Avoid a signed shift while assembling the PHY ID

The PHY identifier word is promoted to signed int when the cast is
applied after the shift.  Cast the 16-bit register value first so
identifiers with their high bit set are assembled as unsigned data.

MFC after:      2 weeks
DeltaFile
+1-1sys/dev/ixgbe/ixgbe_phy.c
+1-11 files

FreeBSD/src 13a7470sys/dev/e1000 e1000_phy.c e1000_ich8lan.c

e1000: Avoid signed shifts while assembling PHY IDs

PHY identifier words are promoted to signed int when the cast is applied
after the shift.  Cast each 16-bit register value first so identifiers
with their high bit set are assembled as unsigned data.

MFC after:      2 weeks
DeltaFile
+1-1sys/dev/e1000/e1000_phy.c
+1-1sys/dev/e1000/e1000_ich8lan.c
+1-1sys/dev/e1000/e1000_82571.c
+3-33 files

FreeBSD/src baa6e3asys/dev/ixgbe ixgbe_common.c

ixgbe: Avoid a signed shift while assembling the PBA number

The EEPROM word is promoted to signed int before the left shift when
the cast is applied to the complete expression.  Cast the word first so
all 16-bit values are shifted as unsigned data.

This is the ixgbe counterpart of the e1000 correction imported from
DPDK commit b932270c66.

MFC after:      2 weeks
DeltaFile
+1-1sys/dev/ixgbe/ixgbe_common.c
+1-11 files

FreeBSD/src 1121aaasys/dev/igc igc_phy.c

igc: Check PHY control register reads

Do not modify a zero-initialized PHY control value when its preceding
read failed.  Leave the PHY unchanged when the void power helpers cannot
read its current state.

This follows the defensive checks added to the corresponding e1000
helpers.

MFC after:      2 weeks
DeltaFile
+12-2sys/dev/igc/igc_phy.c
+12-21 files

FreeBSD/src f5fd839sys/dev/igc igc_phy.c

igc: Avoid a signed shift while assembling the PHY ID

The PHY identifier word is promoted to signed int when the cast is
applied after the shift.  Cast the 16-bit register value first so
identifiers with their high bit set are assembled as unsigned data.

MFC after:      2 weeks
DeltaFile
+1-1sys/dev/igc/igc_phy.c
+1-11 files

FreeBSD/src 13d78e4sys/dev/igc if_igc.c

igc: Export EEE Low Power Idle counters

The driver already accumulates the clear-on-read transmit and receive
LPI event counters.  Expose the 64-bit totals under the per-device eee
sysctl node.

MFC after:      2 weeks
DeltaFile
+10-2sys/dev/igc/if_igc.c
+10-21 files

FreeBSD/src bbdd3c4sys/dev/ixgbe ixgbe_type.h

ixgbe: Avoid signed overflow in LED register masks

LED index three shifts the blink bit into bit 31.  Convert the base to
the register width before shifting so the operation is unsigned.

This is the ixgbe counterpart of the e1000 correction imported from
DPDK commit 214cb0d7f1.

MFC after:      2 weeks
DeltaFile
+1-1sys/dev/ixgbe/ixgbe_type.h
+1-11 files

FreeBSD/src f7427f8sys/dev/ixl ixl_pf_main.c

ixl: Avoid a signed PHY capability shift

The PHY capability display examines all 32 bits of the firmware bitmap.
Use an unsigned value so examining bit 31 does not shift a signed
integer into its sign bit.

MFC after:      2 weeks
DeltaFile
+1-1sys/dev/ixl/ixl_pf_main.c
+1-11 files

FreeBSD/src 392fbdcsys/dev/e1000 e1000_82571.c

e1000: Avoid a signed manageability VLAN bitmap shift

A manageability VLAN can select bit 31 of its VFTA register.  Use an
unsigned value when constructing the register mask.

MFC after:      2 weeks
DeltaFile
+1-1sys/dev/e1000/e1000_82571.c
+1-11 files

FreeBSD/src bf6feffsys/dev/ixgbe ixgbe_mbx.c ixgbe_82598.c

ixgbe: Use unsigned register bitmap shifts

VLAN, VMDq, and VF reset bit indices can reach 31.  Use unsigned
values when constructing their 32-bit register masks so the shifts do
not operate on signed integers.

MFC after:      2 weeks
DeltaFile
+9-9sys/dev/ixgbe/ixgbe_common.c
+3-3sys/dev/ixgbe/ixgbe_82598.c
+2-2sys/dev/ixgbe/ixgbe_mbx.c
+14-143 files

FreeBSD/src 275ca86sys/dev/igc igc_mac.c

igc: Avoid a signed multicast bitmap shift

The multicast hash bit can be 31.  Use an unsigned value so setting the
bit cannot shift a signed integer into its sign bit.

MFC after:      2 weeks
DeltaFile
+1-1sys/dev/igc/igc_mac.c
+1-11 files

FreeBSD/src a86d65bsys/dev/e1000 e1000_mac.c

e1000: Avoid a signed multicast bitmap shift

The multicast hash bit can be 31.  Use an unsigned value so setting the
bit cannot shift a signed integer into its sign bit.

MFC after:      2 weeks
DeltaFile
+1-1sys/dev/e1000/e1000_mac.c
+1-11 files

FreeBSD/src b1da641sys/dev/e1000 e1000_82571.c

e1000: Preserve errors while disabling D0 LPLU

Return a PHY write failure immediately when disabling D0 low-power
link-up on 82571-family controllers.

MFC after:      2 weeks
DeltaFile
+2-0sys/dev/e1000/e1000_82571.c
+2-01 files

FreeBSD/src 505e6bbsys/dev/e1000 e1000_vf.c

igbv: Accept reset NACKs when no MAC is assigned

A reset NACK from a Linux PF means that the reset completed but no
permanent MAC address was assigned.  Treat that response as a
successful reset with a zero permanent address so attach can generate
a local address instead of retrying a live mailbox.

FreeBSD PFs also use a one-dword reset NACK while retained queues are
being sanitized.  Seed the otherwise unused request payload and accept
only the three-dword, zero-filled NACK used by Linux, preserving the
FreeBSD retry contract.

MFC after:      2 weeks
DeltaFile
+21-6sys/dev/e1000/e1000_vf.c
+21-61 files

FreeBSD/src cba56bcsys/dev/igc igc_mac.c

igc: fix MAC address hash bit shift

DPDK commit message

net/e1000/base: fix MAC address hash bit shift

In e1000_hash_mc_addr_generic() the expression:

"mc_addr[4] >> 8 - bit_shift", right shifting "mc_addr[4]"

shift by more than 7 bits always yields zero, so hash becomes not so
different. Add initialization with bit_shift = 1, and add a loop
condition to ensure bit_shift will be always in [1..8] range.

Fixes: af75078fece3 ("first public release")
Cc: stable at dpdk.org

Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>

    [4 lines not shown]
DeltaFile
+2-2sys/dev/igc/igc_mac.c
+2-21 files

FreeBSD/src 5587cb1sys/dev/igc igc_phy.c

igc: fix iterator type

DPDK commit message

net/e1000/base: fix iterator type

Fix static analysis warning about comparison between types of
incompatible width, which might lead to an infinite loop due to
overflow.

Fixes: af75078fece3 ("first public release")
Cc: stable at dpdk.org

Signed-off-by: Amir Avivi <amir.avivi at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>

Obtained from:  DPDK (3d36053991)
MFC after:      2 weeks
DeltaFile
+2-1sys/dev/igc/igc_phy.c
+2-11 files

FreeBSD/src a09034dsys/dev/e1000 e1000_vf.c e1000_mac.c

e1000: fix data type in MAC hash

DPDK commit message

net/e1000/base: fix data type in MAC hash

One of the bit shifts in MAC hash calculation triggers a static analysis
warning about a potential overflow. Fix the data type to avoid this.

Fixes: af75078fece3 ("first public release")
Cc: stable at dpdk.org

Signed-off-by: Barbara Skobiej <barbara.skobiej at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>

Obtained from:  DPDK (458734aaac)
MFC after:      2 weeks
DeltaFile
+4-2sys/dev/e1000/e1000_vf.c
+4-2sys/dev/e1000/e1000_mac.c
+8-42 files

FreeBSD/src 8704d29sys/dev/ixgbe ixgbe_common.c

ixgbe: Avoid a signed multicast bitmap shift

The multicast vector bit can be 31.  Use an unsigned value so setting
the bit cannot shift a signed integer into its sign bit.

MFC after:      2 weeks
DeltaFile
+1-1sys/dev/ixgbe/ixgbe_common.c
+1-11 files