[lldb][Target] Allow eLanguageTypeAssembly to use ScratchTypeSystemClang (#183771)
After cleaning up some of our `LanguageType`/`SourceLangage`
round-tripping (see `7f51a2a47d2e706d04855b0e41690ebafa2b3238`), a CU
with `DW_LANG_MIPS_Assembler` will get a language type of
`eLanguageTypeAssembly` (as opposed to `eLanguageTypeMipsAssembler`).
Reason being that there is no `DW_LNAME_` (DWARFv6 language code) for
`MIPS Assembler`, only for generic `Assembly`. So it's not possible to
round-trip cleanly between pre-DWARFv6 and DWARFv6 language codes, which
LLDB relies on for storing language types (and will lean into more
heavily in the future). This broke a special provision we have where we
allow `ScratchTypeSystemClang` to be used when evaluating expressions in
assembly CUs (i.e., CUs where the debug-info explicitly sets the
language to assembly).
If we ever want to distinguish MIPS from other Assembly, the proper way
to do so is introduce a `DW_LNAME_Mips_Assembler`. For now, this patch
adds another case for `eLanguageTypeAssembly` in
`GetScratchTypeSystemForLanguage`.
[6 lines not shown]
[LAA] Fix recordAnalysis receiving null Instruction pointer (#183512)
When a memory-reading or memory-writing instruction is not a
LoadInst/StoreInst, the dyn_cast to Ld/St returns nullptr, which is then
passed to recordAnalysis. This causes the optimization remark to fall
back to the loop header location instead of pointing at the actual
problematic instruction.
Pass &I (the actual Instruction) instead.
[clang][Modules] Handle relocated modules during implicit module builds (#181836)
* To avoid the build time overhead of checking for relocated modules,
only check it once per build session.
* Enable relocated module checks in the dependency scanner.
* Add remarks to know when this is happening with `-Rmodule-validation`
This check is necessary to be able to handle new libraries appearing in
earlier search paths. This is a valid scenario when dependency info
changes between incremental builds of the same scheme, thus new build
sessions.
It is still malformed to expect new versions of libraries to be added
within the same build session.
resolves: rdar://169174750
[APINotes] Refactor APINotesReader to propagate llvm::Error (#183812)
**Context:** While exploring the `APINotes` codebase, I found 54 `FIXME`
comments in `APINotesReader.cpp` stating: `// FIXME this drops the error
on the floor.`
This happened because the internal `read*Block` methods returned a
boolean, and the `APINotesReader` constructor reported failures via a
`bool &Failed` out-parameter. This forced the actual `llvm::Errors`
returned from the bitstream cursor to be silently consumed with
`consumeError()`.
This patch refactors this behavior to properly propagate the errors up
the stack.
**Changes in this patch:**
**1.** Changed all `read*Block` methods in
`APINotesReader::Implementation` to return `llvm::Error` instead of
[12 lines not shown]
[flang][OpenMP] Support custom mappers in target update to/from clauses (#169673)
Implement support for the OpenMP `mapper` modifier on `target update` `to` and
`from` clauses in Flang.
Semantic name resolution is extended to bind the mapper symbol for
`OmpClause::To` and `OmpClause::From` via a shared `ResolveMapperModifier`
helper. Lowering is extended in `ClauseProcessor` with a `getMapperIdentifier`
template helper to extract the mapper name for both `map` and `target update`
clauses and forward it to `omp.map_info`.
Fixes #168701.
Reviewed By: TIFitis, kparzysz
Assited By: Copilot( For review and articulations of messages)
[SystemZ][z/OS] Remove use of subsections.
HLASM has no notion of subsections. There are several possible solutions
how to deal with this. However,
- using a different section introduces a lot of relocations, which slows
down the binder later
- emitting the PPA1 after the code changes the location which may break
existing tools
The choosen solution is to record the PPA1 data, and emit them at the
end of the assembly into the code section. This solves both issues,
at the expense of having to do some bookkeeping.
This change moves the position of the PPA2, too, but this is less
critical.
[clang][ssaf] Add `JSONFormat` serialization support for `LUSummary` and `LUSummaryEncoding`
This change extends `SerializationFormat` and `JSONFormat` with APIs to
read and write `LUSummary` and `LUSummaryEncoding`, completing the
serialization interface for both TU-level and LU-level summaries. As
part of the implementation, common serialization infrastructure has been
extracted into `JSONFormatImpl.{cpp, h}`, eliminating duplication across
the TU and LU translation units. A comprehensive `LUSummaryTest` suite
has been added to test `LUSummary` and `LUSummaryEncoding`, mirroring
the structure of the existing `TUSummaryTest` suite. Shared testing
infrastructure has been extracted into `JSONFormatTest.{cpp, h}`.
[mlir][bazel] Fix build after moving AMX into X86 in #183717. (#184165)
This PR fixes the bazel build that got broken by #183717, which moved
the AMX dialect into the X86 dialect. The fix consists of replicating
the changes from the CMake files into BUILD files as usual; in this
case, mostly removing the AMX dialect targets, adding a few new
references to the corresponding X86 targets, and adding a few new
dependencies to the existing X86 targets due to the new code.
Signed-off-by: Ingo Müller <ingomueller at google.com>
[LinkerWrapper] Fix a bunch of minor issues and typos (#183679)
Summary:
A bunch of small issues found through linting and LLM checking.
- Broken sort comparator that violated strict weak ordering (UB)
- SearchLibrary corrupting .lib filenames via erroneous drop_front()
- Hardcoded x86_64-unknown-linux-gnu host triple in AMDGPU fatbinary
- OffloadFile loop variable shadowing its own type, causing std::move on
the type rather than the variable
- GetDeviceInput calling exit() directly instead of returning Error
- Redundant double-wrapping of DerivedArgList
- Various typo and style fixes
[X86] known-never-zero.ll - add additional demanded elts vector test coverage (#184159)
vector variants of existing tests where we only demand 1 element for the
never zero test
[flang] Inline trivial scalar allocatable assignments in HLFIR-to-FIR (#183177)
For trivial scalar allocatable assignments (non-polymorphic,
non-character, non-array, non-temporary), inline the assignment directly
instead of calling the `_FortranAAssign` runtime. The inlined code
checks whether the allocatable is already allocated: if so, it stores
directly; otherwise, it allocates memory via `fir.allocmem`, stores, and
updates the box descriptor. The if-branch is necessary to handle both
cases:
```fortran
integer, allocatable :: k
allocate(k)
k = 42 ! already allocated: store directly
```
```fortran
integer, allocatable :: k
k = 42 ! not allocated: allocmem, store, update box
```
[lldb][Process/FreeBSDKernelCore] Fix RegisterContext for arm64 (#183947)
Since `pcb.lr` always contains the value of pc, `gpr_lr_arm64` should be
unavailable. This also fixes the case where `gpr_pc_arm64` displays sp
not lr field in pcb.
Reported by: jrtc27
Fixes: 4f0eb3d3af443ff54425ebafce83b87ee61ee403 (#180222)
---------
Signed-off-by: Minsoo Choo <minsoochoo0122 at proton.me>
[mlir][VectorOps] Fold extract on constant_mask (#183780)
Fold `vector.extract(vector.constant_mask)` to `vector.constant_mask` if
possible.
If the static position is outside of the masked area, the pattern will
fold to a constant all-false value instead.
Dynamic positions are only supported if the mask covers the entire
vector in that dimension.
Assisted-by: Claude Code
---------
Signed-off-by: Lukas Sommer <lukas.sommer at amd.com>