LLVM/project f7de7bcflang/docs Aliasing.md, flang/include/flang/Lower AbstractConverter.h

[flang] Mark visible Cray pointer associations as aliasing (#221350)

A visible Cray pointer association (ptr = loc(x) in the same procedure)
can alias x and the pointee. Flang treated them as no-alias and
miscompiled some codes at -O2.

-funsafe-cray-pointers is too broad. Instead, lowering now marks x as
TARGET for that procedure so later FIR passes (including TBAA) see the
aliasing. Default behavior: no-alias is unchanged.
DeltaFile
+66-0flang/lib/Lower/Bridge.cpp
+49-0flang/test/Lower/HLFIR/visible-cray-pointer-target.f90
+22-5flang/docs/Aliasing.md
+7-0flang/include/flang/Lower/AbstractConverter.h
+4-1flang/lib/Lower/ConvertVariable.cpp
+2-2flang/test/Lower/cray-pointer.f90
+150-86 files

LLVM/project 58cdab8clang/test/Modules bounds-safety-attributed-type-late-parsed.c, clang/test/PCH bounds-safety-attributed-type-late-parsed.c

[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.
DeltaFile
+456-0clang/test/Sema/attr-counted-by-weird-type-positions-late-parsed.c
+454-0clang/test/Sema/attr-counted-by-weird-type-positions.c
+173-0clang/test/Sema/attr-bounds-safety-function-ptr-param.c
+111-0clang/test/Modules/bounds-safety-attributed-type-late-parsed.c
+92-0clang/test/Sema/attr-counted-by-late-parsed-regressions.c
+69-0clang/test/PCH/bounds-safety-attributed-type-late-parsed.c
+1,355-04 files not shown
+1,505-010 files

LLVM/project 2c757aaclang/lib/Parse ParseDecl.cpp, clang/lib/Sema SemaType.cpp

[BoundsSafety] Create incomplete counted_by types and wire up the refill

Activate late parsing for the counted_by family (counted_by / sized_by and
their _or_null variants) in type-attribute position, under
-fexperimental-late-parse-attributes, on top of the type-attribute handling,
the validation helper and the refill machinery added in the previous commits.

When such an attribute is seen during type construction and its argument
can't be resolved yet, build the CountAttributedType immediately with
getIncompleteCountAttributedType and record it against the enclosing record;
its count expression is filled in at the closing brace via the refill logic.
Because enclosing types refer to the node by pointer, completing it in place
leaves the type chain untouched -- no rebuild, no TypeLoc re-emission.

  - Sema::ActOnLateParsedTypeAttr builds the incomplete node; the parser
    callback stores it on the LateParsedTypeAttribute and records the
    attribute in the record currently being parsed.
    Parser::CompleteLateParsedTypeAttributes drains that list at the closing
    brace; a nested anonymous record hands its pending attributes up to the

    [9 lines not shown]
DeltaFile
+178-25clang/lib/Parse/ParseDecl.cpp
+29-50clang/test/Sema/attr-counted-by-late-parsed-struct-ptrs.c
+14-50clang/test/Sema/attr-counted-by-or-null-late-parsed-struct-ptrs.c
+62-0clang/lib/Sema/SemaType.cpp
+11-42clang/test/Sema/attr-sized-by-or-null-late-parsed-struct-ptrs.c
+10-42clang/test/Sema/attr-sized-by-late-parsed-struct-ptrs.c
+304-20914 files not shown
+404-38520 files

LLVM/project a468dbfclang/lib/Sema SemaDecl.cpp SemaDeclAttr.cpp

[BoundsSafety] Handle the counted_by family as a type attribute

counted_by / sized_by (and their _or_null variants) were handled in only one
way: a declaration-position attribute went through handleCountedByAttrField,
which validated it and then patched the field afterwards with
FieldDecl::setType. There was no type-position handling at all.

Build the type during type construction instead, from a single handler that
serves both positions:

  - Add HandleCountedByAttrOnType and dispatch the counted_by family to it
    from processTypeAttrs, going through the shared
    validateBoundsAttrTypeForTypePosition leaf.
  - Remove handleCountedByAttrField. Its FieldDecl-based type-shape checks in
    Sema::CheckCountedByAttrOnField are superseded by
    Sema::ValidateBoundsAttrTypeShape, added in the previous commit and now
    reached from the type path, and are deleted; no diagnostic is dropped. The
    checks that genuinely need the FieldDecl (union member, non-flexible
    array, cross-struct count) stay in CheckCountedByAttrOnField and run from

    [11 lines not shown]
DeltaFile
+3-109clang/lib/Sema/SemaBoundsSafety.cpp
+69-1clang/lib/Sema/SemaType.cpp
+0-44clang/lib/Sema/SemaDeclAttr.cpp
+22-1clang/lib/Sema/SemaDecl.cpp
+94-1554 files

LLVM/project 23d948eclang/include/clang/Parse Parser.h, clang/include/clang/Sema DeclSpec.h

[BoundsSafety][NFC] Thread a late-parsed attribute list through declarators

A late-parsed type attribute is written in the middle of a declarator, so the
list it lands in has to travel with the declarator pieces until the enclosing
record can supply its argument. Add that storage and plumbing, with nothing
producing or consuming it yet:

  - Move CachedTokens and LateParsedAttrList earlier in DeclSpec.h so DeclSpec,
    Declarator and DeclaratorChunk can hold one.
  - Give DeclSpec, Declarator and DeclaratorChunk a LateParsedAttrList, and let
    Declarator::AddTypeInfo carry one onto the chunk it appends.
  - Give ParseSpecifierQualifierList and ParseTypeQualifierListOpt an optional
    LateParsedAttrList parameter, passed down to ParseDeclarationSpecifiers.

No functional change: the lists stay empty and no caller passes one. The next
commit populates them.
DeltaFile
+54-33clang/include/clang/Sema/DeclSpec.h
+14-9clang/include/clang/Parse/Parser.h
+12-3clang/lib/Parse/ParseDecl.cpp
+80-453 files

LLVM/project 8867becclang/include/clang/Parse Parser.h, clang/include/clang/Sema Sema.h

[BoundsSafety][NFC] Add the Sema/Parser bridge for late-parsed type attributes

A late-parsed bounds attribute has to build its type when the attribute is
seen, but its argument isn't parseable until the enclosing record is complete.
Building that type needs the Parser (which owns the cached tokens) and Sema
(which owns type construction) to meet:

  - Sema::ActOnLateParsedTypeAttr validates a counted_by-family attribute for
    the type position and, if valid, wraps the type in a CountAttributedType
    whose count is not yet known, handing the node back for completion.

  - Parser::ProcessLateParsedTypeAttrCallback is the Parser-side entry point,
    registered on Sema so Sema can call back without including Parser.h (the
    same pattern as LateTemplateParserCallback). It reuses an already-built
    node so several declarators sharing one attribute share one type.

No functional change: nothing records late-parsed type attributes yet, so the
callback is never invoked. The next commit wires it up.
DeltaFile
+32-0clang/lib/Parse/ParseDecl.cpp
+21-0clang/lib/Sema/SemaType.cpp
+21-0clang/include/clang/Sema/Sema.h
+14-0clang/include/clang/Parse/Parser.h
+5-0clang/lib/Parse/Parser.cpp
+93-05 files

LLVM/project fae8687clang/include/clang/Basic DiagnosticSemaKinds.td LangOptions.h, clang/include/clang/Sema Sema.h

[BoundsSafety][NFC] Add counted_by type-shape validation helper

Introduce the single "is this type valid for a counted_by-family attribute in
type position" leaf that both the eager type-attribute path and the
late-parsed path will call:

  - Sema::ValidateBoundsAttrTypeShape holds the type-shape checks -- pointer
    or flexible array member, void and function pointee, pointee that is a
    struct with a flexible array member -- and their diagnostics.
  - validateBoundsAttrTypeForTypePosition wraps it for type position and adds
    the nested-pointer rejection, reported with the new
    err_counted_by_on_nested_pointer diagnostic.

Supporting pieces: Sema::BoundsAttrFlags and Sema::getBoundsAttrKind,
getCountAttrKind, getPointerNestLevel, the CountedByInvalidPointeeTypeKind
enum, and LangOptions::hasBoundsSafetyAttributes(), a stub returning false so
the shared leaf can gate its -fbounds-safety-only branches with the same
predicate used downstream.


    [2 lines not shown]
DeltaFile
+112-0clang/lib/Sema/SemaBoundsSafety.cpp
+83-0clang/lib/Sema/SemaType.cpp
+24-0clang/include/clang/Sema/Sema.h
+7-0clang/include/clang/Basic/LangOptions.h
+3-0clang/include/clang/Basic/DiagnosticSemaKinds.td
+229-05 files

LLVM/project 7817563llvm/lib/Target/X86 X86FastISel.cpp, llvm/test/CodeGen/X86 fast-isel-gep.ll

[X86] Fix `FastISel` crash on `GEP` with a constant index wider than `64` bits (#223432)

Fixes #220954

When FastISel folds a GEP into an X86 addressing mode, it reads each
constant index with `getSExtValue()` and adds it to the displacement.
That call asserts if the constant has more than 64 significant bits, so
a `getelementptr` with an `i128` index of `2^64` feeding a legal-typed
load crashes at `-O0`. The LangRef says a GEP index is sign-extended or
truncated to the pointer width, and both generic FastISel and
SelectionDAGBuilder already do exactly that (added in 2015 for this same
assertion). The X86 address folder was the one GEP lowering that never
got the same treatment.

The index is now truncated to 64 bits before it is folded, mirroring
`FastISel::selectGetElementPtr`. For the reproducer the index becomes
zero and the load addresses the alloca directly, which is also what
SelectionDAG produces for the same IR. The other integer conversions in
`X86SelectAddress` are already safe: struct indices are
verifier-enforced `i32`, and the folded-add and `Add` paths only match
values whose type already equals the pointer width.
DeltaFile
+27-2llvm/test/CodeGen/X86/fast-isel-gep.ll
+3-2llvm/lib/Target/X86/X86FastISel.cpp
+30-42 files

LLVM/project f98160dclang/lib/CIR/Lowering LoweringHelpers.cpp, clang/test/CIR/CodeGen global-address-to-int.c

[CIR] Give up when we hit a global-view in dense-element-attr lowering (#224379)

A ptr-to-int conversion can't be converted to an APInt/APFloat, so this
ends up not being able to produce a valid dense element attr. This patch
makes us 'fall back' to the insert-value version of any potential
dense-elements lowering if there is a global view as one of the values.
DeltaFile
+15-5clang/lib/CIR/Lowering/LoweringHelpers.cpp
+10-0clang/test/CIR/Lowering/const-array-bulk-lowering-fallbacks.cir
+6-0clang/test/CIR/CodeGen/global-address-to-int.c
+31-53 files

LLVM/project 6e25b1cclang/lib/CIR/CodeGen CIRGenModule.cpp, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR] Correctly pass func self-comdat & alignment (#223773)

Classic codegen does these, and it is important for when these end up
being stored as function pointers, as we discovered on a benchmark.

This patch does 2 things:

1- Properly passes the 'self' 'comdat' feature (that is, when the symbol
    reference is 'self', not when it is a different name, which isn't
    implemented anywhere).  This mirrors what was done for GlobalOp.

2- Properly calculate and pass the 'alignment'/'preferred alignment' for
a function. Only the 'alignment' is passed to LLVM-IR, as the dialect
doesn't support preferred alignment, so a 'missing feature' is left in
place. That functionality isn't important to this patch, but was 'next
to' the alignment work in CodeGenModule.cpp, so it seemed like something
we should handle if at all possible.
DeltaFile
+44-14clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+47-0clang/test/CIR/IR/invalid-func.cir
+43-0clang/test/CIR/CodeGen/func-member-attrs.cpp
+36-0clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+23-0clang/lib/CIR/CodeGen/CIRGenModule.cpp
+21-0clang/test/CIR/IR/func.cir
+214-1416 files not shown
+260-5922 files

LLVM/project 88e118fllvm/lib/Target/X86 X86TargetTransformInfo.cpp, llvm/test/Transforms/LoopVectorize/X86 replicating-load-store-costs.ll pr217019.ll

[x86][CostModel] A runtime stride should cost one ADD on AVX2+ (#219903)

Runtime stride should cost one ADD per iteration. Only when the loop has
no fixed step do we need the AVX2 cut-off.

Closes #217019.
DeltaFile
+448-0llvm/test/Transforms/LoopVectorize/X86/pr217019.ll
+15-51llvm/test/Transforms/LoopVectorize/X86/replicating-load-store-costs.ll
+8-6llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+471-573 files

LLVM/project cb9d4cdclang/tools/offload-arch AMDGPUArchByKFD.cpp, clang/unittests/offload-arch OffloadArchTest.cpp

[offload-arch] Report gfx1250-strict to match rocminfo (#224480)

## Motivation

offload-arch would print gfx1250, but rocminfo reports gfx1250-strict on
revision 0s. We want to print the gfx1250-strict too.

Note: This is based off a [similar PR in
rocm-systems](https://github.com/ROCm/rocm-systems/pull/11639).

## Required Changes

* llvm already can parse the gfx1250 -strict target, so no changes
necessary there.
* offload-arch already printed gfx1250, so just needed to get the ASIC
Revision, which is in bits 25:22 in the capability property.
* If ASIC Revision is 0 and gfx_target_version is gfx1250, then report
"gfx1250-strict"


    [5 lines not shown]
DeltaFile
+35-0clang/unittests/offload-arch/OffloadArchTest.cpp
+28-6clang/tools/offload-arch/AMDGPUArchByKFD.cpp
+63-62 files

LLVM/project a7a017cmlir/lib/Dialect/ControlFlow/IR ControlFlowOps.cpp, mlir/lib/Dialect/LLVMIR/IR LLVMDialect.cpp

[MLIR][Parser] Fix result numbers not being allowed in switch statements (#224581)

PR #87658 fixed this for the `case` branch for `cf.switch`, but not the
`default` case. Moreover, `llvm.switch` has the same problem. This PR
fixes them.
DeltaFile
+13-0mlir/test/Dialect/LLVMIR/roundtrip.mlir
+13-0mlir/test/Dialect/ControlFlow/ops.mlir
+2-2mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp
+1-2mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
+29-44 files

LLVM/project a41ea60lldb/source/Plugins/SymbolFile/DWARF DWARFASTParserFortran.h DWARFASTParserFortran.cpp, lldb/source/Plugins/TypeSystem/Fortran TypeSystemFortran.h TypeSystemFortran.cpp

[lldb][Fortran] Added support for base types to DWARFASTParserFortran, tests for DWARFASTParserFortran and a method to get the parser from TypeSystemFortran
DeltaFile
+209-0lldb/unittests/SymbolFile/DWARF/DWARFASTParserFortranTests.cpp
+127-4lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserFortran.cpp
+17-1lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserFortran.h
+8-0lldb/source/Plugins/TypeSystem/Fortran/TypeSystemFortran.cpp
+3-0lldb/source/Plugins/TypeSystem/Fortran/TypeSystemFortran.h
+2-0lldb/unittests/SymbolFile/DWARF/CMakeLists.txt
+366-56 files

LLVM/project 13be70aclang/test/Modules bounds-safety-attributed-type-late-parsed.c, clang/test/PCH bounds-safety-attributed-type-late-parsed.c

[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.
DeltaFile
+456-0clang/test/Sema/attr-counted-by-weird-type-positions-late-parsed.c
+454-0clang/test/Sema/attr-counted-by-weird-type-positions.c
+173-0clang/test/Sema/attr-bounds-safety-function-ptr-param.c
+111-0clang/test/Modules/bounds-safety-attributed-type-late-parsed.c
+92-0clang/test/Sema/attr-counted-by-late-parsed-regressions.c
+69-0clang/test/PCH/bounds-safety-attributed-type-late-parsed.c
+1,355-04 files not shown
+1,505-010 files

LLVM/project 58946c7clang/lib/Parse ParseDecl.cpp, clang/lib/Sema SemaType.cpp

[BoundsSafety] Create incomplete counted_by types and wire up the refill

Activate late parsing for the counted_by family (counted_by / sized_by and
their _or_null variants) in type-attribute position, under
-fexperimental-late-parse-attributes, on top of the type-attribute handling,
the validation helper and the refill machinery added in the previous commits.

When such an attribute is seen during type construction and its argument
can't be resolved yet, build the CountAttributedType immediately with
getIncompleteCountAttributedType and record it against the enclosing record;
its count expression is filled in at the closing brace via the refill logic.
Because enclosing types refer to the node by pointer, completing it in place
leaves the type chain untouched -- no rebuild, no TypeLoc re-emission.

  - Sema::ActOnLateParsedTypeAttr builds the incomplete node; the parser
    callback stores it on the LateParsedTypeAttribute and records the
    attribute in the record currently being parsed.
    Parser::CompleteLateParsedTypeAttributes drains that list at the closing
    brace; a nested anonymous record hands its pending attributes up to the

    [9 lines not shown]
DeltaFile
+178-25clang/lib/Parse/ParseDecl.cpp
+29-50clang/test/Sema/attr-counted-by-late-parsed-struct-ptrs.c
+14-50clang/test/Sema/attr-counted-by-or-null-late-parsed-struct-ptrs.c
+62-0clang/lib/Sema/SemaType.cpp
+11-42clang/test/Sema/attr-sized-by-or-null-late-parsed-struct-ptrs.c
+10-42clang/test/Sema/attr-sized-by-late-parsed-struct-ptrs.c
+304-20914 files not shown
+404-38520 files

LLVM/project 64a2b39clang/lib/Sema SemaDecl.cpp SemaDeclAttr.cpp

[BoundsSafety] Handle the counted_by family as a type attribute

counted_by / sized_by (and their _or_null variants) were handled in only one
way: a declaration-position attribute went through handleCountedByAttrField,
which validated it and then patched the field afterwards with
FieldDecl::setType. There was no type-position handling at all.

Build the type during type construction instead, from a single handler that
serves both positions:

  - Add HandleCountedByAttrOnType and dispatch the counted_by family to it
    from processTypeAttrs, going through the shared
    validateBoundsAttrTypeForTypePosition leaf.
  - Remove handleCountedByAttrField. Its FieldDecl-based type-shape checks in
    Sema::CheckCountedByAttrOnField are superseded by
    Sema::ValidateBoundsAttrTypeShape, added in the previous commit and now
    reached from the type path, and are deleted; no diagnostic is dropped. The
    checks that genuinely need the FieldDecl (union member, non-flexible
    array, cross-struct count) stay in CheckCountedByAttrOnField and run from

    [11 lines not shown]
DeltaFile
+3-109clang/lib/Sema/SemaBoundsSafety.cpp
+69-1clang/lib/Sema/SemaType.cpp
+0-44clang/lib/Sema/SemaDeclAttr.cpp
+22-1clang/lib/Sema/SemaDecl.cpp
+94-1554 files

LLVM/project 9e24d7aclang/include/clang/Parse Parser.h, clang/include/clang/Sema DeclSpec.h

[BoundsSafety][NFC] Thread a late-parsed attribute list through declarators

A late-parsed type attribute is written in the middle of a declarator, so the
list it lands in has to travel with the declarator pieces until the enclosing
record can supply its argument. Add that storage and plumbing, with nothing
producing or consuming it yet:

  - Move CachedTokens and LateParsedAttrList earlier in DeclSpec.h so DeclSpec,
    Declarator and DeclaratorChunk can hold one.
  - Give DeclSpec, Declarator and DeclaratorChunk a LateParsedAttrList, and let
    Declarator::AddTypeInfo carry one onto the chunk it appends.
  - Give ParseSpecifierQualifierList and ParseTypeQualifierListOpt an optional
    LateParsedAttrList parameter, passed down to ParseDeclarationSpecifiers.

No functional change: the lists stay empty and no caller passes one. The next
commit populates them.
DeltaFile
+54-33clang/include/clang/Sema/DeclSpec.h
+14-9clang/include/clang/Parse/Parser.h
+12-3clang/lib/Parse/ParseDecl.cpp
+80-453 files

LLVM/project 2249d35clang/include/clang/Parse Parser.h, clang/include/clang/Sema Sema.h

[BoundsSafety][NFC] Add the Sema/Parser bridge for late-parsed type attributes

A late-parsed bounds attribute has to build its type when the attribute is
seen, but its argument isn't parseable until the enclosing record is complete.
Building that type needs the Parser (which owns the cached tokens) and Sema
(which owns type construction) to meet:

  - Sema::ActOnLateParsedTypeAttr validates a counted_by-family attribute for
    the type position and, if valid, wraps the type in a CountAttributedType
    whose count is not yet known, handing the node back for completion.

  - Parser::ProcessLateParsedTypeAttrCallback is the Parser-side entry point,
    registered on Sema so Sema can call back without including Parser.h (the
    same pattern as LateTemplateParserCallback). It reuses an already-built
    node so several declarators sharing one attribute share one type.

No functional change: nothing records late-parsed type attributes yet, so the
callback is never invoked. The next commit wires it up.
DeltaFile
+32-0clang/lib/Parse/ParseDecl.cpp
+21-0clang/lib/Sema/SemaType.cpp
+21-0clang/include/clang/Sema/Sema.h
+14-0clang/include/clang/Parse/Parser.h
+5-0clang/lib/Parse/Parser.cpp
+93-05 files

LLVM/project 64902e0llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp, llvm/test/CodeGen/X86 combine-mulo.ll

[DAG] Don't constant fold opaque constants in visitMULO (#224494)

Opaque constants (created for constants hoisted by ConstantHoisting) are
deliberately not folded by FoldConstantArithmetic for binary operations,
so that the hoisted constant is not rematerialized in each user. The MULO
fold in DAGCombiner did not check for this. 

The second test reveals a second opaque constant problem - apparently
our constant RHS canonicalization isn't properly handling opaque
constants. (This change is about three split attempts off of something that
was supposed to be fairly trivial. I decided to stop here.)

Assisted-by: Claude Fable 5.1
DeltaFile
+26-0llvm/test/CodeGen/X86/combine-mulo.ll
+1-1llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+27-12 files

LLVM/project 38ca6e6lldb/source/Plugins/TypeSystem/Fortran TypeSystemFortran.cpp

Removed GetTypeName switch default
DeltaFile
+2-1lldb/source/Plugins/TypeSystem/Fortran/TypeSystemFortran.cpp
+2-11 files

LLVM/project 0655409clang/include/clang/Basic DiagnosticSemaKinds.td LangOptions.h, clang/include/clang/Sema Sema.h

[BoundsSafety][NFC] Add counted_by type-shape validation helper

Introduce validateCountedByAttrType and its supporting helpers
(getCountAttrKind, getPointerNestLevel, the CountedByInvalidPointeeTypeKind
enum) plus the err_counted_by_on_nested_pointer diagnostic. This is the
single "is this type valid for a counted_by-family attribute" leaf that both
the eager type-attribute path and the late-parsed path will call.

Unused at this point -- nothing invokes it yet -- so this is NFC. The callers
are added in the following commits.
DeltaFile
+112-0clang/lib/Sema/SemaBoundsSafety.cpp
+83-0clang/lib/Sema/SemaType.cpp
+24-0clang/include/clang/Sema/Sema.h
+7-0clang/include/clang/Basic/LangOptions.h
+3-0clang/include/clang/Basic/DiagnosticSemaKinds.td
+229-05 files

LLVM/project e4fbd2flldb/source/Plugins/TypeSystem/Fortran TypeSystemFortran.h TypeSystemFortran.cpp, lldb/unittests/Symbol TestTypeSystemFortran.cpp

[lldb][Fortran] Added spacing after 1-line ifs, inlined type cases and added default name for all base types
DeltaFile
+33-25lldb/source/Plugins/TypeSystem/Fortran/TypeSystemFortran.cpp
+2-2lldb/source/Plugins/TypeSystem/Fortran/TypeSystemFortran.h
+3-0lldb/unittests/Symbol/TestTypeSystemFortran.cpp
+38-273 files

LLVM/project fce3facllvm/include/llvm/Support LLVMDriver.h Driver.h, llvm/lib/Support Driver.cpp

Reapply [Support] ToolSession for in-process tool invocation (#224515)

This PR Relands #221996, which was approved and merged but reverted in
#224368 after failures in the Fuchsia builders.

This PR contains two commits:

1. The original approved commit, reapplied without changes.
2. A small follow-up fixing the reported failures.

The problem was that a direct Clang invocation was incorrectly marked as
needing a prepended tool name. When Clang launched cc1 out of process,
we produced:

    clang clang -cc1 ...

instead of:

    clang -cc1 ...

    [11 lines not shown]
DeltaFile
+162-0llvm/unittests/Support/LLVMToolSession/LLVMToolSessionTest.cpp
+134-0llvm/lib/Support/Driver.cpp
+96-0llvm/include/llvm/Support/Driver.h
+22-50llvm/tools/llvm-driver/llvm-driver.cpp
+0-27llvm/include/llvm/Support/LLVMDriver.h
+20-0llvm/unittests/Support/LLVMToolSession/CMakeLists.txt
+434-7731 files not shown
+473-10537 files

LLVM/project 8f68ddfclang-tools-extra/clang-tidy/misc ConstCorrectnessCheck.cpp, clang-tools-extra/docs ReleaseNotes.md

[clang-tidy] Skip `decltype(auto)` variables in misc-const-correctness (#224465)

Since #157319 the check analyzes `auto` variables, which also pulled in
`decltype(auto)`. Its fix-it inserts `const`, but `decltype(auto)`
cannot be combined with other type specifiers, so the fix does not
compile:

```cpp
decltype(auto) x = get_ref();
decltype(auto) const x = get_ref();  // error
```

Exclude such variables from the analysis, as no `const` can be added.

Fixes #223940
DeltaFile
+34-0clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-decltype-auto.cpp
+7-1clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp
+3-0clang-tools-extra/docs/ReleaseNotes.md
+44-13 files

LLVM/project 8fe013cllvm/include/llvm/Analysis ValueTracking.h, llvm/lib/Analysis Loads.cpp ValueTracking.cpp

[Loads] Fix incorrect replacement of pointers with different provenance (#224281)

isPointerAlwaysReplaceable() uses getUnderlyingObject() to check whether
the two pointers have the same provenance, because in that case the
replacement is always legal. However, getUnderlyingObject() does not
actually guarantee that the provenance is the same: In particular, it
can look through some intrinsics like strip.invariant.group and
launder.invariant.group, which do change the provenance of the pointer.
And replacing the result of those intrinsics with their argument is
indeed incorrect.

Fix this by adding a MustPreserveProvenance argument to the relevant
APIs, and enable it in isPointerAlwaysReplaceable().

Noticed while working on
https://github.com/llvm/llvm-project/pull/224222.
DeltaFile
+25-13llvm/include/llvm/Analysis/ValueTracking.h
+28-0llvm/test/Transforms/GVN/assume-equal.ll
+16-9llvm/lib/Analysis/ValueTracking.cpp
+2-2llvm/lib/Analysis/Loads.cpp
+71-244 files

LLVM/project 024b25elibcxx/test/configs stdlib-libstdc++.cfg.in

[libc++] Locate libstdc++ by querying GCC in the libstdc++ test configuration (#224335)

Instead of hardcoding various paths to locate libstdc++ artifacts, just
provide the compiler and derive all paths from that. This makes it
simpler to run against a pre-installed libstdc++.
DeltaFile
+80-28libcxx/test/configs/stdlib-libstdc++.cfg.in
+80-281 files

LLVM/project c188164.github/workflows libcxx-pr-benchmark.yml, libcxx/test/configs installed-libc++.cfg.in

[libc++] Allow specifying a configuration in test-at-commit (#224381)

test-at-commit always generated its own Lit configuration pointing at
the libc++ installation given with --libcxx-installation, which meant it
could only ever test libc++. This patch generalizes this to allow
support passing a custom Lit config, which allows using the script for a
wider array of use cases.
DeltaFile
+11-36libcxx/utils/test-at-commit
+46-0libcxx/test/configs/installed-libc++.cfg.in
+2-2libcxx/utils/ci/run-buildbot
+2-2.github/workflows/libcxx-pr-benchmark.yml
+2-1libcxx/utils/ci/lnt/run-benchmarks
+63-415 files

LLVM/project c9074cfclang/include/clang/AST DeclBase.h, clang/lib/Sema SemaCoroutine.cpp SemaDeclCXX.cpp

Reapply "[Clang] Fix a number of issues involving expansion statements" (#220375) (#223005)

This reverts 7c44c505cd7688a8994779f1751e0f9b4b95ab4c and relands
#217110.

There were two tests that needed updating: one because a warning that
had previously been erroneously suppressed (because we thought we
weren’t in a function) now works properly, and another because it
crashes due to an unrelated bug. I’ve filed #223003 for the latter and
moved the crash into a separate XFAIL test so it can be reenabled when
the bug is fixed.

The plan was to backport this to the 23 release branch, so still no
release note.
DeltaFile
+200-0clang/test/SemaCXX/cxx2c-expansion-stmts.cpp
+24-6clang/lib/Sema/SemaDeclCXX.cpp
+4-22clang/test/SemaCXX/expansion-statements-local-extern-decls.cpp
+26-0clang/include/clang/AST/DeclBase.h
+19-0clang/test/SemaCXX/expansion-statements-local-extern-if-constexpr.cpp
+7-9clang/lib/Sema/SemaCoroutine.cpp
+280-378 files not shown
+308-4814 files

LLVM/project 33fe720flang-rt/include/flang-rt/runtime tools.h, flang-rt/lib/runtime tools.cpp

[flang-rt] Compile ShallowCopyModifiedSuffix for the device (#224485)

#222101 introduced `ShallowCopyModifiedSuffix` as the callee of
`CopyOutAssign` and deliberately left it outside the offload API group,
with a comment claiming its only caller is host-only. This fix moves the
`ShallowCopyModifiedSuffix` family into the offload API group and marks
it `RT_API_ATTRS`, exactly like the `ShallowCopy` family it mirrors.

Also resolved the merge conflict with #224570 (the reland of #224063):
the new CopyOutAssignDirect entry point needed the same treatment.

Assisted-by: AI
DeltaFile
+11-9flang-rt/lib/runtime/tools.cpp
+2-3flang-rt/include/flang-rt/runtime/tools.h
+13-122 files