[libc++] Try fixing flaky fs.op.space test on FreeBSD (#213988)
As part of this test, we check the capacity available on the filesystem
and compare it against an expected capacity. However, on some
filesystems, the capacity is actually computed and may change depending
on filesystem usage. This creates a race condition since the disk may be
filling up (by e.g. other running tests) between the two calls.
For that same reason, other checks for the available size were using an
approximate equality up to a delta. Use the same approach for the
capacity here.
[mlir][bufferization] Handle scf.if deallocs in static memory planner (#213634)
Extends the static memory planner (#209106) to handle two scf.if
patterns that previously errored or were silently missed.
**What changed**
Replaced the hand-rolled `BufferViewFlowOpInterface` DFS with the shared
`BufferViewFlowAnalysis`. This covers arith.select, scf.if/for results,
cf branches, and view ops in one place — no new interface needed.
Two new cases are handled:
1. Alloc flows through an `scf.if` result; `dealloc` is on that result.
`resolve()` finds the alias and picks up the dealloc.
2. Alloc is in the entry block; `dealloc` is inside an `scf.if` body.
`findAncestorOpInBlock` anchors the lifetime to the enclosing `scf.if` —
conservative but correct.
[10 lines not shown]
[MLIR][OpenMP] Support calls added between MarkDeclareTarget runs
Currently, if there are multiple executions of the `MarkDeclareTarget`
pass in a compiler pipeline and somewhere between both runs function
calls get added to a non-declare_target function that was marked as such
implicitly, potential changes to the `device_type` won't get propagated.
This is because we can't distinguish between a user-specified
`declare_target` function attribute and one added by that pass. This
patch addresses this by adding a new parameter to `DeclareTargetAttr`
that is used by that pass to know whether new `declare_target`
information could be propagated to it.
The `automap` and `implicit` parameters are given default values to
simplify the representation of these attributes.
[libc++] Use the granular headers instead of <__locale> (#214029)
After splitting up <__locale> into sub-headers, we can now use the
granular includes from the rest of the code and remove <__locale>.
[Flang][OpenMP] Improve implicit declare_target propagation
After starting to run the `MarkDeclareTarget` pass later in the
pipeline, some limitations of its original implementation started to be
hit; specifically, some calls being missed could result in an overly
restrictive marking that would cause the `HostOpFiltering` pass to
remove reachable device code.
This patch aims to address these problems by making the following
changes:
- It makes sure to mark functions in every `RecipeInterface` op pointed
to by OpenMP operations.
- It recursively propagates and combines declare_target information from
target regions and explicitly set declare_target functions to unmarked
functions, but it never modifies explicitly marked functions.
- External and public functions can now only be marked with
`device_type(any)`. Before, marking them as `nohost` or `host` was
possible, but without the ability to see all users we can't give such
guarantees.
[7 lines not shown]
[libc++] Require installing dependencies before running LNT tooling (#214020)
This makes all benchmark-related utilities consistently rely on a
virtual environment containing libcxx/utils/requirements.txt instead of
some scripts installing their dependencies explicitly, which is
duplicate work in most cases.
[runtimes] Remove override of LLVM_ENABLE_PER_TARGET_RUNTIME_DIR on Darwin (#213748)
It should be possible to produce a per-target include directory even on
Apple platforms. That's not the way we ship the library by default, but
there's no reason not to allow selecting that configuration.
[libc++] Move math special functions under __cmath (#213944)
It was always a bit weird that these were the only functions under
__math/ which were not in the __math namespace and were not in the
global namespace. This also led to a workaround in the C++20 modules
testing.
Instead, move math special functions under __cmath/, which will contain
APIs that are part of `<cmath>` but not `<math.h>`.
Protect ip6_mforward() with kernel lock in ip6_output().
Multicast forwarding is not MP safe yet and also locked with shared
netlock plus kernel lock elsewhere.
OK sashan@