Thread Safety Analysis: Support attributes on function pointers (#191187)
Allow acquire_capability, release_capability, requires_capability,
try_acquire_capability, assert_capability, and locks_excluded attributes
(incl. their shared variants) on function pointer variables and struct
fields. Calls through annotated function pointers are checked the same
way as direct function calls.
The attributes are placed on variable/field declarations, not on the
function pointer type itself. This is a deliberate trade-off: making
these "attributes" part of the type system would require diagnosing
mismatched assignments, which would be a significant type-system
extension with limited practical benefit, which would likely require
promoting the TSA vocabulary to full type-qualifiers. Instead, the
analysis trusts the annotations on the variable at the call site, and
sticks with the attribute-based semantics. This matches the existing
philosophy where the analysis tries to avoid false positives where
possible and attribute mismatches on direct functions are likewise not
hard errors or warnings (yet).
[5 lines not shown]
[MIPS] Remove InstrItinClass definitions and MipsSchedule.td (#188010)
Align Mips Targets with the rest of Architectures.
---------
Co-authored-by: Uros Stajic <uros.stajic at htecgroup.com>
[DebugInfo] Verify DISubprogram has a type (#194556)
Require DISubprogram metadata to carry a non-null type in the verifier.
LangRef specifies that the `type:` field of `DISubprogram` points to a
`DISubroutineType`. This patch diagnoses malformed debug info where the
field is omitted or resolves to null, while preserving the existing wrong-type
diagnostic for non-DISubroutineType operands.
Update hand-written LLVM IR tests to use valid DISubprogram metadata
where they are not intentionally testing malformed debug info. These tests now
use minimal DISubroutineType metadata so the new verifier check does not mask
their original coverage.
Fixes #186557
[EarlyCSE] Support memset loads (#194268)
This PR addresses the zero-`memset` case in EarlyCSE as discussed in
#194080. If we do a `memset` of zero and then load back from the same
base pointer, we can fold that load to `null`.
[OpenMP][mlir] Add DynGroupPrivateClause in omp dialect (#153562)
- The `dyn_groupprivate` clause allows to dynamically allocate
group-private memory in OpenMP parallel regions, specifically for
`target` and `teams` directives.
- This clause enables runtime-sized private memory allocation and
applicable to target and teams ops.
This PR enables dyn_groupprivate clause in openmp mlir dialect and adds
it to Teams and Target ops. Also includes parser, printer and
verification for clause.
[clang][bytecode] Diagnose copying empty mutable unions (#195529)
We had a special case for copy/move ctors of empty unions. Remove that.
Everything else is just so we don't regress diagnostics.
[X86] vector-reduce-* - add 32-bit test coverage to the minmax tests (#195617)
The horizontal-reduce-* tests already have 32-bit coverage but they will be retired soon.
[IR] Add require-logical-module module flag (#193502)
This module flag is optional and can be set to require the use of
logical alloca/gep instructions.
This flag will have 2 usages:
- tell optimization which flavor of GEP/alloca to emit
- fail loudly if a GEP/alloca is emitted in a module targeting logical.
[CIR] Replace nsw/nuw unit attrs with OverflowFlags BitEnum
Combine the separate `no_signed_wrap` and `no_unsigned_wrap` unit
properties on arithmetic ops into a single `OverflowFlags` BitEnum
(`nsw`, `nuw`). This allows combined flags to be written as
`nsw|nuw` in assembly, replaces the per-flag verification traits
with a single `OverflowFlagsRequireIntType` predicate, and folds
the two `HasAtMostOneOfAttrs` checks into one
`SatExclusiveWithOverflowFlags` predicate.
The bit layout matches `mlir::LLVM::IntegerOverflowFlags`, so
lowering casts the value directly and asserts the layout via
static_assert.
Updates IncOp/DecOp/MinusOp builders, CIRGenExprScalar, and
LowerItaniumCXXABI to the new API. Adds round-trip and
verification tests in clang/test/CIR/IR/.
[AMDGPU] Support Wave Reduction for true-16 types - 3
Supporting true-16 versions of the reduction intrinsics
Supported Ops: `and`, `or`, `xor`.
Supports only the iterative stratergy, DPP is yet
to be supported.
[flang] avoid introducing iteration dependencies in WHERE and FORALL temporaries (#195053)
This patch improves the addressing of temporaries created when needed for simple FORALL or WHERE as below to not introduce iteration dependencies.
```
subroutine foo(p1, p2, mask)
real, pointer :: p1(:), p2(:)
logical :: mask(:)
where (mask) p1 = p2
end subroutine
```
Instead of using a stack like temporary that uses a counter to push and fetch elements, the loop IVs are directly used to address the temporaries. This makes it easier to later vectorize or parallelize those loops.
This is only done when:
- This is not a FORALL with array expressions
- The dynamic type is the same at each iterations
- The WHERE and FORALL do not create loops of depth more than 15.
- If there are FORALLs, their strides are constants 1 or -1.
[3 lines not shown]
[clang][SYCL] Handle cdecl variadic functions for SYCL device (#194922)
SYCL doesn't allow variadic functions to be called from device code.
Since SYCL device compilation mostly uses targets that don't natively
support variadic fucntions, we now issue an error even if the variadic
function is never called from the device if it has cdecl calling
convention attribute. We also now don't issue an error if a variadic
function is called from the device code. This patch defers the error
caused by cdecl attribute to the actual call point and adds diagnosing
of variadic function calls on device side using deferred diagnostics.
[AMDGPU] Support Wave Reduction for i16 types - 3
Supported Ops: `and`, `or`, `xor`.
Supports only the iterative stratergy, DPP is yet
to be supported.
Supports only Fake-16 versions of the lowering.
True-16 support is yet to be added.