[Mips] Use a proper boolean for the select condition in lowerShift*Parts (#241685)
lowerShiftLeftParts and lowerShiftRightParts used (and Shamt, VT.bits)
directly as the condition of ISD::SELECT. That value is 0 or VT.bits
(32, or 64 for i128 on MIPS64), not 0/1. Since MIPS uses
ZeroOrOneBooleanContent, DAG combines may treat the condition as a 0/1
value, e.g. folding select(c, 0, 1) into xor c, 1, which miscompiles
when the condition is 32. For example 0x1FFFFFFFF >> (b & 32) returned
0x2100000001 instead of 1 for b = 32 on MIPS32.
Compare the masked shift amount against zero with setcc ne to form the
select condition. The DOUBLE_SELECT_I/DOUBLE_SELECT_I64 path used for
pre-MIPS4/MIPS32 in lowerShiftRightParts branches on the value being
non-zero, so it keeps using the masked shift amount directly.
Fixes #235261
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[GlobalISel] Ignore debug uses in direct single-use combines (#237643)
Debug uses can block the lshr/trunc and insert-vector chain combines in
`CombinerHelper`, making ordinary Machine IR depend on debug
information.
This patch counts only non-debug uses and uses a non-debug iterator when
retrieving the insert-vector user. The regression tests cover both
combines and fail without the change.
These direct `MRI.hasOneUse()` checks are not covered by #237070, which
changes the `m_OneUse` matcher.
This issue was found through a source audit. AI assisted with the
analysis and development of the fix.
check that the interface being paired is a pair(4) before fiddling with it
before this it was looking into the pair_softc of the new interface
before making sure it was a pair(4) first.
ok mvs@
use if_drvid to ensure pair is only paired with other pair ifaces
this was doing some complicated stuff with if_clone_lookup and
strcmp to get the same result, but this is a lot simpler.
ok mvs@ as part of a larger diff.
use if_drvid to identify vport interface instances.
veb treats vports specially, so it needs a way to identify which
interfaces are backed by the vport driver, which is what if_drvid
provides. this replaces using an ifnet function pointer to imply
which driver backs an interface, which is brittle.
ok mvs@ as part of a bigger diff.
use if_drvid to ensure rports are only paired with rports.
i was using the if_enqueue function point for this, but i want to
replace if_enqueue with a more generic function in the future which
would break this.
part of a larger diff that was ok mvs@
add a void *if_drvid to ifnet so drivers can supply an opaque id.
there's a few places where specific drivers need to know if another
interface is backed by the same driver. at the moment they abuse a
function pointer to check this, but that's brittle because things like
trunks and bridges fiddle with function pointers on their port
interfaces to mask certain behaviours.
this adds a dedicated driver settable identifier for this purpose
instead, and then uses it in the appropriate drivers. a driver can
point this at anything it wants to act as an identifier.
this started out because i was looking at replacing rport_enqueue
with a generic function provided by if.h, which would break using
it to identify instances of rport(4).
ok mvs@
[SPIR-V] Legalize G_PHI of a vector of pointers (#241166)
With `SPV_INTEL_masked_gather_scatter`, vectors of pointers are legal
types and `G_IMPLICIT_DEF`/`G_FREEZE` already accept them, but `G_PHI`
did not, so a PHI of `<N x ptr>` failed with "unable to legalize
instruction". The SLP vectorizer forms such PHIs from vectorized address
computations. This adds the same pointer-vector rule to `G_PHI`.
Assisted-by: Claude Opus 5.5
stop reporting ifmedia on virtual interfaces.
showing "media: Ethernet autoselect" on virtual interfaces is
unecessary. the important thing is link state, which is reported
via if_link_state on the interface itself.
ok miod@ mvs@