[LLVM] Precise error message for intrinsic signature verification (1/n) (#196802)
Generate more precise error message when intrinsic signature
verification fails. Keep track of the current position/component of the
intrinsic signature being checked and print a more descriptive error
message which includes the position/element of the signature that failed
and the reason it failed.
Note that not all cases in `matchIntrinsicType` generate errors, so have
a temporary fallback to keep generating a generic error message in those
cases. This fallback will be eventually removed.
Added a C++ unit test for testing intrinsic struct return type that is
either an identified struct or a packed struct, as these cases cannot be
created from a .ll file directly (since autoupgrade in the parser fixes
them up).
[SelectionDAG] Fix miscompile in known-0/1 setcc fold with XOR (#196804) (#197767)
When simplifySetCC folds `(xor X, C) != 0` (where the XOR result is
known 0/1) into `TRUNCATE(XOR X, C)`, later DAG combines can incorrectly
fold the XOR back into its source operand, losing the NOT semantics.
This causes the x86 backend to test the original value instead of the
XOR result, inverting the condition and producing wrong code.
Fix by folding `(xor X, C) ==/!= N1` directly into `setcc(X, N1^C,
cond)` instead of returning TRUNCATE(XOR). The SETCC form is canonical
and immune to the problematic DAG combine.
Fixes #196804.
Revert "[lldb] Make CommandObject::GetTarget filter out the dummy target (#198026)" (#198325)
This reverts commit d90baa054dfc7d9f53148e4739effbf9fd7ac27a.
Fails in CI in `TestMultipleBinaryCorefile.py` when running `image list
-g` in `test_corefile_binaries_dsymforuuid` because `TargetModulesList`
currently asserts we have a target even with the `-g` flag set.
Original PR https://github.com/llvm/llvm-project/pull/198026
[clang-doc] Removed OwnedPtr alias
The alias served a purpose during migration, but now conveys the wrong
semantics, as the memory these pointers reference is interned inside
a local arena, and doesn't convey any sort of ownership.
[clang-doc] Use distinct APIs for fixed arena allocation sites
Typically, code either always emits data into the TransientArena or the
PersistentArena. Use more explicit APIs to convey the intent directly
instead of relying on parameters or defaults. We were not always
consistent about this.
[PAC][ELF] Support R_AARCH64_AUTH_TLSDESC_CALL relocation
The R_AARCH64_AUTH_TLSDESC_CALL is introduced to allow linker relaxation of
AUTH TLSDESC call sequences for non-preemptible undefined weak symbols.
The lld patch introducing the relaxation: #194636
Corresponding ARM docs PR: https://github.com/ARM-software/abi-aa/pull/395
Replace MarkerRange::truncate with new constructor
`truncate` was ok before this patch, but now it is unclear what
happens if the original `MarkerRange` had `ShowExclusive==true`. In
that case, it seems like maybe we should end up with a range marking
the characters before and after the one character, but instead we
always end up with a single marker at just the one character.
Currently, `truncate` is never called for that case, but it is better
to keep the API clear for the future. Constructing an entirely new
`MarkerRange` makes it clearer to me that it knows nothing about the
old `MarkerRange`'s `ShowExclusive`. If needed later, we can add a
`ShowExclusive` parameter to the new constructor.
[clang-doc] Update type aliases (#190425)
Many of the type aliases we introduced to simplify migration to arena
allocation are no longer relevant after completing the migration. We
can use more relevant names and remove dead aliases.
[clang][modules] Remove `ModuleManager` in-memory buffers (#194753)
The last remaining undesirable `FileManager` usage in
`ModuleManager::addModule()` is the lookup in the in-memory buffers map.
This PR merges that functionality with the `InMemoryModuleCache`,
simplifying the code and removing unnecessary file system access via
`ModuleManager::lookupBuffer()`.
This is also useful downstream, where we already use the
`InMemoryModuleCache` for PCMs loaded from CAS, but don't have an
explicit way to represent the PCM location in `ModuleFile{Name,Key}`.
[X86] LowerBUILD_VECTORvXi1 - attempt to fold as VPTESTMB(BUILD_VECTOR_vXi8(X),1) for v2i1/v4i1/v8i1 types (#198293)
Extends #198166 to handle cases where we need to BUILD_VECTOR using vXi8 smaller than 128-bits
[SPIR-V] Support 1x1 result in matrix multiply combiner (#198091)
Emit a copy instead of G_BUILD_VECTOR for the scalarized 1-element
result, and skip extractelement when storing a 1-element vector to a [1
x T] array
Enable the previously-disabled 1x2 * 2x1 test
[libc] Add POSIX regex stub implementation and build infrastructure (#196995)
Added the four POSIX regex entrypoints (regcomp, regexec, regerror,
regfree) and registered them for x86_64, aarch64, riscv, and arm.
regerror is fully implemented with all 13 POSIX error code strings. The
other three are stubs backed by simple string matching to validate the
build pipeline end-to-end.
This implementation is restricted to full-build mode
(LLVM_LIBC_FULL_BUILD) to avoid ABI compatibility risks with system
headers and internal state management in overlay mode.
New files:
* include/regex.yaml and regex-macros.h for header generation
* regex_t, regoff_t, regmatch_t type headers
* src/regex/ with all four entrypoints
* test/src/regex/ with regerror and basic round-trip tests
All 7 tests pass.
[libc] Enable arpa/inet.h entrypoints in overlay mode (#198270)
Two of these depend on in_addr_t and struct in_addr, but these are types
whose layout is defined by POSIX and OS ABIs, and they are simpler than
struct sockaddr_in, which we enabled in #195035.
[libc] Demote compiler check error to a warning (#198033)
Summary:
This check exists to encode the policy that this is only intended to be
built with a just-built compiler. In practice it's a little too strict
and breaks pretty much every six months when the version bumps or when
people try to build a separate patch. Just demote to a warning.
[offload] Add properties parameter to olLaunchKernel (#197897)
Introduce a properties argument to olLaunchKernel to enable future
extensions.
This change adds initial extension for cooperative kernel launch.
The change restores the functionality from:
https://github.com/llvm/llvm-project/pull/184343
which was later reverted in:
https://github.com/llvm/llvm-project/pull/197463
#184343 modified the API, and between the last rebase and the final
merge, additional tests were added
upstream(https://github.com/llvm/llvm-project/pull/193927) that still
relied on the previous API version.
Diff between this PR and #184343
```
diff --git a/offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp b/offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp
[34 lines not shown]