LLVM/project 05d706eutils/bazel/llvm-project-overlay/libc/test libc_test_rules.bzl, utils/bazel/llvm-project-overlay/libc/test/src/__support/FPUtil BUILD.bazel

[bazel][test][libc] Add tags to tests marking full-build compatibility (#224457)
DeltaFile
+14-1utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl
+3-0utils/bazel/llvm-project-overlay/libc/test/src/__support/FPUtil/BUILD.bazel
+1-0utils/bazel/llvm-project-overlay/libc/test/src/math/libc_math_test_rules.bzl
+1-0utils/bazel/llvm-project-overlay/libc/test/src/complex/BUILD.bazel
+19-14 files

LLVM/project 452343dclang/include/clang/CIR/Dialect Passes.h, clang/lib/CodeGen CodeGenModule.cpp

[LLVMABI] Add Clang 23 compatible handling for matrix types (#224121)

This change updates the LLVM ABI library to enable Clang 23 compatible
classification of matrix types when the `-fclang-abi-compt=23` option is
used. Clang versions 23 and earlier did not accept matrix types as base
types for homogeneous aggregates, but the current version does. The LLVM
ABI library use the new behavior when isHomogeneousAggregate was
introduced there. This change adds an ABICompatInfo setting to allow
version 23 compatibility to be implemented.

This change also moves X86-specific ABI compatibility options into an
X86-specific subclass of ABICompatInfo.

Assisted-by: Cursor / various models
DeltaFile
+30-15clang/lib/CodeGen/CodeGenModule.cpp
+19-18llvm/include/llvm/ABI/TargetInfo.h
+19-12llvm/lib/ABI/Targets/X86.cpp
+29-0clang/test/CodeGen/AArch64/abi-lowering-matrix-ha-compat23.c
+4-4llvm/unittests/ABI/X86TargetInfoTest.cpp
+5-3clang/include/clang/CIR/Dialect/Passes.h
+106-525 files not shown
+123-5811 files

LLVM/project 6eba534mlir/include/mlir/Dialect/XeGPU/uArch uArchBase.h, mlir/lib/Dialect/XeGPU/Transforms XeGPULayoutImpl.cpp

[mlir][xegpu] Derive load_nd lane_data from the hardware block variant (#223164)

setupLoadNdAnchorLayout copied lane_data from the consumer layout. But
lane_data follows from the element width and the block variant the
hardware will use, not from what the consumer wants.

This PR adds get2DBlockLoadLaneData, deriving lane_data from the packing
size the uArch already reports: the load's packed format size along the
innermost dim for a regular 2d block load, the general packed format
size along the second-innermost dim for transform (VNNI), or along the
innermost dim for transpose.

On the fallback path, where the consumer's inst_data is not a usable
block, also pick the variant that can host that lane_data. DPAS_MX
scales land here: width 16 for an 8-bit scale cannot spread 16 lanes of
2 elements over 32 columns, so it is loaded transformed, packing down
the column instead.

scale_a inst_data = [16, 32], lane_layout = [16, 1], lane_data = [1, 4],

    [11 lines not shown]
DeltaFile
+97-64mlir/lib/Dialect/XeGPU/Transforms/XeGPULayoutImpl.cpp
+18-18mlir/test/Dialect/XeGPU/propagate-layout-inst-data.mlir
+2-4mlir/include/mlir/Dialect/XeGPU/uArch/uArchBase.h
+117-863 files

LLVM/project 47b54edlibc/test/src/math RoundToIntegerTest.h, libc/test/src/math/smoke RoundToIntegerTest.h UfromfpxTest.h

[libc][math][NFC] Fix duplicated class names in math tests. (#224666)

This might cause ODR issues when we put all the tests together into a
single test.

Assisted-by: Gemini
DeltaFile
+18-18libc/test/src/math/smoke/UfromfpxTest.h
+18-18libc/test/src/math/smoke/UfromfpTest.h
+18-18libc/test/src/math/smoke/FromfpxTest.h
+18-18libc/test/src/math/smoke/FromfpTest.h
+12-18libc/test/src/math/RoundToIntegerTest.h
+11-17libc/test/src/math/smoke/RoundToIntegerTest.h
+95-107649 files not shown
+1,258-1,157655 files

LLVM/project 74bd024llvm/lib/Target/AMDGPU AMDGPUTargetParser.td, llvm/utils/TableGen/Basic AMDGPUTargetDefEmitter.cpp

Address comments

Change-Id: I8f0bc34904dd7eaa5de2677d4b91cfa3bac75194
DeltaFile
+6-3llvm/utils/TableGen/Basic/AMDGPUTargetDefEmitter.cpp
+3-3llvm/lib/Target/AMDGPU/AMDGPUTargetParser.td
+9-62 files

LLVM/project 194fbc4clang/lib/StaticAnalyzer/Checkers/WebKit ASTUtils.cpp, clang/test/Analysis/Checkers/WebKit objc-mock-types.h call-args.cpp

Revert "[alpha.webkit.UnretainedCallArgsChecker] Emit a warning for a non-const RetainPtr member (#184243)" (#224464)

This reverts bf005a1227a4822c7c2535dd5f5f3626fbe441b2 as it introduced
too many new warnings.
DeltaFile
+0-184clang/test/Analysis/Checkers/WebKit/unretained-call-args-member.mm
+0-53clang/test/Analysis/Checkers/WebKit/call-args.cpp
+3-8clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
+0-4clang/test/Analysis/Checkers/WebKit/objc-mock-types.h
+3-2494 files

LLVM/project 50c5639llvm/include/llvm/Transforms/IPO LowerTypeTests.h, llvm/lib/Transforms/IPO ThinLTOBitcodeWriter.cpp LowerTypeTests.cpp

[ThinLTOBitcodeWriter] Encode hotness into cfi.functions metadata (#223846)

Encode function hotness classification (`Hot`, `Other`, `Cold`, or
`Unknown`) into the upper bits of the linkage operand in `cfi.functions`
metadata.

`CfiFunctionHotness::fromFunction` mirrors `CodeGenPrepare` section
assignment logic using function attributes (`hot`/`cold`),
`ProfileSummaryInfo`, and `BlockFrequencyInfo`. This allows
`LowerTypeTests` to order CFI jump table entries by function hotness so
the jump table lands in a hot section and the hottest target benefits
from last-entry fall-through relaxation.

PR Stack:
* https://github.com/llvm/llvm-project/pull/220776
* https://github.com/llvm/llvm-project/pull/221043
* https://github.com/llvm/llvm-project/pull/221044
* https://github.com/llvm/llvm-project/pull/223843
* ➤ https://github.com/llvm/llvm-project/pull/223846

    [3 lines not shown]
DeltaFile
+99-8llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+17-12llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-functions-hotness.ll
+18-9llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
+6-2llvm/include/llvm/Transforms/IPO/LowerTypeTests.h
+140-314 files

LLVM/project 4a5ed6dllvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV/rvv trunc-sat-clip-sdnode.ll fixed-vectors-trunc-sat-clip.ll

[RISCV] Remove combineTruncToVnclip. (#224418)

This is very similar to foldToSaturated but operating on RISCVISD _VL
nodes instead of generic nodes.

combineTruncToVnclip handled some additional cases that the middle end
doesn't consider canonical. This was necessary for VP intrinsics that
skipped middle end canonicalization.

For patterns that saturate a signed value into an unsigned value the
canonical form uses an smax to make negative values positive followed by
a umin.

I have updated the tests to be in canonical form or remove if there was
already a canonical test. I had to update one other transform to emit
code in canonical form.
DeltaFile
+505-536llvm/test/CodeGen/RISCV/rvv/fpclamptosat_vec.ll
+2-134llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+6-124llvm/test/CodeGen/RISCV/rvv/trunc-sat-clip-sdnode.ll
+6-124llvm/test/CodeGen/RISCV/rvv/fixed-vectors-trunc-sat-clip.ll
+519-9184 files

LLVM/project 631894fclang/include/clang/CIR/Dialect Passes.td, clang/lib/CIR/Dialect/Transforms LoweringPrepare.cpp

[CIR] Source LoweringPrepare target facts from the module (#219078)

LoweringPrepare reads a few target-derived facts (guard-variable width,
COMDAT format, _tlv_atexit/__cxa_thread_atexit selection) from the
ASTContext's TargetInfo.

This builds a LowerModule from the module's own cir.triple and reads
those facts from it instead, so target-derived lowering is consistent
with how the module was created rather than with the current invocation.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply at anthropic.com>
DeltaFile
+18-7clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp
+1-1clang/include/clang/CIR/Dialect/Passes.td
+19-82 files

LLVM/project a3d9bddllvm/lib/Transforms/IPO GlobalOpt.cpp MergeFunctions.cpp, llvm/lib/Transforms/Instrumentation CGProfile.cpp

[Transforms] Use make_isa_range for type-filtered loops (NFC) (#224597)

Use make_isa_range (added in
https://github.com/llvm/llvm-project/pull/223414) for dyn_cast/continue
loops.

PR: https://github.com/llvm/llvm-project/pull/224597
DeltaFile
+5-7llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+4-7llvm/lib/Transforms/Instrumentation/CGProfile.cpp
+2-5llvm/lib/Transforms/Utils/LoopUnroll.cpp
+2-5llvm/lib/Transforms/IPO/SampleProfile.cpp
+1-5llvm/lib/Transforms/IPO/GlobalOpt.cpp
+2-4llvm/lib/Transforms/IPO/MergeFunctions.cpp
+16-332 files not shown
+18-418 files

LLVM/project 1598802llvm/test/MC/RISCV/rvv xsfmm-invalid.s

[RISCV] Add missing feature to RUN line of xsfmm-invalid.s. NFC (#224473)

This test was supposed to test invalid operands not invalid
instructions.
DeltaFile
+6-6llvm/test/MC/RISCV/rvv/xsfmm-invalid.s
+6-61 files

LLVM/project 7dcbc96llvm/test/Transforms/SLPVectorizer/AArch64 sibling-loops-different-trip-counts.ll

[SLP][NFC]Add a test with missing vectorization, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/224676
DeltaFile
+121-0llvm/test/Transforms/SLPVectorizer/AArch64/sibling-loops-different-trip-counts.ll
+121-01 files

LLVM/project 03a6445llvm/lib/CodeGen/SelectionDAG SelectionDAG.cpp DAGCombiner.cpp, llvm/test/CodeGen/X86 vector-reduce-xor.ll parity.ll

[DAG] Constant fold ISD::PARITY (#224387)

Context: Starting a claude assisted sweep for small gaps in SDAG's core
routines, starting with constant folding. This is the first of a small series
of patches covering small obvious seeming gaps. My main motivation
is simply making sure we have full coverage and as an exercise in 
getting myself re-started upstream as I've been inactive for a few
months.

ISD::PARITY was missing from getNode / FoldConstantArithmetic which
meant it wasn't being constant folded at construction. Also implement
the DAG combine so that an already created PARITY node can be folded
if it's arguments become constant. This is the path which actually
triggers outside of type legalization.

Since PARITY doesn't have an IR form, we have to form tests in a way to
let the DAG combine from ctpop form them. This results in somewhat
fragile tests which is unfortunate.  


    [2 lines not shown]
DeltaFile
+66-0llvm/test/CodeGen/X86/parity.ll
+13-0llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+1-5llvm/test/CodeGen/X86/vector-reduce-xor.ll
+4-0llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+84-54 files

LLVM/project 2d0fcacllvm/lib/Target/RISCV RISCVInstrInfoVVLPatterns.td

[RISCV] Remove unused SDT_RISCVVNBinOp_RM_VL tablegen class. NFC (#224440)
DeltaFile
+0-12llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
+0-121 files

LLVM/project 2859acaclang/include/clang/Basic SourceLocation.h

Mix bits in FileID::getHashValue() (#224654)

FileID's identity hash was fine under DenseMap's old quadratic probing,
but #200595 switched DenseMap to linear probing with backward-shift
deletion. FileID's bucket index under an identity hash is just its low
bits, so two runs of file IDs can map to the same buckets, which can
turn into a long clustered probe chain under linear probing.

Multiply by 37 to spread the low bits, which matches
SourceLocation::getHashValue(). This fixes a 2.6x compile-time
regression observed with -Wdocumentation on an ObjC++ file.

Reapplies #223794, which was reverted because it broke tests in
clang/test/Analysis/html_diagnostics. It is safe to reapply now that
#224510 fixed the underlying issue.

rdar://187026883

Co-authored-by: Fred Riss <friss at apple.com>
DeltaFile
+4-1clang/include/clang/Basic/SourceLocation.h
+4-11 files

LLVM/project c476f80clang/include/clang/Basic AttrDocs.td, clang/lib/AST Type.cpp

[clang][SYCL] Implement address space attributes for SYCL (#200849)

This PR adds SYCL address space attributes. These attributes are
intended for use in the implementation of SYCL run-time libraries and
should not be used in any other context.

The following attributes were added - [[clang::sycl_private]],
[[clang::sycl_global]], [[clang::sycl_local]], [[clang::sycl_constant]]
and [[clang::sycl_generic]]. These correspond to the five address spaces
described by SYCL 2020 section 3.8.2, "SYCL device memory model" and
SYCL 2020 section 4.7.7, "Address space classes".

Assisted by Claude

---------

Co-authored-by: Tom Honermann <tom at honermann.net>
DeltaFile
+388-0clang/test/SemaSYCL/sycl-address-space-attr-appertainment.cpp
+97-100clang/lib/Headers/__clang_spirv_builtins.h
+118-35clang/lib/AST/Type.cpp
+89-19clang/test/SemaSYCL/address-space-conversions.cpp
+99-0clang/include/clang/Basic/AttrDocs.td
+30-6clang/test/CodeGenSYCL/address-space-mangling.cpp
+821-16020 files not shown
+1,026-21926 files

LLVM/project faea6b2clang/lib/CIR/Dialect/Transforms/TargetLowering CIRABIRewriteContext.cpp, clang/test/CIR/CodeGen call-conv-lowering-x86_64-variadic.c call-conv-lowering-x86_64-byval-union-padding.c

[CIR] Preserve padding bytes across a byval argument

Fill the byval slot at the call site, and the parameter's own slot in
the callee, with a copy from the object's address rather than a store
of a loaded record value.  A store writes only the fields of the
record's type and leaves its padding unwritten, which for a union can
be another member's live data.  A _BitInt keeps its load and store,
since those are its conversion to and from memory.

Assisted-by: Cursor / claude-opus-5
DeltaFile
+107-0clang/test/CIR/CodeGen/call-conv-lowering-x86_64-byval-union-padding.c
+82-19clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp
+34-29clang/test/CIR/Transforms/abi-lowering/x86_64-bitint.cir
+16-16clang/test/CIR/CodeGen/call-conv-lowering-x86_64-variadic.c
+7-6clang/test/CIR/Transforms/abi-lowering/x86_64-union.cir
+3-5clang/test/CIR/Transforms/abi-lowering/indirect-byval.cir
+249-754 files not shown
+258-8610 files

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