[lldb-dap] Validate utf8 protocol messages. (#181261)
I ran into this while debugging a different issue, but when we calcualte
the 'value' field of a variable we were not ensuring the contents were
valid utf8. If assertions are enabled then llvm::json::Value will assert
that the string contains invalid utf8.
To address this I added a wrapper type (`lldb_dap::protocol::String`)
that can be used as a thin wrapper around `std::string` to ensure a
field contains valid utf8. This is now used throughout the
`lldb_dap::protocol::*` types.
[flang][cuda] Fix return value for CUFSetDefaultStream (#181884)
The interface return an integer value but the entry point and lowering
were missing it.
[AMDGPU] Constrain register class during COPY elimination based on their uses (#181909)
When a WMMA scale operand (requiring `VCSrc_b32_Lo256`) was an SGPR that
had been copied from a VGPR, the COPY elimination replaced all uses of
the SGPR with the VGPR but failed to constrain the VGPR to
`vgpr_32_lo256`. This allowed the register allocator to assign a VGPR >=
256 (e.g., $vgpr309), violating the hardware encoding requirement.
[HLSL][Matrix] Allow flattening matrix types in FlattenAccessAndTypeLValue (#177708)
Fixes #177487
This PR adds support for flattening HLSL matrix types in code generation
via `CodeGenFunction::FlattenAccessAndTypeLValue`.
It removes the assertion `assert(!isa<MatrixType>(T) && "Matrix types
not yet supported in HLSL");` and adds a branch for handling
ConstantMatrixTypes which is similar to the VectorType case.
[ThreadSafety][NFC] Cleanup indentation and unnecessary comments (#181896)
This is a follow-up commit to #178952 for indentation and comments
cleanups.
[GISel][X86] Port CSE analysis to NPM (#179815)
As part of #178192 it came up that the `GISelCSEAnalysisWrapperPass`
doesn't seem to have a npm version. This patch adds an npm wrapper
around `GISelCSEAnalysisWrapper`.
[libc] Fix OS when using `-llvm` OS in the triple (#181908)
Summary:
We spoof the OS name for the GPU targets and used to get it form the
'end' of the triple list. Adding `-llvm` makes that now point to `-llvm`
which is not recognized so it fails. Just use the direct index, we
already guard that the triple is the correct size
[mlir][vector] add ApplyReorderMultiReductionDimsPatternsOp tests (#180977)
With the new finer grained populate methods introduced in
8dde3051504cb9ae42e654bbce39001f3946beea (#180750), there was a
discussion about refactoring tests such that only one of the patterns
applies at a time. This commit starts this process by adding the
structure for one of these populate methods. The goal is for the
populate methods to have their own file (each showing inner and outer
reduction); deprecating populateVectorMultiReductionLoweringPatterns and
ApplyLowerMultiReduction; and removing the test file for
mlir/test/Dialect/Vector/vector-multi-reduction-lowering.mlir
Essentially an NFC. It also adds a new transform op for testing the
dialect and which downstream projects may choose to use.
Assisted-By: claude-4.5-sonnet
[Clang][CMake] Fix header target creation (#180609)
The `add_header_target` function was using a `file_list` parameter that
was supposed to capture all the header files that should be added to the
interface library target. However, the parameter was only capturing the
first header file, and the rest of the header files were not being added
to the target properties. I.e. the `get_target_properties` command was
only returning the first header file instead of all the header files.
The commit removes the `file_list` parameter and replaces it with
`ARGN`,
which captures all the header files passed to the function. This ensures
that all the header files are added to the interface library target and
can be accessed through the target properties.
[NFC] `CfiFunctions` are relevant when promoting from the original module only (#181080)
`CfiFunctions` contains only pointers to IR objects in the original
`Module`. When we `promoteInternals`, we try to find such pointers from
the first (exporting) module in the `CfiFunctions` set. That will always
fail (as in, no values will be found) in the first case, when the
exporting module is the merged module. This PR makes it more obvious
that the `CfiFunctions` set is only relevant for the second promotion.
[clang][tests] Fix cross-build test failures on Darwin. (#181805)
Test failures started after
https://github.com/llvm/llvm-project/pull/178077 which introduced
Darwin-specific system checks in several tests, including checks for the
presence of SDKSettings.json.
These tests are intended to validate features in Clang’s driver that
require Clang to target a Darwin platform while running on a Darwin
host. Currently, their execution is gated by the REQUIRES: system-darwin
annotation.
This approach breaks down when running the tests on a cross-compiling
build of Clang on a Darwin host.
If the build does not include any Darwin targets, the tests will still
run (because the host is Darwin) but will fail spuriously due to the
absence of a Darwin target in the build.
[4 lines not shown]
[RISCV] Remove VMConstraint from ri.vzero.v (#181895)
This instruction doesn't have a VM operand.
It only has 1 operand, VD. The way the VMConstraint check is
implemented, if VD is V0 it would compare the last operand to V0. Since
the last operand is VD, this would always match and generate an error.
While I was here, move the encoding related let statements into the
class body for consistency with RISCVInstrInfoV.td.
[mlir][test-ir-visitors] Fix noSkipBlockErasure for blocks providing global context (#181320)
The pass checks if something is pointing to the current block in testNoSkipErasureCallbacks() inside noSkipBlockErasure() callback and erases it if no one is pointing to it. However, it doesn't consider the
case where the current block might be providing global context to other blocks in the same parent region even if no one is pointing to it (see the attached test for an example of this). Erasing this block would then lead to invalid IR. We solve this by dropping intra-block op uses from ops within the same parent region.
Fixes https://github.com/llvm/llvm-project/issues/178099
[SystemZ][z/OS] Remove temporary gnu as output on z/OS
On z/OS, there is only HLASM as system assembler available. Since
all LIT tests are migrated, the temporary option ca now be removed.
[OFFLOAD] Add headers to support complex math for spirv (#179846)
This is to add support for complex operations for OpenMP kernels when
compiled with spirv.
This is the first PR to add support for spirv in OpenMP wrapper headers
to reduce the size of PRs
[OFFLOAD] Extend olMemRegister API to handle cases when a memory block may have been mapped outside of liboffload. (#172226)
This PR adds extends liboffload olMemRegister API to handle a case when
a memory block may have been mapped before calling olMemRegister to
support some use cases in libomptarget
[SystemZ][z/OS] Show instruction encoding in HLASM output
This change adds the support to show instruction encoding as a comment
when emitting HLASM text. With this, the last 2 LIT tests migrate to
HLASM syntax.
[Clang] Fix incorrect mutability of decltype((x)) in lambda return types (#180690)
Previously, the parser did not update the lambda's mutability state
before parsing the trailing return type. This caused decltype((x)) to
incorrectly deduce a non-const reference even in a non-mutable lambda.
Fixes #180460