[ADT] Remove padding from ImutAVLTree nodes (#244655)
Move the reference count next to the height and flag bit-fields. This
removes 8 bytes of padding when the value is pointer-aligned: a
non-canonicalizing set of pointers goes from 48 to 40 bytes per node and
a map from pointers to pointers from 56 to 48. Peak memory of the
liveness analysis on a large function drops by up to 10%.
Assisted-by: Claude Opus 5.5
Co-authored-by: Gabor Horvath <gaborh at apple.com>
[CIR][NFC] Use dialect getters for AMDGPU attribute names (#245144)
Summary:
- Add `CIRDialect` getters for AMDGPU function attribute names that were
string literals , and use them in `CIRGen AMDGPU.cpp`.
- Also switch `amendModule` in `LowerToLLVMIR.cpp` to the existing
getters for the AMDGPU module attributes.
ixl/iavf: Start the head write-back completion index at the head
With head write-back, tx_cidx_processed holds the head value that the
credits update consumed last: the index of the next descriptor to
complete. With the Report Status queue it is the index of the last
completed descriptor. 088a0b27adb4 made both start at the last
descriptor of the ring, which is right for the Report Status queue
only. With head write-back, the default in ixl(4), the first credits
update after every initialization reports a completed descriptor that
was never sent.
iflib's own reclaim holds back isc_tx_nsegments descriptors and does
not notice. netmap uses the count as it is: iflib_netmap_txsync()
puts the tail of its ring one slot too far. Once the card has sent
everything, the tail meets the head, which netmap reads as a ring
without a free slot, and no completion is left that would move it.
The ring never transmits again: pkt-gen at full rate stops after a few
thousand packets, and a ring that one pkt-gen has used cannot be used
by the next.
[12 lines not shown]
hwpmc_amd: Service the core counters when IBS claims the NMI
IBS and the core counters share the PMC NMI. amd_intr() and
amd_intr_v2() return as soon as pmc_ibs_intr() claims an NMI, so a core
counter overflow that arrives with the same NMI is not serviced: the
counter is not reloaded and sampling with it stops.
Service the core counters after pmc_ibs_intr() and claim the NMI if
either side found work. An NMI that IBS claimed no longer uses up a
core stray-NMI credit. With no core counter sampling, amd_intr_v2()
still returns right after IBS, without freezing the core counters.
Add a test that samples unhalted cycles on cpu0 alone and then next to
IBS op, and requires the second phase to keep at least half of the
core samples.
Reviewed by: mhorne
Sponsored by: Advanced Micro Devices, Inc.
Differential Revision: https://reviews.freebsd.org/D61451
[DebugInfo][FLMD] Add core FLMD context + node classes (#236203)
This patch starts implementing the core FLMD context and node classes,
which serve to replace the existing DILocation-based source location
model. Most of the additions of this patch are in
FunctionLocalMetadata.h, which defines the context class
MDFunctionLocalContext and the data types that it stores, and also
includes verifier changes to test some of the basic semantics of these
classes.
The contents of FunctionLocalMetadata.h are largely unmodified in later
patches, meaning this is a complete implementation of the basic class
interfaces, not including support functions, e.g. IR/Bitcode, value
mapping, or updating the contents through transformations such as
inlining. This patch also does not include FLDebugLoc, the class that
replaces DebugLoc as the main source location storage mechanism; these
will all be added in followup patches.
amd64: Mark the BSP as a small core
cpu_init_small_core() records in the pcpu area that a CPU is an Intel
small (Atom) core, and that it needs the workaround for INVLPG not
flushing global TLB entries when PCID is enabled. hammer_time() calls
it for the BSP before the BSP has a pcpu area: the temporary one is
zeroed and installed only later, and pmap_bootstrap() then replaces it
with the final one, zeroed again. The BSP therefore never has
pc_small_core or pc_pcid_invlpg_workaround set, while the APs, which
call it from initializecpu(), do.
On a hybrid machine the BSP is normally a large core and nothing is
missing. On a machine with small cores only, such as an Atom C1110 or
x7809C, the BSP is one of them, and its invalidations of kernel
mappings in pmap_invlpg(), pmap_invalidate_range() and the shootdown
handler go without the workaround.
Do it in amd64_bsp_pcpu_init1() instead, which runs for both of the
BSP's pcpu areas once %gs points at them. The PCID features and
[7 lines not shown]
[NFC][CodeGen] Store EH handlers as AsmPrinterHandler in AsmPrinter (#245196)
AsmPrinter is exported (LLVM_ABI), but its EHHandlers field was a
SmallVector<std::unique_ptr<EHStreamer>>, where EHStreamer has
LLVM_LIBRARY_VISIBILITY (hidden). GCC warns with -Wattributes:
'llvm::AsmPrinter' declared with greater visibility than the type of
its field 'llvm::AsmPrinter::EHHandlers'
in every TU that sees the EHStreamer definition before AsmPrinter.h.
All uses of EHHandlers only call virtual methods declared on the
exported AsmPrinterHandler base, so store the handlers as
AsmPrinterHandler and drop the EHStreamer forward declaration.
Co-authored-by: Claude <noreply at anthropic.com>