[clang][ssaf] Rework NestedBuildNamespaces of TU and LU summaries (#191489)
Problem:
ASTEntityMapping::getEntityName() creates EntityName with an empty
NestedBuildNamespace, but the linker expected the TU namespace to
already be present in the EntityName. This caused internal linkage
symbols to conflict during linking: since their NestedBuildNamespace was
empty, they all inherited the same LU namespace during resolution,
making internal symbols from different TUs appear identical. For
example, two "static inline" functions with the same USR in separate TUs
would be incorrectly merged into a single LU entity instead of remaining
distinct.
This is now fixed and demonstrated by the
InternalLinkageWithEmptyNamespaceAcrossTUs test, which creates two
internal linkage symbols across two TUs and verifies they remain
separate after linking.
[27 lines not shown]
[AArch64][GISel] Regbank G_BITCAST using src regbank. (#191522)
This takes the regbank of a G_BITCAST from the input srcreg that has
already been allocated, keeping the bitcast on the same bank. A copy
then might be added to the dst if needed.
onlyUsesFP is also improved for G_BITCAST, allowing operations to guess
the correct type through a onlyUsesFP too.
Originally from #177158 by Ryan Cowan with modifications.
[clang-format] Preserve trailing NOLINTEND placement with SeparateDefinitionBlocks (#190741)
Fixes https://github.com/llvm/llvm-project/issues/189384.
When `SeparateDefinitionBlocks: Always` is enabled, clang-format may
separate a clearly trailing comment block by inserting an empty line
before it.
For example, it may format:
```c++
// NOLINTBEGIN
int x = 1;
int y = 2;
// NOLINTEND
void some_function() {}
```
[23 lines not shown]
[lldb][Utility] Add FileSpecList::Append(const FileSpecList &) API (#191446)
Adds a new API to `FileSpecList` that allows appending another
`FileSpecList`.
This is used in another PR where I didn't want to iterate over the list
and push_back manually.
Assisted-by: Claude
- Used Claude to write the skeleton of the test before manually cleaning
it up.
[Clang] diagnosing missing Vulkan environment when using SPIR-V triple (#190840)
When a user passes '-target spirv' without specififying a vulkan
environment ttriple, SPIRVTargetInfo will fire an assert instead of
throwing an error diagnostic. Added this diagnostic in
CompilerInstance::createTarget() before target is initialized. Fixes
https://github.com/llvm/llvm-project/issues/189964
[X86] combineINSERT_SUBVECTOR - attempt to widen mask predicate as scalar integer instead of inserting into a zero vXi1 vector (#192699)
Fold vXi1 insert_subvector(zero_vector(),bitcast(scalar_mask),idx) ->
bitcast(shl(zext(scalar_mask),idx))
vXi1 zero widening and insertion has to rely on kshiftl/kshiftr pairs,
but if the mask was a scalar it can be a lot cheaper to just widen it to
a wider (legal) scalar first.
Cleans up some codegen for #192034 - first step towards pruning all the
VMOVSH patterns we've ended up :/
[FileCheck] Add a diff output option for FileCheck (#187120)
This patch adds a `--diff` flag to FileCheck to address the readability
of traditional FileCheck output which can be difficult to parse by
human, especially when dealing with multiple substitutions or large
input files with many mismatches and additional context. This feature
provides a more familiar, scannable format for developers by rendering
mismatches as diffs.
There are two diff modes, split and unified both with substitution and
no-substitution version however to make it easier for reviewer, this
only have unified with no substitution.
Functional description of PR-
`getDiffContext` -
It provides the surrounding context for the mismatch. It uses the
`SourceMgr` to find the Line using `LineNo`. Once it found the pointer,
it scans forward until it hits a newline (\n or \r) or the end of the
[67 lines not shown]
[OFFLOAD] Introduce OpenMP math wrappers for SPIRV backend (#192139)
This PR is a first step to introduce math OpenMP wrappers for SPIRV
backend.
As a first step only API that either mapped to existing SPIRV API or has
straightforward implementation is introduced.
[clang] Improve diagnostics for `__builtin_align` builtins with floating/member pointer operands (#192650)
Improve diagnostics for `__builtin_align_up`, `__builtin_align_down`,
and `__builtin_is_aligned` when the first operand has an invalid type.
Clang already emits `err_typecheck_expect_scalar_operand` for
unsupported operands, but the message is generic. This patch adds
follow-up notes to clarify three common invalid cases:
* floating point operands (“floating point types are not allowed here”)
* C++ member pointer operands (“member pointers are not allowed here”)
* plain-function-pointer ("function pointers are not allowed here")
[LoongArch] Select `V{AND,OR,XOR,NOR}I.B` for bitwise with byte splat immediates (#192217)
The `V{AND,OR,XOR,NOR}I.B` instructions operate on byte elements and
accept an 8-bit immediate. However, when the same byte splat constant is
used with wider vector element types (e.g. v8i16, v4i32, v2i64),
instruction selection currently falls back to materializing the constant
in a temporary register.
```
vrepli.b -1
vxor.v
```
even though the immediate form is available:
```
vxori.b 255
```
[11 lines not shown]
Revert "[lldb] Rally around triple rather than arch in the API tests (#191416)" (#192763)
Temoprarily reverting while we look at the TestMacCatalyst.py and
TestRosetta.py fails introduced by this PR, to unblock the CI.
This reverts commit 86397f49c7725f35a51517a8290cb4207c97771d.
[BPF] Handle aliases in CodeGenModule::EmitExternalDeclaration. Fixes #192365 (#192374)
Adds handling of global aliases in
CodeGenModule::EmitExternalDeclaration. This fixes a clang crash on some
real code, see llvm#192365.
[lldb] Store the dummy target in the selected execution context (#190496)
Store the dummy target in the selected execution context. There's no
reason for everybody to have to independently fall back to the dummy
target.
[mlir][tensor] Remove unit-stride restriction in InsertSliceOp folding (#192600)
This PR replaces manual offset/size resolution with `affine::mergeOffsetsSizesAndStrides`, simplifying the code and extending subview-of-subview folding to support non-unit strides.