[ELF] -r: Don't let a weaker offset-0 R_RISCV_ALIGN suppress ALIGN synthesis (#198147)
PR #151639 skipped synthesizing the section-start R_RISCV_ALIGN whenever
any R_RISCV_ALIGN existed at offset 0, regardless of its alignment. This
works with newer LLVM integrated assembler (#150816).
However, older MC and GNU Assembler as of today
(https://sourceware.org/bugzilla/show_bug.cgi?id=33236) can carry a weak
offset-0 R_RISCV_ALIGN (addend 2 => align 4) while its real alignment
requirement comes from a `.option norelax` .balign, which emits no
relocation.
Fix the condition to not suppress synthesis.
Link: https://sourceware.org/bugzilla/show_bug.cgi?id=33236#c4
[lldb] Recheck connection state in webinspector-wasm EnsureConnected (#198701)
m_remote_platform_sp can be non-null while the remote is disconnected
(PlatformWasm::ConnectRemote installs the pointer before the connect
call). Also check IsConnected() so a prior failed connect doesn't make
EnsureConnected falsely report success.
[clang] Don't cutoff parsing when load C++ named module failed (#187858)
Since https://github.com/llvm/llvm-project/pull/173130, clang convert
module name pp-token sequence into a annot_module_name token for C++20
module/import directive. This PR follows the changes and correct the
module name handling in clangd.
This PR avoid parsing cutoff when hit an C++ named module loading.
Fixes https://github.com/llvm/llvm-project/issues/181358.
Signed-off-by: yronglin <yronglin777 at gmail.com>
[clang][tooling] Handle C++20 annot_module_name in syntax tokens (#198544)
The token collector will ignore all the annotation tokens, but IIUC, the
annot_module_name shoulde not be ignored.
Signed-off-by: yronglin <yronglin777 at gmail.com>
[dsymutil] Update modules test for divergence between the two linkers (#198661)
The parallel linker keeps DW_AT_GNU_dwo_id on linked CUs while the
classic linker drops it. Gate the four `CHECK-NOT: DW_AT_GNU_dwo_id`
assertions to a CLASSIC-only prefix so the test reflects the actual,
intended behavior of each linker.
[AMDGPU] Implement -amdgpu-spill-cfi-saved-regs
These spills need special CFI anyway, so implementing them directly
where CFI is emitted avoids the need to invent a mechanism to track them
from ISel.
Change-Id: If4f34abb3a8e0e46b859a7c74ade21eff58c4047
Co-authored-by: Scott Linder scott.linder at amd.com
Co-authored-by: Venkata Ramanaiah Nalamothu VenkataRamanaiah.Nalamothu at amd.com
[AMDGPU] Implement CFI for CSR spills
Introduce new SPILL pseudos to allow CFI to be generated for only CSR
spills, and to make ISA-instruction-level accurate information.
Other targets either generate slightly incorrect information or rely on
conventions for how spills are placed within the entry block. The
approach in this change produces larger unwind tables, with the
increased size being spent on additional DW_CFA_advance_location
instructions needed to describe the unwinding accurately.
Change-Id: I9b09646abd2ac4e56eddf5e9aeca1a5bebbd43dd
Co-authored-by: Scott Linder <scott.linder at amd.com>
Co-authored-by: Venkata Ramanaiah Nalamothu <VenkataRamanaiah.Nalamothu at amd.com>
[Clang] Default to async unwind tables for amdgcn
To avoid codegen changes when enabling debug-info (see
https://bugs.llvm.org/show_bug.cgi?id=37240) we want to
enable unwind tables by default.
There is some pessimization in post-prologepilog scheduling, and a
general solution to the problem of CFI_INSTRUCTION-as-scheduling-barrier
should be explored.
Change-Id: I83625875966928c7c4411cd7b95174dc58bda25a
[AMDGPU] Emit entry function Dwarf CFI
Entry functions represent the end of unwinding, as they are the
outer-most frame. This implies they can only have a meaningful
definition for the CFA, which AMDGPU defines using a memory location
description with a literal private address space address. The return
address is set to undefined as a sentinel value to signal the end of
unwinding.
Change-Id: I21580f6a24f4869ba32939c9c6332506032cc654
Co-authored-by: Scott Linder <scott.linder at amd.com>
Co-authored-by: Venkata Ramanaiah Nalamothu <VenkataRamanaiah.Nalamothu at amd.com>
[AMDGPU] Implement CFI for non-kernel functions
This does not implement CSR spills other than those AMDGPU handles
during PEI. The remaining spills are handled in a subsequent patch.
Change-Id: I5e3a9a62cf9189245011a82a129790d813d49373
Co-authored-by: Scott Linder <scott.linder at amd.com>
Co-authored-by: Venkata Ramanaiah Nalamothu <VenkataRamanaiah.Nalamothu at amd.com>
[MC][Dwarf] Add custom CFI pseudo-ops for use in AMDGPU
While these can be represented with .cfi_escape, using these pseudo-cfi
instructions makes .s/.mir files more readable, and it is necessary to
support updating registers in CFI instructions (something that the
AMDGPU backend requires).
Change-Id: I763d0cabe5990394670281d4afb5a170981e55d0
[MIR] Error on signed integer in getUnsigned
Previously we effectively took the absolute value of the APSInt, instead
diagnose the unexpected negative value.
Change-Id: I4efe961e7b29fdf1d5f97df12f8139aac12c9219
[OpenMP][OMPIRBuilder] Fix nondeterministic dead block removal
The openmp-cli-fuse02.mlir test can fail nondeterministically when
fuseLoops leaves a dead block in the generated function. On AArch64 this
was reproduced as omp_omp.loop.cond3 being emitted with no predecessors,
which breaks CHECK-NEXT in the MLIR LLVM IR translation test.
The issue is in removeUnusedBlocksFromParent. It used
SmallPtrSet::remove_if while HasRemainingUses also queried the same set.
SmallPtrSet iteration order depends on pointer addresses, which can vary
with ASLR, allocation order, or object layout. Erasing one block while
walking the set can therefore change the keep/erase decision for blocks
visited later. The older make_early_inc_range form had the same underlying
defect.
Fix this by collecting all blocks that still have external uses before
erasing any of them. This evaluates every block against the same snapshot
of the erase set and removes the iteration-order dependency.
[4 lines not shown]
[MLIR][CMake] Downgrade ocloc not found diagnostic from WARNING to STATUS (#198296)
When ocloc is not found, the CMake configuration emits a WARNING which
can be noisy for users who have no interest in Intel XeVM native binary
compilation (e.g., those targeting only AMDGPU or NVPTX). Downgrade the
diagnostic to STATUS since this is an expected configuration when ocloc
is not installed.
For example:
```bash
CMake Warning at /llvm-project/mlir/lib/Target/LLVM/CMakeLists.txt:246 (message):
ocloc not found, MLIRXeVMTarget will not be able to use ocloc for native
binary compilation.
```
[libc++] Refactor `std::midpoint` tests and add constraint checks (#175388)
Refactor the `std::midpoint` tests and replace the verify test with
constraint checks.
[Offload] Fix llvm-gpu-loader after new argument (#198681)
Summary:
New argument added but was not included here. This gets out of sync just
because there's no reasonable way to build offload and this tool, it's
an unsolvable phase ordering problem so we just dlopen it.
Fix use-after-free in IOTransport::OnRead on client disconnect (#198548)
When an MCP client disconnects (EOF), `IOTransport::OnRead` called
`handler.OnClosed()` before resetting `m_read_handle`. The MCP server's
`OnClosed` handler erases the client from `m_instances`, destroying both
the transport (`this`) and the binder (`handler`). The subsequent
`m_read_handle.reset()` then accessed the destroyed transport's member,
causing a use-after-free (SIGSEGV).
* thread #1, stop reason = signal SIGSEGV: address not mapped to object
(fault address=0x28)
* frame #0: 0x00007ff5d4d5afda
liblldb.so.23.2`lldb_private::transport::IOTransport<lldb_protocol::mcp::ProtocolDescriptor>::OnRead(lldb_private::MainLoopBase&,
lldb_private::transport::JSONTransport<lldb_protocol::mcp::ProtocolDescriptor>::MessageHandler&)
+ 1274
frame #1: 0x00007ff5d1140ad8
liblldb.so.23.0`lldb_private::MainLoopPosix::Run() + 408
frame #2: 0x00007ff5d1760c1c
liblldb.so.23.0`std::thread::_State_impl<std::thre
[14 lines not shown]
[alpha.webkit.UncountedCallArgsChecker] Check arguments of CXXConstructExpr (#198454)
Check arguments of CXXConstructExpr like CallExpr.
This PR fixes a subtle bug in isCtorOfRetainPtrOrOSPtr that it was missing a check for OSObjectPtr, and it was getting an empty string for the name when getting called on a CXXConstructorDecl as well as similar bugs in isCtorOf* functions.