[lldb] Unload Wasm modules the stub no longer reports (#227814)
When a Wasm engine such as JavaScriptCore reloads a page, the modules it
ran go away and new instances take their place. LLDB kept two kinds of
stale module around.
ProcessGDBRemote::LoadModules never unloads the target's executable,
which no library list includes. A Wasm target has no executable, so
Target::GetExecutableModule falls back to the first module, and the
first module the stub ever reported stayed in the image list for good.
Let the dynamic loader say whether the process runs a main executable,
and have the Wasm loader say it does not.
A module reloaded under the same name matched the module read from
memory at its old address, and LLDB then moved that module to the new
one. That trips an assertion in ObjectFileWasm::SetLoadAddress, and
otherwise leaves a module whose image came from an instance that is
gone. A module read from memory now only matches a spec at the address
it was read from, like ModuleSpec::Matches already does for two specs.
rdar://175013476
[AMDGPU] Fix missed WMMA C-operand co-exec hazard
The gfx1250 WMMA co-execution hazard check treats only A, B and the
SWMMAC index as registers the in-flight MMA still reads. C (src2 of a
non-SWMMAC WMMA) is missing, so a VALU scheduled into the MMA's shadow
can clobber C and the MMA consumes the new value.
This is latent while C is tied to vdst, since the existing D check then
covers it. It miscompiles where the tie does not hold: for
v_wmma_bf16f32_16x16x32_bf16, whose D is narrower than C, and for the
_threeaddr form of any WMMA.
[NFC][lsan] Disable HWASan on key_destructor in detached_thread_dlsym.c (#229266)
Test-only change fixing the test added in
https://github.com/llvm/llvm-project/pull/228930.
In `detached_thread_dlsym.c`, `key_destructor` intentionally runs on the
final (`PTHREAD_DESTRUCTOR_ITERATIONS`) TSD destruction pass after
`HwasanTSDDtor` has called `Thread::Destroy()` and zeroed
`__hwasan_tls`.
Mark `key_destructor` with `__attribute__((no_sanitize("hwaddress")))`.
Fixes https://lab.llvm.org/buildbot/#/builders/51/builds/45276.
Assisted-by: Gemini
[flang][acc] Preserve association status of privatized pointers (#228581)
Privatization allocated a target and copied it even when a Fortran
pointer or allocatable was unassociated or unallocated. That reads
through a null address. The private allocation now follows the original
association status. A reduction stores its initial value only when that
storage exists. The target is copied only when one exists.
Before:
```
%private = fir.allocmem f32
// Box %private into the private descriptor.
hlfir.assign %src to %private temporary_lhs : f32, !fir.heap<f32>
```
After:
```
%private = fir.if %is_associated -> !fir.heap<f32> {
%allocation = fir.allocmem f32
[9 lines not shown]
[CIR][OpenMP] Add support for host_eval so that SPMD kernels can be used
This patch adds support for host_eval so that SPMD kernels and in the future
num_threads etc. can be implemented correctly.
Assisted-by: Cursor / Claude Sonnet 5 High
[mlir] Migrate AMDGPU/ROCDL to targets, not chipset versions
**migration tl;dr:** Replace usages of `amdgpu::Chipset` with `ROCDL::TargetInfo`, ideally move from `chipset=` to `arch=`. If you don't use upstream pipelines, call 'TargetInfo::migrateArchFeaturesToModuleFlags` at the appropriate location.
Further note: if you've got a build pipeline that's getting a `gfxXXX` name from something like `rocm_agent_enumerator`, using a full triple name like the ones you get from `rocminfo` is preferred.
`amdgpu::Chipset` was an awkward hack that was hard to keep up to date
with changes in the compiler/new architectures, and didn't properly
support generic targets (and has been strongly disfavored by the
compiler team).
This PR replaces `amdgpu::Chipset` with `ROCDL::TargetInfo`, a
structure that uses LLVM's TargetParser and the underlying LLVM
features tables to get the real nature of the target being compiled
for.
This also helps MLIR move to
new-style (`-mtriple=amdgpuX.YZ-amd-amdhsa`) over "old
style" (`-mtriple=amdgcn-amd-amdhsa -mcpu=gfxXYZ`) triples.
[36 lines not shown]
[SLP] Clear VectorizableTree in before calling canBuildSplitNode() from tryToReduce() (#220014)
The tree may be left-over from the prior vectorization attempt in this case which can affect the decision.
[DAG] Add basic deinterleave/interleave(poison) -> poison combines. (#228858)
This mirrors the existing combine currently performed for shuffles,
converting a deinterleave or interleave with all undef inputs to a undef
output.
The st3 combine currently sometimes overeagerly triggers first.
[CIR][OpenMP] Add support for host_eval so that SPMD kernels can be used
This patch adds support for host_eval so that SPMD kernels and in the future
num_threads etc. can be implemented correctly.
Assisted-by: Cursor / Claude Sonnet 5 High
[CIR] Lower language address spaces nested in record members (#228934)
TargetLowering now derives from RecordRewritingTypeConverter, so it
rebuilds records whose members reach a language address space and keeps
the rest. This fixes "member type mismatch" for OpenCL and SYCL records
with address-space qualified pointer members.
[AMDGPU] Split the true16 fcopysign pattern by uniformity (#226898)
A uniform 16-bit value already lives in the low half of an SGPR, so it can go straight to V_BFI_B32_e64. Only a divergent VGPR_16 operand needs the widening REG_SEQUENCE, which was ill-formed for the uniform case (operand wider than the lo16 slot it names) and confused DetectDeadLanes.
Fixes: ROCM-31212
[CIR][SSCP] Return null callable region for function declarations (#228641)
Declarations and aliases have empty bodies; returning them made SCCP
treat external calls as never returning and fold their results to
constants.
[lldb] For Mach-O re-export symbols, save target binary FileSpec (#228266)
Mach-O re-export symbols specify the name of the target function to call
AND the binary name to find it in. I didn't correctly save the binary
name in the DataFileCache representation. This change does that, and
adds a new test (only runs on Darwin) which does a `target modules dump
symtab` on a system dylib that has many re-export symbols, then creates
a DataFileCache of that binary, loads a new target using the DFC and
re-executes `target modules dump symtab`, and checks that the output is
identical between them.
rdar://187739510
[clang] Precommit test for auto-init of small struct fields (#229225)
Currently when using the -ftrivial-auto-var-init-max-size flag, record
types are either fully initialized if they are smaller than the max
size, or left fully uninitialized even if they have individual fields
smaller than the max size. This change extends existing tests for
auto-init max size to cover the case where a struct contains a struct
containing a small field, in preparation for changes to automatically
initialize small fields inside structs.
[CIR][OpenMP] Add support for host_eval so that SPMD kernels can be used
This patch adds support for host_eval so that SPMD kernels and in the future
num_threads etc. can be implemented correctly.
Assisted-by: Cursor / Claude Sonnet 5 High