[mlir][memref] Make memref.cast areCastCompatible return true when meet same types (#192029)
When both the source and destination types of `memref.cast` are
unranked, it causes an IR verification failure, which impacts downstream
projects and its behavior is inconsistent with the documentation. To
address this, this PR now allows the operation to return true if the
source and destination types are identical.
[mlir] reduce excessive verification in transform
`mergeSymbolsInto` called by the transform interpreter for named
sequence management was calling a full verifier after renaming symbols.
The renaming could have potentially broken symbol table-related
invariants, but not really anything else. Only verify the symbol
table-related invariants intead.
[mlir] add normal form checked transform interface
This interface can be implemented by operations that guarantee certain
normal forms for themselves and their regions. The operations provide
the list of normal forms they guarantee. This interface interacts with
the typed transform handles removing the need for them to check normal
forms that are guaranteed (and preserved by transforms).
Provide a simple `transform.payload` operation to carry a list of normal
forms and implement the interface.
This exposes the fact that the transform interpreter may be running the
verifier too much, but this is a pre-existing beavior that is orthogonal
to this patch.
Assisted-by: Claude Opus 4.7 / Cursor
[AST]Fix Location and Range for reversed rewritten CXXOperatorCallExpr (#192467)
In C++20+, when `a != b` is automatically rewritten to `!(b == a)`, the
range and sourceLocation of the generated nodes are incorrect and the
range has begin > end.
Assisted-by: Claude code
Enumeration Type Sem-1: Foundation types + Parser (PRs 1-2)
Adds DerivedTypeSpec::Category::EnumerationType to the type system,
parse tree nodes for ENUMERATION TYPE per F2023, and parser/unparser
support. Includes a stub in resolve-names that rejects ENUMERATION TYPE
as 'not yet implemented' (enabled in Sem-2).
Files from original PRs 1-2.
[mlir] add normal form checked transform interface
This interface can be implemented by operations that guarantee certain
normal forms for themselves and their regions. The operations provide
the list of normal forms they guarantee. This interface interacts with
the typed transform handles removing the need for them to check normal
forms that are guaranteed (and preserved by transforms).
Provide a simple `transform.payload` operation to carry a list of normal
forms and implement the interface.
This exposes the fact that the transform interpreter may be running the
verifier too much, but this is a pre-existing beavior that is orthogonal
to this patch.
Assisted-by: Claude Opus 4.7 / Cursor
release/22.x: [Clang] Track constraint's SubstIndex only if it contains outer parameter packs
I believe that is the intent of SubstIndex in AssociatedConstraint.
So this enforces the checking explicitly, in case nested SubstIndexes
confuses our poor constraint evaluator.
As a drive-by fix, this also removes an strange assertion and an
unnecessary
SubstIndex setup in nested requirement transform.
No release note because this is a regression fix.
This backports #191484
[ClangLinkerWrapper] Fix `-v` for newer CMake passing it directly (#188883)
Summary:
Normally `-v` is version for tools, but it's also verbose for the
linker. CMake tries to identify the linker by passing `-Wl,-v` which
goes to the linker wrapper instead. Make this only print version on
`--version` and forward the other one to the linker so it appears
transparent to the host ABI. A bit of a hack, but it should work.
(cherry picked from commit 80b1fbecf4df3296b3976ce3cb42eb7832fc9053)
[libc] Fix missing strings symbols in string.h (#192640)
The glibc string.h includes strings.h if it's in the default mode. Added
to allow more programs to be built.
[LLVM][CodeGen][SVE] Add custom lowering for ISD::MASKED_SDIV/UDIV. (#191164)
Also refactor custom lowering of ISD::SDIV/UDIV to replace uses of
Arch64ISD::PRED_SDIV/UDIV with the new target independent equivalents.
[flang-rt] Fix REAL(10)/COMPLEX(10) component sizes in runtime type info (#192049)
This fixes a crash caused by incorrect component sizes in runtime type
info.
For REAL(10) and COMPLEX(10) components,
`Component::GetElementByteSize()` was using the Fortran kind value as
the byte size. On x86-64 that underestimates the actual storage size, so
component size computation can be wrong for extended-precision types.
This patch routes REAL and COMPLEX component sizes through
`Descriptor::BytesFor()`, which matches the runtime’s existing
storage-size handling. I also added a runtime unit test covering the
relevant `Descriptor::BytesFor()` storage-size behavior for REAL and
COMPLEX kinds, including kind 10.
Fixes #192085
---------
Co-authored-by: Sairudra More <moresair at pe31.hpc.amslabs.hpecorp.net>
[clang] Reland NO_LIBCXX test in serenity.cpp (#192638)
The test was first introduced in 934f7950 and then removed in 9c94881f.
The first iteration was depending on the default runtime being
compiler-rt, which isn't true for all bots and thus caused failures:
https://lab.llvm.org/buildbot/#/builders/10/builds/26512
The new version of the test doesn't depend on the compiler runtime.
[clang]Implement the c23 stdc bit builtins (#185978)
This patch implements the following C23 bit builtins
__builtin_stdc_leading_zeros/ones
__builtin_stdc_trailing_zeros/ones
__builtin_stdc_first_leading/trailing_zero/one
__builtin_stdc_count_zeros/ones
__builtin_stdc_has_single_bit
__builtin_stdc_bit_width
__builtin_stdc_bit_floor
__builtin_stdc_bit_ceil
Additional Notes:
* Supports all unsigned integer types including _BitInt and __int128
* lowers to llvm.ctlz / llvm.cttz / llvm.ctpop intrinsics
* constexpr support
Addresses: #79630
Suppress octal literal diagnostics from system macros (#192481)
We emit two kinds of diagnostics related to octal literals. One is a
compat/extension warning for use of 0o as the literal prefix and the
other is a deprecation warning for use of 0 as the literal prefix.
Clang now suppresses both of those diagnostics when the octal literal
comes from a macro expansion of a macro defined in a system header.
Those are not uses of the literal the user has any control over,
generally, so the diagnostics are not helpful in that case.
Fixes #192389
[SPIRV] Fix trunc nonstandard int types (#191393)
In some cases, the trunc dst type was widened to higher bit size, which
changes behavior of the instruction.
Now, in case of need of widening, the trunc instruction is replaced with
AND with appropriate mask.
Assisted-by: Claude Code.
---------
Co-authored-by: Marcos Maronas <mmaronas at amd.com>
Co-authored-by: Arseniy Obolenskiy <gooddoog at student.su>
[clang] Add diagnostic for friend declaration of closure type member (#191419)
Clang allows friend declarations of closure type members, which is
disallowed per CWG 1780 (Issue #26540).
Added a new diagnostic when the friend declaration targets a member of a
`CXXRecordDecl` that is a lambda.
---------
Co-authored-by: Corentin Jabot <corentinjabot at gmail.com>
[clang-tidy] Add `readability-redundant-lambda-parameter-list` (#190438)
Adds a new clang-tidy check that removes redundant empty parameter lists
from lambda expressions when the rewrite is valid for the active
language standard.
Fixes #190396
Assisted by Claude (Anthropic), all decisions taken in
this PR involved my active judgment
[bazel] Fix nanobind header build (#192627)
The build was broken by 3b3ac5a1169722bff1ae0f5f8f27a48cc08c3d02
changing textual_hdrs to hdrs - the copts/features weren't copied over,
meaning Nanobind was attempted to be built with exceptions disabled.
Co-authored-by: James Molloy <jmolloy at google.com>