[ADT] Add predicate based match support to StringSwitch (#188046)
This introduces `Predicate` and `IfNotPredicate` case selection to
StringSwitch to allow use cases like
```
StringSwitch<...>(..)
.Case("foo", FooTok)
.Predicate(isAlpha, IdentifierTok)
...
```
This is mostly useful for improving conciseness and clarity when
processing generated strings, diagnostics, and similar.
[LV] NFCI: Create VPExpressions in transformToPartialReductions. (#182863)
With this change, all logic to generate partial reductions and
recognising them as VPExpressions is contained in
`transformToPartialReductions`, without the need for a second transform
pass.
The PR intends to be a non-functional change.
[MLIR][NVVM] Update SM version requirements of Ops (#192257)
This change updates the SM version requirements of Ops with the
`NVVMRequiresSM` trait to include family-specific SM versions wherever
applicable.
[clang][bytecode] Fix DefaultInitExpr base pointer in IndirectFieldDecls (#193149)
We built up an in correct set of init chain links, causing a
`DefaultInitExpr` later to pick the wrong base pointer. Fix this by
adding one link per decl (-1) in the `IndirectFieldDecl`.
[clangd] [Modules] Refactor cache to support duplicated module name (#193413)
Following of https://github.com/llvm/llvm-project/pull/193158
Although https://github.com/llvm/llvm-project/pull/193158 handles
duplicated module name, the cache in ModulesBuilder still uses the old
assumption.
This patch tries to resolve the problem while not affecting original use
cases as much as possible. As the duplicated module name should be rare
in real world case.
AI Assisted
[mlir][spirv][nfc] Clean up FP8 and BF16 SPIR-V type tests (#193196)
Rename the non-emulation check prefixes for clarity, expand FP8/BF16
test coverage in SPIR-V type and TensorArm tests, and simplify a few
type predicates in SPIRVTypes.cpp.
No functional change intended.
Signed-off-by: Davide Grohmann <davide.grohmann at arm.com>
[clangd] Add go-to-definition support for fields in offsetof expressions (#192953)
clangd had no handling for OffsetOfExpr in FindTarget.cpp, so
go-to-definition and find-references on field names inside
__builtin_offsetof(Type, field) produced no results.
Fix this by adding VisitOffsetOfExpr to both visitors:
- The TargetFinder visitor in add(const Stmt*) so that allTargetDecls()
resolves the referenced FieldDecl(s).
- The refInStmt visitor so that findExplicitReferences() emits a
ReferenceLoc per field component, enabling find-references and rename to
locate each field at its source position.
Each OffsetOfNode of kind Field is visited; Identifier nodes (unresolved
dependent-type designators) and Base nodes (implicit base-class
indirections) are intentionally skipped.
Repro:
```
[2 lines not shown]
[RISCV][MC] Emit ISA mapping symbols on .option arch/rvc/norvc/pop (#193123)
When .option arch, .option rvc, .option norvc, or .option pop changes
the active ISA, emit a "$x<ISAString>" mapping symbol before the next
instruction so that tools can determine the ISA in effect for each code
region.
Also emit ISA mapping symbols on begin of first instruction to make sure
link with different object still can disassemble correctly.
Based on #67541
---------
Co-authored-by: Joseph.Faulls <Joseph.Faulls at imgtec.com>
[clang][modules] Fix false positive -Wweak-vtables in named modules (#193136)
The -Wweak-vtables warning was incorrectly firing for classes defined in
C++20 module units. This warning does not apply to module units as the
vtable should be owned by the module and emitted only once.
Fixes #193004
Reapply "[JTS][Passes] Enable JTS By Default" (#193409)
Reverts llvm/llvm-project#193399
The last assertion failure seen on the BOLT buildbot should be fixed by
ee06802dc4a85b4a05ae75c1853bca8e58f76f6d.
[JTS] Correctly handle all zero profile values in VP metadata (#193402)
We can end up with cases where the VP metadata only has zero profile
values, for example if all of the functions end up being external and
uninstrumented. This caused fixes an assertion failure on the BOLT
builder that came up last time we tried to turn the pass on by default.
[lldb] Fix potential TestAlwaysRunThreadNames flakiness (#193405)
Change the stepped function to spin on a flag until the helper thread
advances the counter, so the step-over can only complete if the helper
thread actually ran.
Fixes #193398
[llvm-mc][AsmMatcherEmitter] Fix the minimum ConversionTable entry size (#191977)
When working on a target with fully customized instruction
conversion method, there's a build failure due to the case that in the
target's generated asm matcher, the size of `ConversionTable` entry is 2
(i.e., the minimum size defined in `AsmMatcherEmitter` TableGen
backend).
However, for a target that has customized conversion method for all
instructions, a `ConversionTable` entry should be looking like: `{
CVT_<the-custom-conversion-method>, <the-position-of-operand>, CVT_Done
}`, where the position of operand for custom conversion is by-default 0.
This commit includes a test case to illustrate this scenario, along with
a little fix.