[M68k] Use UADDO_CARRY/USUBO_CARRY instead of ADDC/ADDE/SUBC/SUBE.
Type legalization now expands wide add/sub using UADDO/USUBO and
UADDO_CARRY/USUBO_CARRY, which are lowered to M68kISD::ADD/SUB and
M68kISD::ADDX/SUBX with the carry passed through CCR.
ADDX/SUBX no longer receive a glue operand, so their verifyTargetNode
waivers can be removed.
This improves the code for i64 uadd/usub.with.overflow. Previously the
overflow bit was computed by redoing the subtraction, and usubo also
saved and restored CCR.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[M68k] Only fold carry into ADDX/SUBX from flags that set X. NFCI (#235563)
combineCarryThroughADD replaces (ADD (SETCC COND_CS, Flags), -1) with
Flags. For SETCC/BRCOND users that is fine because they read C, but
ADDX/SUBX read the X flag. CMP, TST, logical ops, MUL and BTST set C
without changing X, so folding their flags into ADDX/SUBX would use a
stale X.
Only do the fold for ADDX/SUBX when the flags come from M68kISD::ADD,
SUB, ADDX or SUBX, which set X equal to C. I could not find a case that
currently reaches the fold with other flags, so no test changes.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[BOLT] Fix stale matching of pseudo probes stored out of index order (#232109)
`matchProfileProbeToBlock` looked up a binary probe by index with
`llvm::lower_bound`, but `MCDecodedPseudoProbeInlineTree::getProbes()`
returns probes in address order, not index order. When the block layout
puts a higher-numbered probe before a lower-numbered one, the search
misses it, and the block loses its profile.
Use a linear search that also requires a block probe. The per-node probe
array is short, so the cost is negligible.
Test Plan: added
`bolt/test/X86/match-blocks-with-pseudo-probes-unordered.test` (probes
laid out as 1, 4, 3, 2). It fails without this change (1 of 4 blocks
matched) and passes with it (4 of 4). `check-bolt` passes.
Fixes #229783
[BOLT] Fix data race in CDSplit (#234043)
There is a race in split functions pass, CDSplit strategy, that might
affect production although it is not super common. We've observed only a
few cases in one workload. The problem is that one thread might be
inserting new basic blocks in a function (BF object) while another is
trying to read the blocks via BF::front(). If the threads are timed in
the wrong way, the reading thread will load an invalid pointer and crash
on DstBB->getKnownExecutionCount(). The BB insertion is done by
SplitFunctions to insert EH trampolines.
vm_kern: wrap around in kmem_back() when the last domain is empty
kmem_back() picks the domain from the address and, when that domain has
no memory, steps forward until it finds one that does:
domain = (addr >> KVA_QUANTUM_SHIFT) % vm_ndomains;
while (VM_DOMAIN_EMPTY(domain))
domain++;
Nothing stops the walk at vm_ndomains. When the empty domain is the
last one, the loop runs through the unused tail of vm_dom[] (all empty)
and on into whatever follows vm_dom[MAXMEMDOM] in memory, until a word
there happens to look like a non-zero page count; kmem_back_domain()
then allocates from that garbage domain. Ordinary allocations never
get here, because the per-domain arenas and the domainset iterators
skip empty domains. Only the direct callers of kmem_back() do: kinst
(one trampoline per thread, allocated when the module loads) and
memguard.
[6 lines not shown]
[XCore] Introduce XCoreCodeGenPassBuilder
Standard for the NewPM. Just mirrors the existing pass setup in
XCorePassConfig.
Reviewers: nigelp-xmos, arsenm
Pull Request: https://github.com/llvm/llvm-project/pull/236687
[DebugInfo] Index types that get their name from DW_AT_specification (#236595)
A DICompositeType without a name, but with a specification, is emitted
as a DIE with no DW_AT_name and a DW_AT_specification. That DIE inherits
its name from the specification, which is how consumers, including the
DWARF verifier, resolve it. However, DwarfUnit::updateAcceleratorTables
skipped every type whose own name was empty, so such a DIE never got a
name index entry and `llvm-dwarfdump --verify` reported it as missing.
Assisted-by: claude
Solves: https://github.com/swiftlang/swift/issues/93529