[clang-format] Fix missing indentation for assignment with attributes (#230417)
Fixes #229206.
When `BreakBeforeBinaryOperators: All` is configured, formatting a
variable definition with an attribute (e.g. `[[maybe_unused]]`) between
the variable name and the assignment previously caused the assignment
operator to lose all continuation indentation (starting at column 0).
The root cause was in `ContinuationIndenter::getNewLineColumn()`. The
logic assumed that any token following an attribute closing bracket
(`TT_AttributeRSquare`) should not be indented as a continuation. It
failed to account for binary operators (like `=`) which are valid
continuations of the variable declaration statement.
This patch updates the condition to `!Current.isBinaryOperator()`,
ensuring that assignment operators following attributes correctly fall
through to the standard continuation indentation logic.
[5 lines not shown]
[libc++] Introduce a free function __thread_hardware_concurrency() (#232284)
It allows to query the available hardware concurrency without depending
on entirety of `std::thread`.
Required for #229804.
[libc++][pstl] Make the serial backend the ultimate fallback for all backends (#233421)
Always fall back to the serial backend as a last resort when an
algorithm implementation was not found.
This is a preparation before exposing a bunch of PSTL algorithms we
don't currently intend to parallelise.
Fixes #229813
[mlir][SPIR-V] Model OpenCL sincos memory effects (#232017)
Address comments on https://github.com/llvm/llvm-project/pull/231713.
Mark the cosval operand of spirv.CL.sincos with MemWrite so
memory-effect analysis can identify the destination of its cosine write.
[flang][OpenMP] Compare metadirective conditions by symbol identity
When a METADIRECTIVE condition is false at runtime, the later candidates
that test the same condition are dropped. Conditions were compared with
evaluate::Expr equality, which treats dummy arguments of different
procedures at the same position as equal, so that procedure
characteristics can be compared. A condition on a host-associated dummy
argument and one on a local dummy argument were therefore the same, and
the second variant was never tried. For the same reason, `a .and. b` was
normalized to `a`.
This patch also requires the two conditions to reference the same
symbols in the same order.
Fixes #233562.
Assisted-by: GitHub Copilot (Claude Opus 5.5)
[MLIR][XeVM] Split n-ary ops for a slice only when the source is too wide (#232007)
`HandleVectorExtractPattern` case 4 hoists a contiguous-slice
`llvm.shufflevector` through an n-ary element-wise op. It slices every
operand and clones the op at the slice width. The pattern is meant to
legalize vectors wider than 16 elements.
Case 4 did not check the source width, so it also split vectors that are
already legal. For example, one `llvm.fmul : vector<8xf32>` read one
lane at a time became 8 scalar `llvm.fmul`s and 16 `llvm.shufflevector`s
(two per lane, one per operand, where there was one read per lane
before). Each narrow op was placed next to its reader, far from the
original op.
This patch hoists through an n-ary op only when the source has more than
16 elements. The other cases of the pattern do not change.
Effect on the IR:
- A legal-width element-wise op stays one vector op, where the producer
[5 lines not shown]
[mlir][spirv] Fix arith-to-spirv crash on f8 vector/tensor constants without Int8 (#223517)
`convert-arith-to-spirv` crashes on this input with the default target
env:
```mlir
%cst = arith.constant dense<[1.0, -0.5]> : tensor<2xf8E4M3FN>
```
```
IntegerAttr::get: APInt bit width must match integer type width
```
With `emulate-unsupported-float-types` (on by default) the type
converter maps 8-bit floats to i8. If the target does not have the
`Int8` capability, `emulate-lt-32-bit-scalar-types` then widens that i8
to i32. So the converted element type of a vector/tensor f8 constant is
i32 on such targets. `ConstantCompositeOpPattern` only knows about the
first step: it bitcasts the 8-bit float to an 8-bit APInt and asks for
[40 lines not shown]
[asan] Implement address sanitizer on AIX: shadow memory (#232243)
This continues https://github.com/llvm/llvm-project/pull/136874
On 64-bit AIX, data/heap, shared libraries, mmap and the initial stack
are in separate regions spread over a very large address range, and much
of that range is reserved by the OS. Shadowing it directly would need a
shadow too large to map.
Instead, ASan on 64-bit AIX ignores the top 6 address bits when
computing the shadow address:
`shadow = ((addr << 6) >> (6 + scale)) + 0x0a01000000000000`
It shadows only the part of each region that programs use in practice:
low memory (data/heap), high memory (stack), and three mid regions (mmap
and two shared library data ranges). The shadow itself sits in the mmap
region. The layout has no shadow gaps, so at startup the runtime
reserves the mid shadows instead of protecting a gap.
[2 lines not shown]
[CIR][OpenMP] Add support for omp teams
This patch adds support for the OpenMP 'teams' directive, both standalone
and as the combined `target teams` construct. isCombinableLeaf now also
recognizes teams, so an explicitly-nested `target` + `teams` pair gets
the same omp.combined marking as the combined case.
Assisted-by: Cursor / Claude Sonnet 5 High
[BoundsSafety] Don't orphan a shared counted_by node when one declarator nests it
A late-parsed counted_by-family attribute in declaration-specifier position is
shared by every declarator in the declaration, so they share one incomplete
CountAttributedType. When one declarator nests the node, as `*b` does in
`IP __counted_by(n) a, *b;`, it is rejected and the node is marked rejected.
The completion pass then skipped the node for every declarator, so `a` kept a
CountAttributedType without a count and crashed on use in
FieldDecl::findCountedByField.
Make the rejection apply to the declarator only. The parser checks and clears
the mark after each declarator, and doesn't pair a rejected declarator's field
with the attribute. The completion pass skips an attribute with no fields left,
still without parsing its argument.
Assisted-by: Opus 5.5
[BoundsSafety][test] Add late-parsed counted_by type-attribute coverage
New tests exercising the late-parse fill-in mechanism:
- Sema/attr-counted-by-weird-type-positions{,-late-parsed}.c: counted_by
in assorted type positions, nested pointers, and rejection cases.
- Sema/attr-bounds-safety-function-ptr-param.c: attributes on
function-pointer-typed members.
- Modules/ and PCH/ bounds-safety-attributed-type-late-parsed: the
resolved type round-trips through serialization.
- Sema/attr-counted-by-late-parsed-regressions.c: guards against the
double-free on a nested-record decl-spec attribute and the null-count
escape on a free-function parameter.