Fix a bug in the watchpoint callback - in one case we weren't
returning anything from the callback. Fixing this on the off
chance that is what is causing the linux-only failure in this test
after PR:
https://github.com/llvm/llvm-project/pull/184272
[clang] Don't use `VarDecl` of local variables as `ManglingContextDecl` for lambdas (#179035)
Currently, in a C++20 modules context, a `VarDecl` of a local variable
can wrongly end up as a `ManglingContextDecl` for a lambda.
Fix this by removing `ContextKind::NonInlineInModulePurview` in
`Sema::getCurrentMangleNumberContext` and add
`IsExternallyVisibleInModulePurview` checks in the appropriate places:
- For externally visible functions defined in a module purview, add a
check to `isInInlineFunction`, renaming it to
`IsInFunctionThatRequiresMangling`
- For externally visible variables defined in a module purview, add a
new `ContextKind::ExternallyVisibleVariableInModulePurview` and an
appropriate check to the `VarDecl` case
Fixes #178893
---------
[4 lines not shown]
[C++20] [Modules] Set ManglingContextDecl when we need to mangle a lambda but it's nullptr (#177899)
Close https://github.com/llvm/llvm-project/issues/177385
The root cause of the problem is, when we decide to mangle a lamdba in a
module interface while the ManglingContextDecl is nullptr, we didn't
update ManglingContextDecl. So that the following use of
ManglingContextDecl is an invalid value.
(cherry picked from commit 772b15b3be153b1d2df910057af17926ea227243)
[flang][OpenMP] Utilities to get uppercase directive/clause names
It is a convention to use uppercase names of directives and clauses in
diagnostic messages, but getting such names is somewhat cumbersome:
```
parser::ToUpperCaseLetters(llvm::omp::getOpenMPDirectiveName(dirId));
parser::ToUpperCaseLetters(llvm::omp::getOpenMPClauseName(clauseId));
```
Implement `GetUpperName` (overloaded for clauses and directives) to
shorten it to
```
GetUpperName(dirId, version);
GetUpperName(clauseId, version);
```
This patch replaces existing instances of this pattern, adding the
use of OpenMP version where it was previously missing.
Revert "[flang][OpenMP] Fix lowering of LINEAR iteration variables" (#184843)
Reverts llvm/llvm-project#183794
It broke a couple of tests from Fujitsu testsuite.
[SPIRV] Replace `removeFromParent` with `eraseFromParent` for `ASSING_TYPE` (#184793)
The `ASSIGN_TYPE` instruction should not be referenced anymore at this
point. So we can free its memory.
Follow up of https://github.com/llvm/llvm-project/pull/182330
[green dragon] skip trigger on release branch stage1 RA jobs (#184653)
* This will allow us to setup clang-stage1-RA jobs as multi branch
pipelines for release branches without setting up all the downstream
jobs.
I will need to cherry-pick the jenkinsfile to the release/22.x branch
which I will do after this lands
[clang][bytecode][HLSL][Matrix] Support `ConstantMatrixType` and more HLSL casts in the new constant interpreter for basic matrix constexpr evaluation in HLSL (#184840)
Forgot to change the target branch before merging. This PR is a
cherry-pick of the squashed-and-merged PR commit
b16aa4b7ec665911c74300cd7442659b70973d13 from 183424
This PR fixes #182963
This PR is an extension of #178762 which has already been merged.
This PR adds support for `ConstantMatrixType` and the HLSL casts
`CK_HLSLArrayRValue`, `CK_HLSLMatrixTruncation`,
`CK_HLSLAggregateSplatCast`, and `CK_HLSLElementwiseCast` to the
bytecode constexpr evaluator.
The implementations of CK_HLSLAggregateSplatCast and
CK_HLSLElementwiseCast are incomplete, as they still need to support
struct and array types to enable use of the experimental new constant
interpreter on other existing HLSL constexpr tests. The completion of
the implementations of these casts will be tracked in a separate issue
[2 lines not shown]
[Clang] Fix 'gpuintrin.h' implementation of 'match_all'
Summary:
This implementation only worked if the lane mask passed in was uniform,
but this is against the expected usage where the user may be wishing to
check if a value is uniform *within* a mask subset. Also remove
redundant sync_lanes, the ballots and shuffles already have
synchronizing behavior.
[libc] Rework slab cache data structure for GPU allocator
Summary:
This was previously a Trieber stack, which is a perfectly fine generic
and lock-free data structure. However, this used some expensive CAS
operations and had issues with ABA. Because the only user of this was
the slab cache mechanism, we can pretty safely specialize it. Instead,
we simply search a fixed size buffer for some sentinal values and CAS
into it.
For allocations that only ever hit the cache, this improves performance
from ~9000 cycles to ~6000 cycles and similar improvements for workloads
that feel the pain of small thread counts hitting the cache.
Refactor and support multiple affinity register for a task
- Support multiple affinity register for a task
- Move iterator loop generate logic to OMPIRBuilder
- Extract iterator loop body convertion logic
- Refactor buildAffinityData by hoisting the creation of affinity_list
- IteratorsOp -> IteratorOp
- Add mlir to llvmir test
Implement lowering for omp.iterator in affinity
Create IteratorLoopNestScope for building nested loop for iterator.
Take advantage of RAII so that we can have correct exit for each
level of the loop.
[mlir][llvmir][OpenMP] Translate affinity clause in task construct to llvmir
Translate affinity entries to LLVMIR by passing affinity information to
createTask (__kmpc_omp_reg_task_with_affinity is created inside PostOutlineCB).
[clang][deps] Simplify by-module-name scan API (#184376)
The by-module-name scanning APIs are fairly spread out. There's the main
`CompilerInstanceWithContext` class that provides a constructor,
`initialize()` and `computeDependencies()`. Then there's the
`DependencyScanningWorker` that optionally owns
`CompilerInstanceWithContext` and re-exposes two `initialize()` and one
`computeDependencies()` functions. Lastly, there's
`DependencyScanningTool` that again re-exposes two variants of
`initialize()` and one `computeDependencies()`.
The current setup makes it unnecessarily difficult to make changes to
these APIs (as observed in
https://github.com/swiftlang/llvm-project/pull/12453).
This PR makes `CompilerInstanceWithContext` standalone, and hides the
construct + initialize pattern behind a static factory function. This
makes it harder to misuse the API (forgetting to call `initialize()`,
calling it twice, etc.) and means changes now need to only touch single
class instead of three classes spread over multiple files.
Handle dynamic affinity object sizes and improve iterator coverage
Teach task affinity lowering to compute lengths for dynamic objects
instead of falling back to zero for whole-object cases such as
assumed-shape, allocatable, pointer, character, and polymorphic type.
Add more tests in task-affinity
- assumed-shape, allocatable, pointer, and polymorphic objects
- character objects with constant and runtime length
- iterator character element affinity
- reordered, expression, and section iterator subscripts
- Extract iterator handling from processAffinity
Lower iterator affinity subscripts and sections correctly
Teach OpenMP affinity lowering to evaluate iterator-dependent subscripts
through the iterator symbol mapping and use them to build the element
coordinate directly.
This fixes cases such as:
- affinity(iterator(i,j): a(j,i))
- affinity(iterator(i,j): a(i+1,j))
- affinity(iterator(i,j): a(i:i+1,j+2))
- affinity(iterator(i,j): a(:i+1,j+2))
[Flang][mlir][OpenMP] Support affinity clause codegen in Flang
This patch translate flang ast to OpenMP dialect for affinity clause
including the iterator modifier.