[VPlan] Compute blend masks from minimum set of edge masks (#201783)
#201784 aims to preserve SSA in early exit loops, and in doing so insert
phi nodes. More phi nodes results in more VPBlendRecipes, so this PR
optimizes the edge masks generated for those blend recipes to prevent
regressions.
The idea is to compute a minimal set of edges that lead to each unique
incoming value in a phi. It does this by iterating up the edges in the
post dominance frontier till the outgoing edges no longer lead to the
same value.
This is a simpler, less general version of #184838 since this can't
optimize away edges that aren't postdominated by the phi. This is fine
the early exit use case though, since we only need to optimize phi nodes
inserted in the latch.
The big advantage over #184838 is that it doesn't require several
depth-first searches to compute the set of reachable nodes, and can be
done entirely by iterating the post-dominator frontier.
[libc][cmake] Add LIBC_TEST_SUBPROCESS_TESTS (#211238)
This replaces the ENABLE_SUBPROCESS_TESTS preprocessor flag with a cmake
variable. By lifting the logic into cmake, we select which test
framework files to build, and also exclude whole tests, if they do not
make sense without subprocess support.
This enables us to fix failures from (now reverted) #209999 and
#210889, as it will let us skip the *exit family of tests. The problem
there was that GPU targets support the *exit entry points (so the
auto-skipping logic does not kick in), but they do not have (and maybe
cannot have?) the functionality necessary to test them.
I convert two libgen tests (the only users of ENABLE_SUBPROCESS_TESTS)
to the new framework.
[compiler-rt][sanitizer_common] Size readlink/getsockopt post-hook unpoison by bytes written (#209209)
# About
`readlink`/`readlinkat` return the number of bytes placed in the buffer
in res and do not NUL-terminate it, and getsockopt writes *optlen bytes
of binary option data. The post-hooks instead sized their POST_WRITE
(MSan unpoison) with internal_strlen(buf) + 1, which reads past what the
kernel wrote -- over- unpoisoning the uninitialized tail (masking real
bugs) and, on a buffer with no NUL, reading out of bounds inside the
runtime. For binary option data an early zero byte instead
under-unpoisons.
Size the unpoison by the actual written length, matching the
corresponding libc interceptors (readlink unpoisons res bytes, and
getsockopt unpoisons *optlen bytes).
Seems to be present since the file's 2013 import.
[Support] parallelFor: enable caller participation (#209690)
`parallelFor` dispatches its work to the thread pool and blocks the
calling thread in the `TaskGroup` destructor until the workers finish.
The caller thus stays idle instead of joining the work as modern parallel
libraries do, and `numactl -C 0-7 ld.lld --threads=8` ends up slower than
`numactl -C 0-8 ld.lld --threads=8`.
Run one worker on the calling thread instead. This requires that no
`parallelFor` body reads `getThreadIndex()`, which is unset on the
caller; the last such user is removed by #209687.
In the jobserver mode: only pool workers acquire job slots, so a
jobserver-limited process may briefly exceed its granted concurrency by
one thread. This is acceptable, better than pessimizing the common
non-jobserver case, and parallelFor is unused by jobserver users.
[DebugInfo] Don't assert on missing template parameter names (#211412)
The DWARF verifier reconstructs simplified template names through
DWARFTypePrinter to compare them against the original DW_AT_name. On
malformed input, a template parameter can have no recoverable name,
which tripped assert(RawName) and aborted instead of letting the
verifier report the problem.
Assisted-by: Claude
rdar://182715403
[X86][CCMP] Fix invalid CCMP emission (#211161)
This patch ports AArch64's negation-aware conjunction algorithm to fix
invalid CCMP emission when OR nested inside an AND.
Example: https://godbolt.org/z/ave7f61hK
Before the change, the above case returns 5 rather the 9 when CCMP
enabled.
Assisted-by: Claude Opus 4.8