[libc++][NFC] Make __libcpp_is_trivially_relocatable a variable template (#213640)
Variable templates are a bit nicer to read and improve compile times a
bit.
[flang][OpenMP] Lower align modifiers on allocate clauses (#211624)
Closes #211620.
Stacked on #211621.
This adds `align` modifier lowering to the host `omp.parallel` path
introduced by the parent change. It carries and verifies per-item
alignment metadata and uses aligned runtime allocation when alignment is
specified, while retaining the unaligned path otherwise.
Other clause-bearing constructs and unsupported data types remain out of
scope.
Assisted-by: Copilot
[libc++] Granularize includes of <optional> (#213433)
Since `<optional>` is now granularized
(7ded638ea33b96d9fd628e2a5cbc06df12ede153), include its individual
pieces directly, instead of pulling in the whole `<optional>`.
This change is also needed for #211888.
[NFC][analyzer] Extract general logic in security.ArrayBound (#210774)
The checker `security.ArrayBound` contains general-purpose logic that
will be useful to bring other bounds checking checkers out of `alpha`
stage. This change refactors the implementation of `security.ArrayBound`
to separate the general-purpose logic and the concrete details that are
only relevant in that particular checkers.
Shortly after merging this, a follow-up commit will move the
general-purpose code to separate files. (This is left out of this change
to ensure continuity in the git history: this commit renames and
reorganizes functions, the next one will move them with minimal
changes.)
Note that after this commit the `ProgramState` associated with the error
nodes created by `security.ArrayBound` will be slightly different in
some cases (they may have different constraints) but the state of a sink
node is practically unused, so this does not cause any functional
changes.
[VPlan] Append recipes created via builder to worklist
The previous PR appended the top most created recipe to the worklist, and this PR extends it to any other nested recipes that were created, similar to InstCombine.
This removes the header mask in a good few more places on RISC-V as measured on SPEC CPU 2017, e.g. for the following loop:
```c
long f(const int *p, const int *q, long n) {
long a = 0, b = 0;
for (long i = 0;; i++) {
if (p[i] && q[i]) { a += i; b += i; }
if (i + 1 == n) break;
}
return a + b;
}
```
Before:
[49 lines not shown]
[VPlan] Process simplifyRecipes in a worklist
This brings simplifyRecipes further in line with InstCombine, and asides from unlocking more simplifications it also helps avoid spurious test churn whenever passes are moved around simplifyRecipes.
For now just push the new recipe onto the worklist, not its users.
This uses a post order traversal so we maintain the same simplification order as before.
I've gone through and checked every simplification we do is a canonicalisation that converges, and I checked on llvm-test-suite + SPEC CPU 2017 in various configurations that we don't hit any cycles.
[lldb] Refactor RegisterTypeBuilder
This prepares it for emitting union types. Major changes:
* Entry function is now a dispatcher to builder functions for each type.
* Name mangling is standardised.
* The register name parameter is no longer needed and so was removed.
arm64: Use the fault handler when one is provided
In align_abort() and tag_check_abort(), if we got a fault while in kernel,
do not panic if a fault handler has been provided. We may get such a fault
when trying to read or write userland data, it can at least happen with
_umtx_op() if an unaligned pointer is provided. Instead, just let the
fault handler deal with it.
MFC After: 1 week
Approved by: andrew
Differential Revision: https://reviews.freebsd.org/D58426
(cherry picked from commit c6f5d8fb269fd67a8206420b4e7d67a93bc80733)
Signed-off-by: Olivier Houchard <cognet at FreeBSD.org>
(cherry picked from commit 60dd46db19f473af7aa505c0d8dcf9bb69847019)
Signed-off-by: Olivier Houchard <cognet at FreeBSD.org>
Reland "[clang][docs] Update CommandLineUsage and UsersManual with some flags" (#213342)
The current user-manual is missing implemented options that are useful
for machine-readable output, such as `-fdiagnostics-format=sarif` and
`-fdiagnostics-absolute-paths`.
arm64: Use the fault handler when one is provided
In align_abort() and tag_check_abort(), if we got a fault while in kernel,
do not panic if a fault handler has been provided. We may get such a fault
when trying to read or write userland data, it can at least happen with
_umtx_op() if an unaligned pointer is provided. Instead, just let the
fault handler deal with it.
MFC After: 1 week
Approved by: andrew
Differential Revision: https://reviews.freebsd.org/D58426
(cherry picked from commit c6f5d8fb269fd67a8206420b4e7d67a93bc80733)
Signed-off-by: Olivier Houchard <cognet at FreeBSD.org>
[AArch64] Fold zero-interleave shuffle into vector shift left (#210793)
A shuffle mask that interleaves zeros between every other byte element
is equivalent to a vector shift left on a wider element type. This
avoids generating a `tbl` instruction with a constant mask loaded from
memory, replacing it with a single `shl` instruction.
Before:
```asm
adrp x8, .LCPI0_0
ldr q1, [x8, :lo12:.LCPI0_0]
tbl v0.16b, { v0.16b }, v1.16b
```
After:
```asm
shl v0.8h, v0.8h, #8
```
[4 lines not shown]
[lldb][debugserver] Expedite the stopped frame's stack memory in jThreadsInfo (#212706)
Add `ReadFrameZeroStackMemory`, which expedites the innermost frame's stack
memory so a variables view on a stop is served from lldb's memory cache. When
frame 0's `$fp` looks usable, two windows are expedited:
* `[$fp + 2*ptr_size, $fp + 2*ptr_size + k_expedite_stack_arg_size)` for stack-passed
parameters, starting above the saved `{fp, lr}` pair the backchain already covers.
* `[$fp - below, $fp)`, `below = min($fp - $sp, k_expedite_stack_window - k_expedite_stack_arg_size)`,
for locals and spilled register arguments. A small frame gets all of `[$sp, $fp)`; a large one keeps the part nearest `$fp`, so the cost stays bounded.
If `$fp` fails validation (frameless leaf, or `$fp` used as a scratch GPR),
a single `[$sp, $sp + k_expedite_stack_window)` window is expedited instead.
Each window is a separate chunk, because lldb's L1 cache only serves reads
fully contained in one expedited chunk. Only the thread that stopped gets
these windows, so the stop reply does not grow with thread count.
`GetJSONThreadsInfo` now builds the `"memory"` array from both sources and
emits it whenever either produced an entry. Add `JSONGenerator::Array::empty`
for that check.
sys/socket.h: Fix AF_MAX
AF_MAX was always intended to be one more than the greatest allocated
value. Jeff broke this in 2013. Unfortunately, a bunch of people then
decided to adapt to the mistake instead of correcting it.
Fixes: 863c7e45628d (" - Reserve a special AF for SDP. The one we were incorrectly using before was taken by another AF.")
MFC after: 3 days
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: kevans, glebius
Differential Revision: https://reviews.freebsd.org/D58597
e1000: report UDP RSS hash type on igb/em
{em,igb}_determine_rsstype() mapped only the TCP and bare-IP RSS descriptor
types; the UDP types returned M_HASHTYPE_NONE.
The hardware does hash UDP, but with a NONE hashtype iflib skips its
flowid-based TX queue spread, so all forwarded UDP egressed on a single queue
and serialized transmit on one core.
Add the three UDP cases (IPV4_UDP, IPV6_UDP, IPV6_UDP_EX) so egress spreads
across all TX queues.
Reviewed by: kbowling, gallatin
Approved by: kbowling
MFC after: 1 week
MFC to: stable/14, stable/15
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D58513
(cherry picked from commit 285c749f575ed7f9e60555037f23ac673084c62a)
[lldb] Make RegisterFlagsDetector into RegisterTypesDetector
In future it may be generating things other than flags. Functionality
is the same, but the interface changes to use RegisterType.
hwpmc: fix event allocation on pre-Zen AMD CPUs
amd_allocate_pmc() chose the pmu-events code path whenever pmc_cpuid was
non-empty, and rejected any allocation lacking PMC_F_EV_PMU.
But pmc_cpuid is set for every AMD CPU, while the pmu-events tables only cover
Zen and later.
On older families (K8, Bobcat, Jaguar/16h, Bulldozer) libpmc finds no
pmu-events entry and falls back to the legacy path, which never sets
PMC_F_EV_PMU.
Reviewed by: mhorne
Approved by: mhorne
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D58468
(cherry picked from commit 6c4d9b9af1a3b247bf82a4228c835d106f535613)