[LLVMOffload] Fix LLVMOffload tests from running on Intel in #212373 (#216187)
Offloading via LLVM currently does not support Intel GPUs, this disables
running the tests for them.
Fixes the buildbot error from #212373
[SLP]Release copyable operand deps on duplicate parent-phi lanes
Non-scheduled entries feeding a phi may repeat a def across lanes. The
scheduler skipped duplicate parent-phi user lanes entirely, so per-column
copyable scheduling data was never released and the copyable bundles never
became ready.
Fixes #216146
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/216186
Use static_pointer_cast to do SyntheticChildrenSP -> ScriptedSyntheticChildrenSP (#216181)
FormatManager::GetSyntheticForType was taking a pointer out one shared
pointer and making a new shared pointer referring to it which messes up
the lifecycle of the object.
This is just a little thinko from the original implementation. We do the
same thing in several other places in the TypeCategory, etc. and it's
done correctly in all the other places.
I'm not adding a test here because trying to guess what you have to do
to cause one or the other shared_pointer to get their reference count to
0 isn't particularly stable.
The testing for SBTypeSynthetic is pretty minimal - it would be better
to write a complete test for this class, which would have tripped this.
But that's a bigger task, and I want to get this obvious crasher fix in
now.
[2 lines not shown]
[X86] Use a large-model call for __tls_get_addr
The x86-64 ELF TLSGD and TLSLD sequences currently use a PLT32 call
to __tls_get_addr for every code model. The call can overflow in the
large code model when the PLT is more than 2 GiB away.
Use the same relocation strategy as GCC for large-model PIC: materialize
the GOT base with GOTPC64, materialize __tls_get_addr with PLTOFF64, and
call it indirectly. This changes only x86-64 LP64 ELF PIC code using
the large code model.
Assisted-by: Codex
[DWARFLinker] Keep address-independent block attributes in the type unit (#215932)
cloneBlockAttr dropped every block and exprloc attribute whose DIE was
placed in the artificial type unit. The intent was to discard location
expressions that resolve against a single origin compile unit, since a
type unit is shared by every unit referencing the type, but the check
was incorrectly applied to all block-form attributes.
Clang encodes DW_AT_data_member_location as DW_FORM_block1 at DWARF 2
and as a constant from DWARF 3 onward, so at DWARF 2 every member and
inheritance offset of a deduplicated record collapsed to zero. This
caused LLDB to crash when trying to build types using the wrong offsets,
but that's a separate issue.
Drop only expressions that carry a target address or reference a base
type DIE, which are the cases the type unit cannot resolve.
[lld][ELF][x86-64] Do not relax large-model TLS sequences
GCC uses an indirect PLTOFF64 call to __tls_get_addr for large-model
TLSGD and TLSLD sequences. These sequences do not match the fixed-size
psABI templates that lld rewrites when relaxing TLS to IE or LE.
Detect the PLTOFF64 relocation following TLSGD or TLSLD and preserve the
original sequence instead of rewriting unrelated instruction bytes.
Assisted-by: Codex
[RISCV] Support -march=native (#215939)
-march=native is how to do a native compilation on X86 so it is included in the
build scripts of many projects. ARM and AArch64 also support this
probably for compatibility with X86.
This patch does the same for RISC-V. If -march=native is provided by
itself, I treat it like -mcpu=native. If -mcpu is also provided then the
-mcpu will be used only for -mtune and the ISA string will derive from
the host CPU.
Assisted-by: Claude
[RISCV] Add mvendorid/marchid/mimpid values for SiFive P870-D. (#216106)
You can double check the numbers against values published here
https://camel-cdr.github.io/rvv-bench-results/sifive_p870/data/cpuinfo.txt
I don't have an official doc link for this from SiFive. These are not
the only possible values for P870-D. We may need to support multiple
values for a CPU in the future.
[GlobalISel] Port computeNumSignBits for G_SAVGFLOOR/G_SAVGCEIL (#216093)
Ports the ISD::AVGCEILS / ISD::AVGFLOORS case from
SelectionDAG::ComputeNumSignBits over to
GISelValueTracking::computeNumSignBits.
Part of #150515.
Unlike the SelectionDAG version, this sets FirstAnswer and breaks rather
than returning directly, so the known-bits fallback at the end of
computeNumSignBits still applies. That matters for the pre-existing
constant-operand tests, where the known bits are fully determined and
yield more sign bits than min() of the operands does; returning early
would regress them.
Claude Code helped me navigate the codebase and write the PR
description.
[lldb] Search for a corefile's images before loading any of them
A userland or kernel corefile can list hundreds of images, and searching for
one can shell out to a symbol server or fetch over the network. Searching for
them one at a time is where loading such a corefile spends its time.
Add a batch form of SymbolLocator::Locate that runs the searches on the
debugger's thread pool, gated on target.parallel-module-load. Results come
back in the order the requests were given, since that order decides the
Target's module order. Only the results are ordered, and anything a search
reports to the user arrives in whatever order the searches finish in.
Only the plugin searches run concurrently, so a platform hook does not have to
be thread safe to take part, and reading a binary's UUID out of memory stays
on the calling thread.
Setting up a platform binary can replace the Target's platform and dynamic
loader, and now happens for every image before any of them is searched for, so
the platform a corefile asks for is the one all of its images are searched
[4 lines not shown]
[lldb] Consult the platform before the symbol locator plugins (NFC) (#215392)
A symbol locator plugin has no Platform to consult, so a platform that knows
where its binaries live cannot take part in a search. The only way to reach
one is Platform::GetSharedModule, which also creates the module and registers
it, so the lookup cannot be reused by a caller that wants to search for many
binaries before creating any.
Add a hook that only answers where the files are. An answer ends the search,
so an override owns what the plugins would otherwise have been asked for.
No platform overrides it yet. A follow-up moves PlatformDarwinKernel's kext
and kernel index lookups behind it.
Assisted-by: Claude
CodeGen: Add getDefBlock helper
A reasonable number of places check getVRegDef just to
return the parent block, so introduce a helper for it.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[Flang] Avoid crash on invalid EQUIVALENCE objects (#215979)
An invalid EQUIVALENCE statement may introduce a symbol that is not a
data object into later offset computation. ComputeOffsetsHelper assumes
such symbols have ObjectEntityDetails when assigning COMMON block
information, which can cause a crash after a semantic error.
Check for ObjectEntityDetails before accessing object-specific
information to keep error recovery paths safe.
Test coverage
- Add a regression test for using a subroutine name as an EQUIVALENCE
object.
Tests:
- llvm-lit -v flang/test/Semantics/equivalence-non-data-object.f90
Co-authored-by: yixiao <yixiao at hygon.cn>
[Modules] Exclude InstrumentorRuntimeHelper.h from LLVM_Transforms (#215843)
7964b66bf55d53f7a528a8153c005bee0614a3d7
(https://github.com/llvm/llvm-project/pull/199329) added
`llvm/Transforms/IPO/InstrumentorRuntimeHelper.h` under the umbrella
directory of the `LLVM_Transforms` clang module. That header is not a
normal C++ API header: it is read as a string at build time (via
`file(READ)` in CMake) and embedded into the instrumentor runtime, and
it includes the C standard headers
`<stdint.h>`/`<string.h>` inside an `extern "C"` block. In Swift's C++
interoperability mode, the includes resolve to the C++
`std_stdint_h`/`std_string_h` modules, which cannot be imported within
an `extern "C"` linkage specification.
```
InstrumentorRuntimeHelper.h:21:1: error: import of C++ module 'std_stdint_h' appears within extern "C" language linkage specification
17 | #ifdef __cplusplus
18 | extern "C" {
| `- note: extern "C" language linkage specification begins here
[9 lines not shown]
[lldb] Fix dotest.py --help (#216131)
Fixes the following `--help` bug I ran into:
```
% python3 ./lldb/test/API/dotest.py --help
Traceback (most recent call last):
File "path/to/llvm-project/lldb/test/API/dotest.py", line 8, in <module>
lldbsuite.test.run_suite()
File "path/to/llvm-project/lldb/packages/Python/lldbsuite/test/dotest.py", line 1099, in run_suite
parseOptionsAndInitTestdirs()
File "path/to/llvm-project/lldb/packages/Python/lldbsuite/test/dotest.py", line 318, in parseOptionsAndInitTestdirs
configuration.cmake_build_type = args.cmake_build_type.lower()
AttributeError: 'NoneType' object has no attribute 'lower'
```