[lldb][test] Use a fake dsymForUUID in tests (#201547)
Our test should not invoke dsymForUUID as it creates an unnecessary
dependency on the OS and is also incredibly slow. For example, all
Crashlog tests on my system run for more than 30s and all of this is
just spent waiting for dsymForUUID to return "not found".
This patch provides a simple dummy dsymForUUID script we set for all
tests. This is automatically picked up by LLDB with the existing
dsymForUUID environment variable. As a result, all crashlog tests which
previously run in total for about 4 minutes with one job, now run in
about 10s.
assisted-by: claude
[SLP]Fix miscompile with mixed sext/zext in disjoint or reduction
matchesShlZExt accepted an alternate zext/sext node, so a sext lane
passed the check and the reduction was folded to a plain wide load,
dropping the sign extension. Reject alt-shuffle operand nodes.
Fixes #230400
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/230534
[offload][nfc] Pull OpenMP's InteropTbl out of PluginManager
PluginManager is shared with OpenACC, so the OpenMP interop table moves
to OmpPluginManager in libomptarget. The OpenMP PM is defined there, and
interop cleanup is registered from initRuntime.
[InstCombine] Mark profiles unknown in foldClampRangeOfTwo (#230297)
Within the function we only have the intrinsic rather than a select from
which to derive profile information. In the test case there is a select
we could derive profile information from, but it gets folded to an
intrinsic which then gets re-expanded into a select, dropping the
profile information in the process.
[NewPM] [AsmPrinter] Correctly query analysis in NewPM and legacy (#230225)
While running llc under NewPM, we may get a crash due to no logic to
correctly query analysis depending whether we run NewPM / legacy
[X86] LowerMSTORE - fix copy+paste assert message typo. NFC. (#230507)
MSTORE can be a compressing store (badly copied from MLOAD which can be
an expanding load).
[OpenACC] Make sure we mark vars as 'used' in OpenACC var references (#230503)
We weren't properly marking variables as 'used', which caused the bug in
issue #230329. There is a function to clean this up at the end of an
expression(CleanupVarDeclMarking) that we would never call as part of
this handling. OpenMP does this correctly, so we do too.
I wasn't able to reproduce it, but the 'invalid var' reference needs to
be set as well, as I believe this will leave Sema in a 'bad' state if we
don't, particularly if the function were to immediately end after the
invalid reference (ActOnFinishFunctionBody asserts here, but it isn't
clear to me we would have run afoul of this).
Fixes: #230329
Test: Make the load/store alloca to volatile to stop promotion (#230426)
This would help making the test checks unchanged in the upcoming alloca
promotion change.
Co-Authored-By: Claude
[AMDGPU] Make named barrier type 1 byte to fix barrier IDs of array elements
Since #209746, a pointer in the barrier address space (15) is the barrier ID,
and the backend reads the ID as `ptr & 0x3F`. But `target("amdgcn.named.barrier", 0)`
is still 16 bytes, so GEP to element `i` of a barrier array adds `16 * i` to the
barrier ID. For example, if `@bars` gets barrier ID 1, `&bars[2]` selects barrier
33 instead of 3.
This PR changes the type to 1 byte, so one array element is one barrier ID.
Fixes LCOMPILER-2898.
[libc] Fix LIBC_LIKELY/LIBC_UNLIKELY and add LIBC_NOINLINE. (#230505)
`__builtin_expect(value, expected)` requires the second argument to be a
constant expression. Previously, `LIBC_LIKELY` and `LIBC_UNLIKELY`
wrapped `__builtin_expect(value, expected)` inside
`details::expects_bool_condition(T value, T expected)`, where `expected`
was a function parameter rather than a constant expression. So the hints
were silently dropped by the compilers.
Also add LIBC_NOINLINE macro to `attributes.h` to outlining slow paths.
[AArch64][llvm] Fix incorrect diagnostic (index/immediate in simm9)
Improve the error message in the simm9 diagnostics and use the word
'immediate' instead of 'index'. This was noticed when creating the
CFLT instructions for Armv9.8-A, but would have caused a lot of
unrelated churn if merged as part of that change.
Co-authored-by: Martin Wehking <martin.wehking at arm.com>
[AArch64][llvm] Improve diagnostics for invalid operands
Return `DiagnosticPredicate` from `isSImm()`, `isImmInRange()`, and
`isUImm12Offset()` so invalid operand types do not produce misleading
immediate range errors, while out-of-range constants retain their
range diagnostics.
Keep the load/store fallback predicate boolean and remove the
CFLT-specific diagnostic workaround. Update affected diagnostic
tests and add prefetch and CFLT regression testcases.
[AArch64][llvm] Fix constant expressions in CMPBR immediate aliases (#230050)
Use the standard immediate parser for CMPBR aliases so that
parenthesized
expressions and explicit unary plus are accepted. This also simplifies
the amount of code required, since we can remove `tryParseAdjImm0_63`,
and reuse code in `AdjImmAsmOperand` which does the same job.
Check immediates in their original ranges and apply the adjustment
when rendering MC operands. Add coverage for constant expressions in
`cbge`, `cbhs`, `cble` and `cbls`.
---
<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
[offload][omp] Use olMemRegister for memory locking (#226450)
Use olMemRegister for dataLock/Unlock operations.
Move OpenMP specific notifyDataMapped/UnMapped to libomptarget
implemented on top of olMemRegister.
Remove all associated interfaces in GenericPluginTy.
Assisted by Claude.
[libc] Implement waitid in sys/wait (#227815)
Implement the standard POSIX.1-2008 / POSIX.1-2024 function `waitid` in
`<sys/wait.h>`, bringing functions declared in `<sys/wait.h>` to 100%
completion.
Fixes #227798
### Notes
- Defines the POSIX `idtype_t` enumeration in `llvm-libc-types` along
with its proxy header.
- In `linux/sys-wait-macros.h`, undefines the kernel `P_*` macros
originating from `<linux/wait.h>` to prevent macro expansion over the
`idtype_t` enum constants.
- Adds unit tests in `libc/test/src/sys/wait/` and live process reaping
integration tests in `libc/test/integration/src/unistd/fork_test.cpp`.
CodeGen: Find PHI sources while rewriting PHIs in SplitCriticalEdge
SplitCriticalEdge scanned every operand of every PHI in Succ twice per
split: once in replacePhiUsesWith to retarget the incoming block, then
again with LiveIntervals to find the registers now coming from the new
block. Collect the source registers while retargeting the operands, so
each split scans Succ's PHIs only once.
Instructions retired in phi-node-elimination, x86_64 -O3, on a generated
chain of N compare blocks branching to a shared PHI block:
N before after after/before
1k 89,072,376 69,208,524 0.78
2k 330,305,622 251,128,551 0.76
4k 1,140,509,526 818,125,849 0.72
8k 4,134,353,260 2,851,571,872 0.69
16k 15,538,463,961 10,437,522,736 0.67
gcc-c-torture compile/20001226-1.c (liveintervals,phi-node-elimination
[5 lines not shown]