[lldb-dap][NFC] Swap show_user and error code in DAPError (#243859)
The `show_user` args is set more often than the error code.
I prefer not to write `llvm::inconvertibleErrorCode()` every time I need
to show the error to the user.
[flang][OpenACC] Fix lowering crash on DO WHILE loop constructs
A loop construct associated with a DO WHILE crashed lowering: reading the
DO WHILE's loop control as bounds aborted, both when the DO WHILE is lowered
unstructured and, with -lower-do-while-to-scf-while, when it is lowered
structurally. A DO WHILE has no bounds and no induction variable, so lower
the construct to an acc.loop without bounds that holds the whole DO WHILE,
as for an unstructured loop, with nothing to privatize.
[flang][OpenACC] Lower unstructured seq loops in kernels
An `acc loop seq` whose loop has an early exit is lowered as an
unstructured acc.loop that privatizes its induction variables, but its
DOs then hit the "unstructured do loop in acc kernels" TODO when they
are lowered inside that acc.loop.
When privatizeInductionVariables privatizes the induction variable of a
DO owned by an unstructured acc.loop, record that DO.
genOpenACCLoopFromDoConstruct lowers a recorded DO as plain control flow
inside its acc.loop instead of reporting the TODO when that acc.loop is
seq; no parallel loop then runs the DO on more than one thread. The
record is dropped once the construct's evaluations are lowered.
The tests cover seq loops nested in structured loops, directly in a
kernels region, inside an unstructured IF, SELECT CASE, BLOCK or DO
WHILE, and a combined `kernels loop seq` construct. They also cover the
shapes that still hit the TODO: a DO the seq loop does not own (a plain
DO in its body, or a DO next to the DOs of a collapse(force:2), also
[7 lines not shown]
[AMDGPU] Only copy SGPR inputs of vector PHIs in SIFixSGPRCopies (#226213)
Since #169038, `processPHINode` legalizes every vector PHI. With AV
classes as the default (#166482, #166483), this adds a `COPY ...,
implicit $exec` for inputs that differ from the PHI only in AV-ness.
Remove the PHI path from `legalizeOperands`. `processPHINode` now copies
only the SGPR inputs of vector PHIs, at the end of the incoming block
(#168761, i1 lane masks). Other mismatched inputs, including VGPR/AGPR
mixes and subregisters, are left to PHI elimination. Propagating the
AGPR class back to operand PHIs now only applies to SGPR PHIs.
This reduces register pressure and spilling in kernels with many
divergent loop PHIs. Because the other copies now come from PHI
elimination, register allocation can change in other kernels too, in
either direction.
Co-authored-by: Matt Arsenault <arsenm2 at gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[libc++] Destroy the elements of a vector in reverse order (#243091)
While the destruction order of the elements in a vector isn't prescribed
by the standard, a lot of programs rely on the elements being destroyed
in reverse order. This assumption was broken by #217631. Since there is
no other reason to prefer a particular direction, users being broken by
this is a good reason to undo the change in behaviour.
This adds a test in `libcxx/`, since it's simply documenting the current
behaviour to avoid changing it accidentally. We may change the behaviour
in the future if there is a reason to do so.
[X86][ACEV1] Record the program model and correct the outer products
Record the program model as the intrinsics are selected, keyed on the
intrinsic as AMX does, rather than from a 66-entry opcode table kept in
step by hand; using both models is now diagnosed, not asserted. Drop the
K dimension the internal outer products never used, and swap the TOP4MX
pseudos' sources, which reached the instruction reversed because it
takes its VVVV operand first. Widen the insert pseudos' index to i32 so
an out-of-range one truncates as for AMX, check it in clang against the
architectural 0-15, and restore the GCCRegNames grouping BSR0 reflowed.
[LSR] Only apply postincrement discount on address uses (#149341)
Cost::RateRegister currently applies the pre/postincrement discount to
all uses when the addrec is of the correct form, meaning it will be
applied even when there's no load/store that can be postincremented. Fix
this by checking that the LSRUse kind is Address.
[libc++][prototype] Add the std::cppNN release namespaces from P3866R0
Each std::cppNN namespace contains a using-directive for std, so that every
component that was never revised is reachable through it. Components that were
revised declare an alias in the release namespace next to their definition, which
hides the std entity of the same name from qualified lookup:
std::cpp29::vector<int> -> std::vector2<int> (declared in __vector/vector2.h)
std::cpp26::vector<int> -> std::vector<int> (through the using-directive)
std::cpp29::string -> std::string (through the using-directive)
Findings, captured in libcxx/test/std/library/cpp_release_namespaces:
- `using namespace std::cpp29;` makes every revised name ambiguous, since
using-directives are transitive for unqualified lookup.
- Nested namespaces must be mirrored: std::cpp29::pmr hides std::pmr unless it
re-exposes it with its own using-directive.
- std::vector and std::vector2 don't interoperate at API boundaries.
- With Clang, CTAD through the alias from an iterator pair only works if the
alias is variadic.
[9 lines not shown]
Update to zlib 1.4
ok deraadt
The security fixes are already in tree, the remaining relevant fixes
for OpenBSD include these:
- Deliver all gzip data before reporting error
- Fix truncated stream detection in gzread()
- Fix pending skip handling in gzread()
- Fix loss of zero fill on repeated gzseek()'s when writing
- Fix inaccurate total_in after Z_NEED_DICT returned
- Detect and report bad deflateSetDictionary() calls
- Avoid undefined behaviors in C language usage
- Don't assume NULL is defined in compress.c and uncompr.c
- Clarify documentation
[libc++][prototype] Turn the vector copies into std::vector2 (P3866R0)
Prototype of P3866R0 (V2: An Evolution Path for the Standard Library), pretending
that std::vector2 is introduced in C++29 as a version of std::vector that always
uses the size-based layout (begin pointer + size + capacity), regardless of the
ABI configuration.
- __vector/vector2*.h: renamed vector to vector2 and gated everything on C++29.
vector2_layout.h only keeps the size-based layout. There is intentionally no
vector2<bool> specialization.
- __fwd/vector2.h: forward declaration.
- __iterator/wrap_iter.h: __wrap_iter befriends vector by name, so it has to
befriend vector2 too.
- <vector>, CMakeLists.txt, module.modulemap.in, modules/std/vector.inc and
generate_iwyu_mapping.py: wire up the new headers.
- Tests: renamed vector to vector2, replaced the language-mode directives by
`REQUIRES: std-at-least-c++29`, added vector2 overloads/aliases to the test
support headers, and updated the ABI test with the actual vector2 sizes.
No code is shared with std::vector on purpose, except for __if_likely_else.
[CodeGenPrepare][AMDGPU] Fold urem by constant of loop increment (#242110)
Extend foldURemOfLoopIncrement to constant remainder amounts. For
constant divisors also allow a constant step smaller than the divisor,
'or disjoint' offsets, and a non-simplifiable start value (the initial
remainder is computed in the preheader). Power-of-2 divisors and urems
that do not execute on every iteration are skipped.
Co-authored-by: claude Opus5.5
[MustExecute] Remove findInContextOf and checkForAllContext
They have no users left now that the Attributor uses isInContextOf and
checkForAllTerminatorsInContext. Also remove getCurrentInst and count
from MustBeExecutedIterator, which were only used by findInContextOf.
The iterator itself is still used by the must-be-executed-contexts
printer.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[libc] Add memchr benchmark
There's a bit of a gap between LLVM libc's memchr implementation and
glibc's memchr implementation, even when both have equivalent vector
instructions available. Add some benchmarks to aid in the optimization
effort.
Assisted-By: LLM
Reviewers: kaladron
Pull Request: https://github.com/llvm/llvm-project/pull/243751
[NVPTX] Revert #191890, #215897 SETP+SELP commutativity (#243807)
Revert `SETP` commutativity and predicate inversion patch #191890 and
its subsequent `SELP` extension #215897. Adapt the reverted code to
avoid undoing subsequent refactors like replacing `SETP_i32rr`,
`SETP_i32ri`, and `SETP_i32ir` with a single flexible `SETP_i32`.
After discussions in https://github.com/llvm/llvm-project/pull/191890
highlighted several major issues with the original `SETP` commutativity
patch #191890, we need to revert it (and the follow-up `SELP` patch
#215897) so that they can be re-implemented later with a different
approach, and avoid blocking other important work while doing so.
[libc] Do not core dump when failing to meet benchmark reqs
Prefer reportFatalUsageError which doesn't core dump and just cleanly
exits.
Reviewers: kaladron
Pull Request: https://github.com/llvm/llvm-project/pull/243750
[X86] Fold zero-extended byte masks into 32-bit AND (#234796)
A byte mask followed by zero-extension currently produces `andb; movzbl`
in the parser loop from #56498. Select one 32-bit AND instead: its
zero-extended immediate clears the upper bits as well as masking the
byte.
Match only one-use byte masks, and handle both ordinary and APX
instructions.
The tests cover byte-constant extension, shared masked values, live
unmasked inputs, and narrow flag uses in 32-bit and 64-bit modes. This
addresses the byte-mask example in #56498.
Assisted-by: OpenAI Codex.
18708 Fix ztest deadlock in spa_vdev_remove()
Imported from: OpenZFS fedef6dd592cf6e83ab8fc8b81e5407d64f79996
Imported from: OpenZFS c048ddaf332504765696a456ab572d6f041051a2
Imported from: OpenZFS 9bb0d89c5c7f1bbf16ab410c25a087b691d428ac
Portions contributed by: Igor Kozhukhov <igor at dilos.org>
Portions contributed by: Matthew Ahrens <matt at mahrens.org>
Reviewed by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed by: Tom Caputi <tcaputi at datto.com>
Reviewed by: Ryan Moeller <ryan at ixsystems.com>
Reviewed by: George Wilson <gwilson at zfsmail.com>
Reviewed by: Toomas Soome <tsoome at me.com>
Approved by: Gordon Ross <gordon.w.ross at gmail.com>
18709 spare detach and pool split can deadlock with txg sync
Reviewed by: George Wilson <gwilson at zfsmail.com>
Reviewed by: Toomas Soome <tsoome at me.com>
Approved by: Gordon Ross <gordon.w.ross at gmail.com>
18661 dbuf_remap() reads the interior slots of large dnodes as dnodes
Reviewed by: George Wilson <gwilson at zfsmail.com>
Reviewed by: Toomas Soome <tsoome at me.com>
Approved by: Gordon Ross <gordon.w.ross at gmail.com>
18683 Scrub mirror children without BPs
Imported from: OpenZFS ad8b9f940c1e39a38af61934737c1e4cf8ab5c08
Portions contributed by: Matthew Ahrens <matt at mahrens.org>
Reviewed by: Mark Maybee <mark.maybee at delphix.com>
Reviewed by: Tony Hutter <hutter2 at llnl.gov>
Reviewed by: Toomas Soome <tsoome at me.com>
Approved by: Gordon Ross <gordon.w.ross at gmail.com>
12031 zfs test refreserv_004_pos can fail
Reviewed by: George Wilson <gwilson at zfsmail.com>
Reviewed by: Toomas Soome <tsoome at me.com>
Approved by: Gordon Ross <gordon.w.ross at gmail.com>
18682 vdev_mirror: don't scrub/resilver devices that can't be read
Imported from: OpenZFS 056a658dee00cab7cd42e6146f3fa0690f07c93e
Reviewed by: Mark Maybee <mark.maybee at delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed by: Toomas Soome <tsoome at me.com>
Approved by: Gordon Ross <gordon.w.ross at gmail.com>