[AArch64] Fix strict weak ordering violation in regalloc hints sort. (#192055)
This fixes an error with expensive checks after landing #190139.
The issue was:
Error: comparison doesn't meet irreflexive requirements, assert(!(a <
a)).
because it could have previously returned 'true' in the ordering
function if registers A and B were equal.
Also made NFC change to rename 'HandleMatchCmpPredicateHint' ->
'HandleDestructivePredicateHint' (that was missed in the review).
[lldb] Fix synthetic frame identity loss during incremental fetches (#191903)
When `SyntheticStackFrameList::FetchFramesUpTo` is called incrementally,
PC-less synthetic frames can end up with identical `StackID` values.
This happens because `num_synthetic_frames` is reset to zero on each
call, handing out duplicate call frame addresses. Since PC-less frames
all share `LLDB_INVALID_ADDRESS` as their PC, the `StackID` equality
check cannot distinguish them, and `ExecutionContextRef` resolves the
wrong frame.
The fix counts existing synthetic frames in `m_frames` before starting
the fetch loop so new frames receive unique call frame addresses.
[DWARFYAML] Add support for v5 debug_line entry formats (#191358)
This lets us specify the *format* of the directory and file name
entries, but not the entries themselves.
[AMDGPU] Add object linking support for LDS and named barrier lowering in the middle end
This is the first patch in a series introducing object linking support for
AMDGPU.
This PR adds the -amdgpu-enable-object-linking flag to enable object linking in
the backend. It also updates the AMDGPULowerModuleLDSPass and
AMDGPULowerExecSync passes to support lowering LDS and named barrier globals
when object linking is enabled.
[OFFLOAD] Fix interop-print test commands (#191969)
Using %libomptarget-run-generic will fail or run an incorrect binary if
the previous %libomptarget-compile becames ignored because there's no
such device. Switching to use %libomptarget-compile-and-run-* which
doesn't have this issue.
Fixes post-merge issue of #191901
[scudo] Do not define some entrypoints on Fuchsia (#191826)
These entrypoints were defined separately in wrappers_c_bionic.cpp
(which Fuchsia did not include in the build) before #190857 and,
therefore, were not exposed to Fuchsia's Scudo clients.
With #190857, they have been merged into the main wrappers_c.cpp file,
removing this separation.
This commit makes them conditionally-defined to not be building for
Fuchsia, to restore the pre-#190857 ABI.
[clang] fix some places where used decls were not marked as referenced (#191848)
Fixes some entities not being marked as referenced despite being used in
source code.
Also ties diagnostic-of-use to such references, because I don't think
there is a reason to have one without the other, even though I can't
think of a diagnosable entity which was not already covered before.
[clang] NFC: Refactor UnsignedOrNone into OptionalUnsigned<T> with enum support (#191828)
This kind optional is simpler to use when it needs to be represented in
a bitfield, because it has an `unsigned` integer representation which
avoids overflows. This applies to enums as well.
This also adds a single use of this new functionality, migrating users
of `std::optional<NullabilityKind>`
This optional used to be represented as two members in a bitfield, and
this simplifies things down to one.
[CIR] Inheriting Constructor/inheriting ctor inlining lowering (#191467)
In cases with inheritance/vertual tables/etc, we need to generate a
series of constructors to delegate to. There are a handful slightly
different cases where we need to generate these/generate calls to these,
so this patch does that lowering.
The test check-lines are a bit confusing thanks to the ordering
differences between declarations. However the LLVM/OGCG lines are copy
pasted (plus minor attribute differences), with the exception of the
call to a delegated constructor.
One thing of note here: There is a difference in behavior with the
delegated constructor, which is called out in the test in a comment.
Classic codegen has a bug where it correctly creates the declaration
without arguments (since this constructor is only for initializing the
vtable pointers, arguments aren't necessary). However, when
classic-codegen creates the call, it doesn't omit them.
This isn't a problem there, however in CIR, this causes us to fail the
verifier, so this fixes that in CIR, but leaves it alone in OGCG.
[libc] Add ucontext types and headers (#191789)
Added mcontext_t and ucontext_t types for x86_64 Linux, and the
ucontext.h header definition. Used a dispatcher pattern for mcontext_t
and ucontext_t to support future architecture ports, mirroring the
pattern used in FPUtil.
Definitions are based on the Linux kernel ABI for x86_64.
Co-authored-by: Pavel Labath <pavel at labath.sk>
[clang][CIR][doc] Add auto-generated ClangIR documentation (#190354)
ClangIR has a collection of documentation pages that we want to upstream
as part of the main clang documentation. These pages are originally
available at https://clangir.org/, maintained in the [incubator
repository](https://github.com/llvm/clangir) which has been archived a
few months ago.
This patch makes a first step towards the upstreaming of ClangIR
documentation. The pages included in this patch are those automatically
generated from MLIR TableGen. Specifically, this patch makes the
following changes to the main clang documentation tree:
- It adds a new subdirectory `CIR` under `clang/docs` to hold all
ClangIR documentation. There are already 3 ClangIR design documents put
under `clang/docs`, and this patch moves all of them to this new
subdirectory.
- It touches the necessary CMake files and Python scripts to:
- Generate ClangIR language reference automatically from MLIR TableGen
[2 lines not shown]
[OMPIRBuilder] Pass work loop type in ident flags (#189347)
Flang uses the OMPIRBuilder to lower OpenMP constructs to LLVM IR.
When dealing with work sharing constructs, such as DO, DISTRIBUTE or
SECTIONS/SECTION, OMPIRBuilder needs to construct the call to the OpenMP
runtime, typically `__kmpc_for_static_init` or
`__kmpc_dist_for_static_init`.
The first passed flag to these functions is the `ident_t` struct,
defined in `kmp.h`. Most of the arguments are reserved for usage in
Fortran and unused in `openmp`. However, the `flags` argument is used
throughout the code base to identify specific constructs, such as the
type of work sharing construct.
In https://github.com/llvm/llvm-project/issues/112545, it was identified
that Flang does not provide the correct `ident_t` flags when calling
into e.g. `__kmpc_for_static_init`, causing the following runtime
warning to appear when the OpenMP Tools Interface is used:
[40 lines not shown]
[UpdateTestChecks] Add --filter/--filter-out support to update_mir_test_checks.py (#191059)
These options were already accepted by the script but silently ignored.
This patch makes them functional, consistent with
update_llc_test_checks.py.
Co-Authored-By: Claude Sonnet 4.6 <noreply at anthropic.com>
[Clang] Enable multilib library support for Linux/Windows (#188584)
Summary:
This PR standardizes the logic used in the baremtal build to the common
toolchain interface. We then use this to handle the support in Linux and
Windows.
The multilib functionality allows us to select variant libraries based
off of a configuration file. For example, if the `multilib.yaml` file
detects `-fsanitize=address` it will automatically use the libraries
inside of `asan/` instead. These are layered so they do not necessarily
need to be complete library builds. More documentation can be found at
https://clang.llvm.org/docs/Multilib.html.
The motivation for this is so platforms like ROCm can use a more
standard way to ship debug / asan variants of libraries like OpenMP or
similar for both GPU an CPU targets.
[lldb] Fix: Disable shared build dir when testing with PDB (#190991)
The mechanism to disable `SHARED_BUILD_TESTCASE` for tests
that set `TEST_WITH_PDB_DEBUG_INFO` doesn't work. The property
was set on the wrong object. This patch fixes it and moves the assignment
after the for-loop, since the respective dict only exists there.