[Remarks] Parse YAML hotness as a 64-bit count (#243469)
We hit a parse error when reading YAML remarks with `Hotness` above
`UINT32_MAX`. The parser reads it as `unsigned`, rejecting valid 64-bit
counts. Parse `Hotness` as `uint64_t` to match `Remark::Hotness` and the
YAML serializer, while keeping debug-location fields as `unsigned`.
Add 3 unit tests to the existing YAML parser tests:
- Hotness = 2^32 / UINT64_MAX -> parsed without truncation
- Hotness = 2^64 -> rejected
- DebugLoc.Line = 2^32 -> rejected
Tested on Linux x86-64, Release build with assertions enabled:
- The 64-bit Hotness test fails before the fix for both 2^32 and
UINT64_MAX.
- All 52 Remarks unit tests pass after the fix.
- Hotness = 2^64 and DebugLoc.Line = 2^32 remain rejected.
[3 lines not shown]
[scudo] Clean up zero on deallocate change. (#244070)
Instead of having a separate bool for Zero in the secondary cache entry,
use the already existing Flags instead.
Fix bug where a secondary cache entry is zeroed by releasing to the
kernel, but the entry was not marked as being zeroed. Update the test
for this since it was wrong too.
Move the zeroing of the entry so that if the secondary quarantine is
enabled, the entry is zeroed before being put in quarantine.
Move the zeroing outside of the lock when zero on deallocate is enabled.
Use the ClassId value in combined.h instead of using Header->ClassId.
BUG=b:581873117
BUG=b:582375770
MFC: libdwarf: standard DWARF 5 form names, DW_LANG_C17 and C23
7bb441c86678 added the fixed-size string and address index forms
0x25 to 0x2c as DW_FORM_ref_strx1..4 and DW_FORM_ref_addrx1..4; the
standard (DWARF 5, table 7.6) names them DW_FORM_strx1..4 and
DW_FORM_addrx1..4, with no "ref". Rename them, keep the old spellings
as aliases since the header is installed, and update dwarf_dump.c's
form names accordingly. Add DW_LANG_C17 (0x2c) and DW_LANG_C23 (0x3e),
which clang emits for -std=c17 and -std=c23 units. ctfconv(1) needs
all of these; it carried them in a private header until now.
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D61154
(cherry picked from commit f22d65998fe15b6bed9c8c3a2eede25c706837e1)
[libc] implement sys/mount.h (#244047)
The mount header is for mounting and unmounting filesystems. This PR
adds mount, umount, and umount2, plus tests. Tests are pretty minimal
since we generally can't and don't want to mount or unmount random
files.
Assisted-by: Automated tooling, human reviewed.
[Clang][CMake] Support MinGW in CLANG_ENABLE_BOOTSTRAP (#242849)
When bootstrapping Clang with a MinGW toolchain on Windows (`WIN32` and
`MINGW` are both true), `clang/CMakeLists.txt` currently assumes `WIN32`
implies an MSVC-like toolchain:
- Use `clang${CMAKE_EXECUTABLE_SUFFIX}` and
`clang++${CMAKE_EXECUTABLE_SUFFIX}` instead of `clang-cl.exe` when
`MINGW` is set.
- Extend the `elseif(NOT WIN32)` LTO archiver branch to `elseif((NOT
WIN32) OR MINGW)` with `${CMAKE_EXECUTABLE_SUFFIX}` (keeping `LLVMgold`
restricted to `NOT WIN32`).
- Restrict the `lld-link` `CMAKE_LINKER` override under
`BOOTSTRAP_LLVM_ENABLE_LLD` to `WIN32 AND NOT MINGW` (or cross-compiling
to `Windows`), since MinGW uses the GNU driver like Unix targets.
Tested locally on Windows with llvm-mingw (`x86_64-w64-windows-gnu`),
`CLANG_ENABLE_BOOTSTRAP=ON`, `BOOTSTRAP_LLVM_ENABLE_LLD=ON`, and
`BOOTSTRAP_LLVM_ENABLE_LTO=Thin` (`stage2-configure` and stage2
`llvm-tblgen` build succeed).
[flang][OpenMP] Detect conflicting data-sharing clauses for common blocks (#213913)
Issue: Flang accepts conflicting OpenMP data-sharing when a named COMMON
and one of its members appear on the same directive (e.g. PRIVATE(/C/)
and SHARED(X)), though OpenMP treats the block as all explicit members.
Fixes #205779
Root cause
- CheckMultipleAppearances only tracked the symbol named in the clause
(block name or variable), not COMMON membership.
- Listing /C/ did not register X, Y, so a later SHARED(X) looked like a
new symbol.
- Listing X did not check whether /C/ was already in another clause.
- OpenMP 2.15.3: a named COMMON in a data-sharing clause ≡ listing every
explicit member — semantics layer did not model that.
```
common /c/ x, y
!$omp parallel private(/c/) shared(x) ! x listed twice — should error
[16 lines not shown]
[libc] Add capability functions (#244053)
The capget and capset functions are weird, the current linux API expects
that they are provided by the system libc, but not exposed via headers.
Based on that, the lack of a yaml change is intentional.
Assisted-by: Automated tooling, human reviewed.
contrib/kyua: update to 0.15.2
This change contains a few bugfixes to the test executor.
MFC after: 1 week
Merge commit 'dab80d5deaf7d998d587b99f7941890237960638'
[mlir][vector] Unroll transfers masked by vector.mask (#239554)
`UnrollTransferReadPattern` and `UnrollTransferWritePattern` reject
transfers inside `vector.mask` (#230461). Transfers with `in_bounds =
false` unroll today, so replacing `in_bounds` with masks (#227821) would
lose this unrolling if the masks are introduced before unrolling and
survive mask elimination.
Unroll them into one `vector.mask` per tile, with the matching tile of
the mask (and passthru, if any). Both patterns now use
`MaskableOpRewritePattern`.
Limited to minor identity maps, fixed-size vectors and target shapes of
the vector's rank. The mask-operand form is left unchanged; its removal
from transfers is tracked in #239511. Other masked transfers and other
ops under `vector.mask` are still not unrolled.
After `-canonicalize`, slices of a `vector.create_mask` become per-tile
`vector.create_mask` ops. For example, with step 4 and bound 1024,
[3 lines not shown]
Return usedbysnapshots from webui.dataset.details
## Problem
webui.dataset.details doesn't request the usedbysnapshots property, which pool.dataset.details (the method it replaces) returns and the Datasets page reads. It can't be derived from the other space fields because usedbyrefreservation gets mixed in.
## Solution
Request usedbysnapshots alongside the other space accounting properties. The result model already declares it, so the schema doesn't change.
arm64 pmap: Eliminate page table rewalks after demotions
pmap_demote_l1() and pmap_demote_l2_locked() return the virtual address
of the page table page that replaces the demoted superpage mapping. In
pmap_advise(), pmap_change_props_locked(), and pmap_clear_modify() use
that address instead of rewalking the page table from the L1 or L2
entry. Similarly, after pmap_advise() demotes an L3C superpage, compute
the virtual address of the L3 entry that it removes from the virtual
address of the current L3 entry.
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D61599
[VPlan] Move extract-lane(0, canWideIV) combine before unrolling
Some extract-lane combines can't be performed before unrolling, e.g. the one that combines it to Instruction::ExtractElement can end up extracting from a different part. But the extract-lane(0, canWideIV) can because at index 0 you're always extracting from the first part. Do this before unrolling, which improves codegen of unrolled code.
[VPlan] Support interleaving early exit loops with side effects
We couldn't do this on main previously because the exit mask `active-lane-mask(0, FirstActiveLane(Cond))` doesn't get unrolled properly across parts. Now that we use mask.beforefirst we can unroll it properly in a chain. The unrolled form is:
unroll(mask.beforefirst, P) = mask.beforefirst(cond[P] | broadcast(anyof(not(unroll(mask.beforefirst, P-1)))))
On AArch64 this can be combined to brkpb in another patch.