[APFloat] Fix sign bit corrupting exponent in unsigned FP8 formats (#223286)
`convertIEEEFloatToAPInt` unconditionally ORs the sign bit into the top
bit of the encoded value. `Float8E8M0FNU` and `Float8E5M3FNU` have no
sign bit (`hasSignedRepr = false`), so that top bit actually belongs to
the exponent field. Encoding a value with sign set therefore corrupts
the exponent, in one case colliding with the reserved NaN bit pattern.
Guard the OR with `hasSignedRepr`, matching the existing check in the
decode path (`initFromIEEEAPInt`).
Extend `ConvertLosesUnrepresentableSignAndZero` to also check
`bitcastToAPInt()` after dropping an unrepresentable sign, using `-1.0`
instead of `-2.0` so the corruption is actually visible in the bits.
[ValueTracking] Make `getUnderlyingObjectsForCodegen()` preserve unidentified objects (#224584)
In some situations, it is useful to inspect the underlying objects of a
memory operation, even if they may alias with one another. A concrete
example comes from the approach to schedule DAG construction I've been
developing (see #205689) where these objects are used to infer that a
class of control dependencies between memory operations is redundant,
whereby eliminating the compile time cost of recording them. Update
`getUnderlyingObjectsForCodegen()` to return these objects.
Split from https://github.com/llvm/llvm-project/pull/205689
[MachineScheduler](NFC) Remove separate handling for non-alias loads and stores (#224310)
The separate handling of non-alias loads and stores was always extra
complexity with no pay off. Remove this.
Split from #205689
WebAssembly: Don't duplicate implicit CALL operands in LowerCallResults
When recombining the CALL_PARAMS/CALL_RESULTS pseudo-pair into a real CALL,
LowerCallResults copied CallParams.uses() onto the new instruction. uses()
includes the implicit operands (implicit-def $arguments and the implicit
$sp32/$sp64 uses), which the freshly created CALL already carries. This
resulted in a duplicated implicit-def of $arguments. This avoids a future
verifier error.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
Reapply "[SelectionDAG] Recurse through mask expression trees in WidenVSELECTMask" (#217307)
WidenVSELECTMask currently handles only two mask shapes: a bare SETCC
or a single AND/OR/XOR of exactly two SETCCs. Anything deeper bails out
to the generic condition widening path, which often introduces
unnecessary narrow/widen roundtrips (xtn+sshll on AArch64,
packssdw+vpmovsxwd on X86).
Replace the hand-coded cases with a recursive widenMaskTree that walks
through SETCC, AND/OR/XOR, FREEZE, VECTOR_SHUFFLE, SELECT/VSELECT, and
all-ones/all-zeros BUILD_VECTORs.
I had to revert #188085 earlier this year. This PR resolves the flagged
issue and cleans up suggested approach to avoid that class of potential
errors.
[Mips] Introduce ABI-specific register names and accessors (#224284)
To accommodate the P32/P64 ABIs, we need to separate machine registers
from ABI register names and calling-convention roles. The existing
register IDs use OABI names, even when another ABI assigns a different
role to the same physical register.
As a first step, describe OABI, NABI and PABI names with
RegAltNameIndices. Extend TableGen's AsmMatcherEmitter with the opt-in
ShouldEmitMatchRegisterAltNameWithIndex flag, which generates
MatchRegisterAltName(StringRef, unsigned AltIdx). It matches only names
associated with the selected index, allowing the same spelling to
identify different registers across ABIs.
Use the indexed matcher in shared MIPS register lookup for the assembler
and named-register lowering, retaining compatibility aliases and
diagnostics for deprecated spellings.
Add ABI accessors for argument, temporary, saved and return registers,
[2 lines not shown]
[SLP]Pass operand info and context to TTI cost queries
Feed operand value info, the context instruction, cast context hints,
and the actual select condition predicate to the TTI cost queries, so
target discounts that depend on them (fused fmul/fma pricing, folded
read-modify-write, constant or uniform operands) apply to both scalar
and vector sides of the SLP cost model. Also make the reversed-store
query describe the stored value instead of the pointer, per the
getMemoryOpCost contract.
Assisted-by: Cursor
Reviewers: RKSimon, bababuck
Pull Request: https://github.com/llvm/llvm-project/pull/224931
AArch64: Don't duplicate the branch's implicit defs in call pseudo expansion
These pseudo expansions started with an implicit LR def and are replaced with a
new instruction with a different LR def. Previously this would copy the old
instruction's operand list, merging with the newly build instruction def list.
Avoid creating a redundant def with inconsistent dead flags. This avoids failing
a future verifier check.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
ARM: Don't duplicate the LR def when expanding call pseudos
Several pseudo expansions in ARMExpandPseudoInsts built a real call and
then copied the pseudo's operands onto the new instruction. Each of these
call opcodes declares LR as an implicit-def, but the original instruction
already had that. The original def may have been marked as dead, so the result
would be a redundant operand with an inconsistent dead flag. This avoids
a failure in a future verifier check.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[MLIR][NFC] Drop sentinel leftovers from DenseMapInfo<Remark> (#224612)
`DenseMap` no longer uses sentinel keys, and the `getEmptyKey` and
`getTombstoneKey` members of `DenseMapInfo<Remark>` were removed in
#200633 and #201991. Two leftovers stayed behind, the `"<EMPTY_KEY>"`
comparison at the top of `isEqual` and the static dummy `MLIRContext`
that used to back the sentinel remarks.
The comparison is also wrong. A remark literally named `<EMPTY_KEY>`
compares unequal to any other remark, including one with a matching
hash, which breaks the hash and equality contract. This change removes
both leftovers and adds a comment saying what the specialization
compares, which is location, remark name, combined category name and
kind.
No behaviour change for any remark with a normal name. Existing Remark
unit tests and `mlir/test/Pass/remark-final.mlir` cover the
specialization through `RemarkEmittingPolicyFinal`.
Assisted-by: Claude Code (Claude Fable 5.1).
snd_hdsp*: malloc(9) with M_WAITOK
Perform the allocations outside the lock section so that we can use
M_WAITOK. Holding the lock here is actually not really necessary and we
could just as well remove it, but keep it for consistency.
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D59079
(cherry picked from commit b5c1ab6c8f2811278b801084713a6618f3b783d3)
snd_dummy: Bump primary channel count
Makes it easier to test scenarios involving more than 1 primary channels
per direction.
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D59085
(cherry picked from commit 358fe149f591028945a8e5a51dff9121a2358c85)
sound: Prefer idle primary channels when allocating
dsp_chn_alloc() stopped at the first primary channel that was either
idle or already had vchans. Since the list is walked in order, the first
channel matched both conditions once it had been used, so every client
after the first was stacked onto it as a vchan and the remaining primary
channels were never allocated at all.
This is invisible on devices with a single primary channel, but not on
those which provide several. snd_emu10kx(4), for instance, registers
four primary channels for its front device, each able to run with its
own rate.
Look for an idle primary channel first, and only fall back to sharing
one that already has vchans when there is none left.
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: markj
[3 lines not shown]
Hexagon: Don't duplicate the PC def when converting a return to L4_return
When replacing a PS_jmpret return with L4_return in the epilogue, the code built
L4_return which automatically inserted pc and r29 implicit-defs. This then copied
the original return's implicit operands, duplicating the overlapped pc operand
(which also would have inconsistent dead flags). Also update a few mir test inputs
which demonstrate the duplicated operand pattern.
This avoids a future verifier check failure.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[llvm-dwarfdump][LineCov] Add --variable-coverage-maybe-undefined option (#220855)
This patch adds a `--variable-coverage-maybe-undefined` flag to
llvm-dwarfdump as part of the recently implemented feature that measures
DWARF coverage of local variables in terms of source lines. This causes
the IR-level analysis to consider variables live if they are defined on
any path, and therefore include lines where the variable may be
undefined. By default, variables must be defined on all paths to be
counted.
Additionally, it includes fixes for a few issues found by @SLTozer and
myself after merging the previous patches:
- Variables not present in the DWARF information that appear in the
baseline are now included in the output.
- The assertion that there are no `undef`/`poison` variable locations in
the IR has been removed, as in some circumstances it is possible to have
a `#dbg_declare(poison)` at `-O0`.
- A small error where entries were inserted into the file name map while
iterating through it has been fixed.
tests/ipsec/t_ipsec_policy.c -- appease clang
Cast to (void) not (void *) to explicitly ignore a function return
value, even though that value is a pointer.
Might fix the clang builds (should go part way at least).
[X86] Prefer sub-of-not for vector inc-of-add (#207695)
Avoids lengthening the dependency chain for vector conditional
increments by preferring sub-of-not for vectors. Keeps existing
inc-of-add for scalars.
Fixes #167441
[flang][cuda] Record implicit managed attribution in module files
An attribute the compiler applied under -gpu=mem:managed is written into the
module file the same way a user-written one is, so a reader cannot tell them
apart. It then treats the attribute as a user requirement: allocating such a
component in a DEVICE object is rejected, and the memory space the user did
ask for on the object no longer wins.
Spell the distinction in the module file as MANAGED(IMPLICIT), modelled on
INTENT(IN): CUDA-data-attr gains an optional parenthesized qualifier, carried
by a new CUDADataAttrSpec parse-tree node in AttrSpec and ComponentAttrSpec.
ATTRIBUTES(...) keeps the bare attribute, so the qualifier cannot be written
there.
The attribute itself is still written out, so a component keeps the same
memory space no matter which options a consumer is compiled with.
Also stop an implicitly applied attribute from making a module a definer of
CUDA symbols. Without this, adding -gpu=mem:managed to a module's build
rejects its OpenACC-only consumers over an attribute the user never wrote.
system: revert latest service widget changes
As discussed internally there are no more complaints and this makes
it a bit harder to see the status at first glance, especially for the
color blind. Let's try to not tempt fate any more than we already
have on the subject.
This reverts commit f2815fabed8e5f1b2ebc3a8ff98df867082256e9.
This reverts commit 73e154151b724a7bca4125d6a9b757001a53dbcf.
[MLIR][OpenMP] Support for dispatch construct with clauses nocontext & novariants (#215877)
Support for dispatch construct with clauses nocontext & novariants clauses in MLIR
This patch adds the omp.dispatch operation to the OpenMP dialect, along
with the nocontext and novariants clauses, the verifier, and LLVM IR
translation. It is limited to the MLIR layer. Flang lowering follows in
later patches.
Part 1 of 3 of the !$omp dispatch support.
This is derived from
[203320](https://github.com/llvm/llvm-project/pull/203320) (split into 3
parts).
This also Fixes[
#203317](https://github.com/llvm/llvm-project/issues/203317)
---------
Co-authored-by: Sunil Kuravinakop <kuravina at pe31.hpc.amslabs.hpecorp.net>
Do not unzoom when resizing a floating pane that was created with -A.
Similarly, skip hidden floating panes when changing Z order. Reported by Clark
Wang.
[llvm] Adjust remaining LLVM_ABI annotation issues (#224619)
Following up from #224293. Some annotations cannot be automatically
adjusted by the ids-check-helper and idt:
* Only headers under llvm/include are parsed. Source files and internal
headers are not.
* Headers are parsed in release mode, so debug-only declarations are
invisible.
* idt ignores private declarations.
These were found while performing a dylib build on Windows.
The effort to build LLVM as a dylib is tracked in #109483.