[SampleProfile] Remove ProfileHasAttribute parameter from readFuncMetadata (NFC) (#208604)
This patch removes the ProfileHasAttribute parameter from
readFuncMetadata overloads.
Because ProfileHasAttribute is set once in readImpl during section
header parsing and never modified afterward, readFuncMetadata observes
the exact same immutable value regardless of whether it is passed as a
function parameter or read from the class member variable.
Assisted-by: Antigravity
[CodeGen] Teach ReplaceWithVeclib split vector llvm.sincos when only sin/cos veclib mappings exist (#194639)
Some vector math libraries provide vector sin and vector cos but no
vector sincos or no sincos with an ABI that LLVM can emit.
The one of the common case is glibc libmvec on x86: it exposes
`_ZGV{b,c,d,e}N{2,4,8,16}vvv_sincos{,f}` symbols, but those use a
vectors-of-pointers output ABI that expandMultipleResultFPLibCall does
not currently support. As a result, sincos will falls back to scalar
sincos calls even when the target has a fully working vector sin and
vector cos.
So we trying to split it into separate sin and cos calls, which will
then be replaced with vector calls if the target supports it, it
generally better than scalarized sincos calls.
[CycleInfo] Store blocks using Euler tour representation (#208614)
Each GenericCycle owned a `SetVector<BlockT*>` of its blocks (its own
plus every nested cycle's), so a block nested D cycles deep is stored D
times.
Instead, store every cycle's blocks in one GenericCycleInfo::BlockLayout
array laid out as an Euler tour of the cycle forest: each cycle owns a
contiguous range [IdxBegin, IdxEnd) nested inside its parent's.
run() builds the cycle tree and the block-to-innermost-cycle map as
before, then lays the array out in `layoutBlocks`. Its DFS also moves
from a single worklist that eagerly pushed every successor (so the stack
grew with the fan-out along the current path) to a stack of (block,
successor cursor) frames bounded by the DFS depth, with each block
pushed once; successors are still visited in the same order (hence the
weird `std::reverse_iterator`), so the cycles found are unchanged.
Block iteration order within a cycle changes, so cycle-print order in
[4 lines not shown]
nvmm: Add support for extended CPU state (XSAVE) beyond x87/SSE.
New machine-dependent x86 vCPU configuration command
NVMM_VCPU_CONF_XCR0_MASK sets the vCPU's XCR0 mask, that is, the set
of XSAVE features that the guest sees as supported in the vCPU. This
command is advertised by the new machine capability
NVMM_CAP_ARCH_VCPU_CONF_XCR0_MASK. (Changing the XCR0 mask after the
guest has begun execution will clear all extended CPU state for now;
it is unlikely that hypervisor software will do this anyway.)
This change doesn't expose the XSAVE area to userland in the comm
page -- there are already machine-independent members in struct
nvmm_comm_page at fixed offsets past the machine-dependent state so
we can't just extend struct nvmm_vcpu_state without breaking the ABI.
And the XSAVE area may exceed a page, but the address space for the
virtual machine uvm object packs comm areas in consecutive pages, so
we can't put it in the comm page at all without breaking the ABI
another way.
[10 lines not shown]
[BOLT] Remove ability to use external shell
The external shell is getting removed soon, so remove the ability to
force the use of it within BOLT.
Reviewers:
aaupov, petrhosek, maksfb, yozhu, paschalis-mpeis, yavtuk, ilovepi, rafaelauler, ayermolo
Pull Request: https://github.com/llvm/llvm-project/pull/209567
[Polly] Remove ability to use external shell
The external shell is getting removed soon, so remove the ability to
force enable it for polly tests.
Reviewers: ilovepi, Meinersbur, petrhosek
Pull Request: https://github.com/llvm/llvm-project/pull/209566
[MLIR] Remove ability to use external shell
The external shell is getting removed soon, so clean up the logic here
to enable it.
Reviewers: petrhosek, jpienaar, ilovepi, joker-eph
Pull Request: https://github.com/llvm/llvm-project/pull/209565
[Clang] Drop ability to use the external shell
The external shell in lit is getting deleted soon and it will soon no
longer be possible to force enable it.
Reviewers: compnerd, petrhosek, ilovepi
Pull Request: https://github.com/llvm/llvm-project/pull/209564
[RISCV] Rename VLSU_MEM_LATENCY to Andes45VLSU_MEM_LATENCY in RISCVSchedAndes45.td (#209388)
Prefix the defvar with the Andes45 scheduler name to match the other
Andes45-local defvars (e.g. Andes45DLEN) and avoid a bare, generic name
in the shared RISC-V TableGen namespace.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply at anthropic.com>
[lit] Remove most external shell test coverage
Now that LLVM 23 has branched, we can look at removing the external
shell.
https://discourse.llvm.org/t/rfc-removal-of-the-lit-external-shell/90951
This patch removes most test coverage that was explicitly for the
external shell as it was entirely duplicated with the internal shell.
This patch leaves out removing test coverage in shtest-format as not all
the coverage there is duplicated and it seems like there is some missing
from the internal shell and I want to give it more careful
consideration.
Reviewers: hnrklssn, ilovepi, jh7370, arichardson
Pull Request: https://github.com/llvm/llvm-project/pull/209500
meta_ignore use :N with .MAKE.META.IGNORE_PATTERNS
By using :N .MAKE.META.IGNORE_PATTERNS is just a special case
of .MAKE.META.IGNORE_FILTER and processed the same way.
[CIR] Fix x86 builtin tests after tighter inlining (#209653)
The behavior of the AlwaysInliner was tightened in a recent change
(https://github.com/llvm/llvm-project/pull/209345) to avoid inling
functions with mismatched target attributes even when the alwaysinline
attribute was present. This exposed a few failures in CIR where we were
either running with stale target features or missing target features
that were needed for the builtins we were testing.
This change updates the run lines to use the correct feature sets.
[MetaRenamer] Change basic block naming from 'bb' to 'bbl' (#205393)
Currently, `update_test_checks.py` warns when run on MetaRenamer output
e.g., `WARNING: Change IR value name 'bb3' or use
--prefix-filecheck-ir-name to prevent possible conflict with scripted
FileCheck name.`
Avoid this conflict by changing MetaRenamer to use 'bbl' for basic
blocks.
This is similar in spirit to
https://github.com/llvm/llvm-project/commit/86a63b2ae147e5a3edc39643783acfd39b059c92,
which renamed instructions from 'tmp' to 'inst' to avoid a conflict with
automatically-generated checks.
[BOLT] Stop materializing .dwo DIE vectors early in the pipeline
Summary: preprocessDWODebugInfo() eagerly force-extracted every .dwo
compile unit's DIE tree (getNonSkeletonUnitDIE(false)) very early in
BOLT pipeline, way before DWARFRewriter kicked in. Those vectors then
sit in memory throughout the entire rewrite pipeline, directly
contributing to BOLT's RSS peak. I did a fair amount of digging and
didn't find any reason as to why we need to keep all DIEs of DWO CU
materialized at all, since DWARFRewriter won't even read this vector
(the #197359 concurrency fix did use that, but that is unnecessary).
The problem is that these DIE trees are a massive contribution to RSS
when processing large binaries where we have 10s of K of dwos, storing
complete trees for each processed dwo.
This diff changes the #197359 concurrency fix to not rely on the DIE
sibling/children structure. It parses DWP type units selectively per
compile unit (DIEBuilder::buildDWPTypeUnitsForUnit ->
collectReferencedTypeSignatures) by finding the DW_FORM_ref_sig8
references in a unit's DIEs to decide which type units belong in that
[23 lines not shown]
[lldb] Add MCP tools to create and destroy debugger instances (#209288)
Add debugger_create and debugger_delete tools to the MCP server so a
client can manage debugger instances, not just command the ones that
already exist. debugger_create detaches the new debugger's stdio from
the host process (redirecting input/output/error to the null device) so
its prompt and asynchronous output cannot corrupt an MCP stream that
shares the host's stdout. Command results flow through
CommandReturnObject and are unaffected.
Factor the tool and resource registration out of
ProtocolServerMCP::Extend into a shared PopulateServer() so an embedded
in-process server (e.g. in lldb-mcp) can install the same set.
Assisted-by: Claude
rdar://181722721
[BOLT] Fix shifted DWARF inline-scope ranges; track scope boundaries (#207291)
Summary:
BOLT updated DWARF lexical-scope ranges (DW_TAG_inlined_subroutine /
lexical_block low_pc/high_pc and DW_AT_ranges) via
translateInputToOutputRange(), which mapped a boundary using its input
offset relative to the start of the containing basic block:
OutAddr = BB.getOutputAddressRange().first + (InputOffset -
BB.getOffset())
This assumes intra-block byte offsets are preserved input->output. Any
pass that changes instruction sizes within a block ahead of a scope
boundary breaks that assumption. With --plt=all, each `call foo at PLT` (5
bytes, e8+rel32) is rewritten to `call *foo at GOT(%rip)` (6 bytes, ff
15+rel32); N such calls before a boundary shift its emitted low_pc/
high_pc N bytes too early, onto the preceding instruction. The range
stays within the parent so `llvm-dwarfdump --verify` does not catch it;
symbolizers then attribute samples on those instructions to the wrong
[44 lines not shown]
[lldb] Use std::atomic<bool> for Editline's pending-resize flag (#209619)
TerminalSizeChanged() used a volatile std::sig_atomic_t to record that a
resize is pending. That type was chosen because the SIGWINCH handler ran
in async-signal context and could only touch an sig_atomic_t. Signals
are now handled on a dedicated thread, so the flag is written from a
normal thread and std::atomic<bool> is sufficient to handle that.
el_resize() still runs on the thread that owns libedit, in its read
loop. I discovered that it is not safe to run elsewhere, because it
resets libedit's display model without redrawing. Applying it off that
thread seems to throw it off and makes it duplicate the prompt.
[lldb][test] Deflake the statusline scripted-command output test (#209643)
test_scripted_command_output_not_eaten failed intermittently in CI on
its assertIn(b"\x1b7", data) guard because the captured window held no
statusline escape at all, only the command output and the next prompt.
The cause is a thread-scheduling race, not a bug. The statusline is
redrawn on the event thread once per progress event, but on a loaded
machine the event thread need not run until the flood command has
already returned, so it drains the queued progress events after (lldb)
was matched and the capture stopped, leaving no redraw to inspect.
Widen the flood (the line count is now an argument) so the event thread
has a larger window to redraw in, and retry until at least one complete
cursor save/restore pair is observed before checking that no output was
spliced into it. If a redraw is never seen, skip rather than fail.
I deliberately avoided a per-line sleep as it would let each redraw
finish between prints and hide the very interleaving the test looks for.
Fixes #209605