LLVM/project 05c12f1llvm/utils/gn/secondary/compiler-rt/lib BUILD.gn, llvm/utils/gn/secondary/llvm/include/llvm/TargetParser BUILD.gn

[gn build] Format files (#214858)

`$ git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`
DeltaFile
+4-5llvm/utils/gn/secondary/llvm/tools/llvm-calc-occupancy/BUILD.gn
+1-3llvm/utils/gn/secondary/llvm/unittests/CAS/BUILD.gn
+1-3llvm/utils/gn/secondary/llvm/tools/libCASPluginTest/BUILD.gn
+2-2llvm/utils/gn/secondary/llvm/include/llvm/TargetParser/BUILD.gn
+1-1llvm/utils/gn/secondary/llvm/lib/Target/WebAssembly/BUILD.gn
+1-1llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn
+10-151 files not shown
+11-167 files

LLVM/project 056ecfdllvm/utils/gn/secondary/llvm/include/llvm/Config config.gni, llvm/utils/gn/secondary/llvm/tools/libCASPluginTest BUILD.gn

[gn build] Port CASPluginTest (#214856)
DeltaFile
+26-0llvm/utils/gn/secondary/llvm/tools/libCASPluginTest/BUILD.gn
+4-1llvm/utils/gn/secondary/llvm/unittests/CAS/BUILD.gn
+2-2llvm/utils/gn/secondary/llvm/include/llvm/Config/config.gni
+32-33 files

LLVM/project b5a7bb2clang/docs HardwareAssistedAddressSanitizerDesign.md AutomaticReferenceCounting.md, clang/docs/CIR CleanupAndEHDesign.md

Fix defects after reviewing HTML
DeltaFile
+98-34clang/docs/CommandGuide/clang.md
+38-38clang/docs/CIR/CleanupAndEHDesign.md
+6-9clang/docs/ControlFlowIntegrityDesign.md
+3-3clang/docs/AutomaticReferenceCounting.md
+2-2clang/docs/HardwareAssistedAddressSanitizerDesign.md
+147-865 files

LLVM/project e4d19d7clang/lib/Driver/ToolChains Clang.cpp

[NVPTX] Forward the `--ptxas-path` flag correctly (#213352)

Summary:
This wasn't included in the list of flags to forward.
DeltaFile
+1-0clang/lib/Driver/ToolChains/Clang.cpp
+1-01 files

LLVM/project b542602clang/lib/StaticAnalyzer/Checkers BuiltinFunctionChecker.cpp, clang/test/Analysis builtin_overflow.c

[clang][StaticAnalysis] Fix an false negative bug in handling '__builtin*overflow' (#214553)

For a binary operation 'A op B' and a result type 'T', these builtins
return true/false for whether the operation's result is a value 'T'
cannot hold. CSA models this by computing the operation's result in a
temporary type and comparing it against the bounds of 'T'. However, the
temporary type is only twice as wide as 'T', not the operands. When
either operand is wider than 'T's doubled width, the result of 'A op B'
can silently wrap around before the comparison, producing a false
negative.

The solution is to find the proper type to temporarily hold the result
of 'A op B' from types of 'A' and 'B'.

rdar://184263112

---------

Co-authored-by: Balázs Benics <benicsbalazs at gmail.com>
DeltaFile
+26-6clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
+8-0clang/test/Analysis/builtin_overflow.c
+34-62 files

LLVM/project 8320bcbflang/lib/Semantics mod-file.cpp resolve-names.cpp, flang/test/Semantics unparse-explicit-array-bounds.f90 modfile-explicit-shape-bounds.f90

[flang][semantic] Implement semantic checks and new data structure for explicit-shape-bounds-spec (#203030)

Since Lower and large parts of Semantics depend on ShapeSpec being a scalar bound, implement a class RankOneBoundElement that does just this. Since there is no syntactic representation for this node kind, have both unparse.cpp and mod-file.cpp emit the original rank-1 integer array expression instead of scalarized versions.

Analyze does semantic checks, then repackages into an array of scalarized ShapeSpec pairs instead of a pair of arrays.

Lower implementation in follow-up stack PR.

Also, fix pre-existing bug where overriding dimension spec in entity-decl throws away and fails to type check the array-spec provided in dimension spec.
DeltaFile
+199-30flang/test/Semantics/declaration-explicit-array-bounds.f90
+210-8flang/lib/Semantics/resolve-names-utils.cpp
+99-9flang/lib/Semantics/resolve-names.cpp
+63-0flang/test/Semantics/modfile-explicit-shape-bounds.f90
+53-7flang/lib/Semantics/mod-file.cpp
+42-0flang/test/Semantics/unparse-explicit-array-bounds.f90
+666-5419 files not shown
+825-5825 files

LLVM/project 1b2e2ebllvm/lib/Transforms/Vectorize SLPVectorizer.cpp

Update
DeltaFile
+1-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+1-11 files

LLVM/project a6cf1a0clang/include/clang/CIR/Interfaces CIROpInterfaces.td, clang/lib/CIR/CodeGen CIRGenStmt.cpp CIRGenCall.cpp

[CIR] Implement alwaysinline/noinline on call sites (#214789)

When these appear in an AttributedStmt, we have to annotate the call
with these attributes. This patch implements them for all of the
CallOpInterface types.
DeltaFile
+55-0clang/test/CIR/CodeGen/callsite-inline-attributes.cpp
+18-2clang/include/clang/CIR/Interfaces/CIROpInterfaces.td
+18-0clang/lib/CIR/CodeGen/TargetInfo.h
+15-0clang/lib/CIR/CodeGen/CIRGenCall.cpp
+12-2clang/lib/CIR/CodeGen/CIRGenStmt.cpp
+7-0clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+125-42 files not shown
+132-48 files

LLVM/project 368ba84llvm/utils/gn/secondary/bolt/lib/Core BUILD.gn, llvm/utils/gn/secondary/clang/include/clang/Basic BUILD.gn

[gn build] Port commits (#214852)
DeltaFile
+9-1llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+3-2llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn
+4-0llvm/utils/gn/secondary/clang/include/clang/Basic/BUILD.gn
+1-1llvm/utils/gn/secondary/lldb/source/Utility/BUILD.gn
+1-1llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
+1-0llvm/utils/gn/secondary/bolt/lib/Core/BUILD.gn
+19-512 files not shown
+29-718 files

LLVM/project 83959f0llvm/tools/libCASPluginTest CMakeLists.txt

[LLVMCAS] libCASPluginTest should link libpthread (#214847)

Fix ppc build after #213331. libCASPluginTest should link libpthread
since the mock implementation uses a threadpool.
DeltaFile
+3-1llvm/tools/libCASPluginTest/CMakeLists.txt
+3-11 files

LLVM/project d280d79llvm/test/CodeGen/AMDGPU splitkit-getsubrangeformask-phi-extend.ll memintrinsic-unroll.ll

Revert "[AMDGPU] Reschedule loads in clauses to improve throughput" (#214836)

Reverts llvm/llvm-project#102595

we are seeing downstream breaks hpc2021 519 535 accel2023 453 460
aborts on device.

will work on a reproducer later today, and send to you, its fortran, you
will enjoy it
DeltaFile
+1,980-2,100llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+417-459llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.512bit.ll
+304-460llvm/test/CodeGen/AMDGPU/div_i128.ll
+242-262llvm/test/CodeGen/AMDGPU/bf16.ll
+230-264llvm/test/CodeGen/AMDGPU/memintrinsic-unroll.ll
+222-222llvm/test/CodeGen/AMDGPU/splitkit-getsubrangeformask-phi-extend.ll
+3,395-3,76768 files not shown
+5,139-6,27474 files

LLVM/project e305ee9llvm/docs/RISCV RISCVVectorExtension.md

revert to old upper case label names
DeltaFile
+2-2llvm/docs/RISCV/RISCVVectorExtension.md
+2-21 files

LLVM/project de8c11aclang/include/clang/Basic CMakeLists.txt TargetBuiltins.h, clang/lib/Basic/Targets ARM.cpp

ARM TableGen Update (#208380)

- This PR replaces existing ARM builtin functions with TableGen.
- The `.td` file returns identical header names & type signatures as the
`.def` generated headers and types
- The change has been tested via the following:
  - `check-clang-tablegen`
  - `check-clang-sema`
  - `check-clang-codegen-arm`
  - `check-clang-codegen`
  - `clang-check`
  - `check-clang` 
  - None of the above returned errors or warnings
- The translation is mostly done via a translation script written in
Python
- [Link to translation
script](https://github.com/patricklapgar/python_scripts/blob/main/llvm/clang/arm_tablegen_mig.py)
- [Link to translation script test
suite](https://github.com/patricklapgar/python_scripts/blob/main/llvm/clang/test_arm_tablegen_mig.py)
- Disclaimer: Both the translation script and its test suite were made
w/ assistance from AI (IBM Bob)
DeltaFile
+354-0clang/include/clang/Basic/BuiltinsARM.td
+0-346clang/include/clang/Basic/BuiltinsARM.def
+25-16clang/lib/Basic/Targets/ARM.cpp
+41-0clang/include/clang/Basic/BuiltinsARMBase.td
+3-2clang/include/clang/Basic/TargetBuiltins.h
+4-0clang/include/clang/Basic/CMakeLists.txt
+427-3641 files not shown
+427-3657 files

LLVM/project 03f9bc1lldb/include/lldb/Core ModuleList.h, lldb/source/Core ModuleList.cpp

[lldb] Let callers of GetSharedModule skip symbol locating (NFC) (#214829)

GetSharedModule falls back on the symbol locator plugins when the spec
does not already name a binary it can open, and it does so while holding
the global module list lock. Locating a binary or symbol file can
potentially be quite slow, so we should have the option to opt out of
that, for example, if we already did the search upfront.
DeltaFile
+61-0lldb/unittests/Core/ModuleListTest.cpp
+14-4lldb/source/Core/ModuleList.cpp
+2-1lldb/include/lldb/Core/ModuleList.h
+77-53 files

LLVM/project 2f42894llvm/lib/Target/RISCV RISCVTargetMachine.cpp RISCVAsmPrinter.cpp, llvm/test/CodeGen/RISCV O1-newpm-pipeline.ll O3-newpm-pipeline.ll

[RISCV][NewPM] Add NewPM Codegen Pipeline Skeleton (#213129)

This follows what has been done for other targets. Follow-up commits
will port each pass and add them to this pipeline.

Assisted-by: AI
DeltaFile
+239-0llvm/lib/Target/RISCV/RISCVCodeGenPassBuilder.cpp
+108-0llvm/test/CodeGen/RISCV/O3-newpm-pipeline.ll
+107-0llvm/test/CodeGen/RISCV/O1-newpm-pipeline.ll
+39-0llvm/lib/Target/RISCV/RISCVAsmPrinter.h
+33-0llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
+0-13llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+526-135 files not shown
+550-1311 files

LLVM/project f391333clang/lib/Analysis IssueHash.cpp

Fix my mistake
DeltaFile
+2-5clang/lib/Analysis/IssueHash.cpp
+2-51 files

LLVM/project a729304llvm/docs OpaquePointers.md LFI.md, llvm/docs/PDB index.md

[docs] Fix LLVM markdown migration defects
DeltaFile
+15-16llvm/docs/ResponseGuide.md
+7-7llvm/docs/PDB/index.md
+5-6llvm/docs/ReportingGuide.md
+6-5llvm/docs/CodeOfConduct.md
+3-3llvm/docs/LFI.md
+1-2llvm/docs/OpaquePointers.md
+37-391 files not shown
+40-397 files

LLVM/project b059b20mlir/include/mlir/Dialect/Affine/IR AffineOps.td, mlir/lib/Dialect/Affine/IR AffineOps.cpp

[mlir][affine] Add optional alignment attribute to affine load/store ops (#214532)

Give `affine.load`, `affine.store`, `affine.vector_load` and
`affine.vector_store` the same optional `alignment` attribute that
`memref.load`/`memref.store` and `vector.load`/`vector.store` already
carry, via the same `AlignmentAttrOpInterface` and `IntValidAlignment`
constraint, and keep it standing where those ops are rebuilt:

- `--lower-affine` forwards the alignment onto the `memref`/`vector`
access it creates (previously it was dropped, since the lowering
rebuilds the access without carrying attributes over).
- The map-composition canonicalizer (`SimplifyAffineOp`) carries the
alignment over when it rebuilds an access with a composed map.

**Motivation.** Without a way to state alignment on the affine ops, a
frontend that raises an under-aligned llvm access through affine and
back must either give up on raising it, or watch the alignment silently
upgrade to the element type's ABI alignment on the way back down. That
upgrade is a miscompile: clang emits `load i128, align 8` for a 16-byte

    [19 lines not shown]
DeltaFile
+47-19mlir/lib/Dialect/Affine/IR/AffineOps.cpp
+41-13mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
+25-0mlir/test/Conversion/AffineToStandard/lower-affine.mlir
+22-0mlir/test/Dialect/Affine/ops.mlir
+18-0mlir/test/Dialect/Affine/canonicalize.mlir
+16-0mlir/test/Dialect/Affine/invalid.mlir
+169-323 files not shown
+182-389 files

LLVM/project 5b9acbcclang/lib/CodeGen CodeGenModule.cpp, clang/lib/CodeGen/Targets PPC.cpp

clang: Emit "long-double-type" module flag generically (#210819)

Move emission of the "long-double-type" module flag out of PowerPC
and into generic code, so it describes the long double format for all
targets.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+0-25clang/lib/CodeGen/Targets/PPC.cpp
+24-0clang/lib/CodeGen/CodeGenModule.cpp
+23-0clang/test/CodeGen/long-double-type-module-flag.c
+0-17clang/test/CodeGen/ppc64-long-double-type-attr.c
+47-424 files

LLVM/project 113e69cllvm/tools/libCASPluginTest CMakeLists.txt

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+3-1llvm/tools/libCASPluginTest/CMakeLists.txt
+3-11 files

LLVM/project 79ae2f8clang/docs ReleaseNotes.md, clang/lib/Sema SemaExpr.cpp

Reland "[Clang] Rebuild lambda captures in default member initializers while skipping body (#196597)"

This relands commit 50f30bedaa81919915049474f4350ef19c36b7ca, which was
reverted in 150aa53d48aa because it crashed CodeGen for lambda
init-captures in default member initializers.

This commit restores the original change unmodified; the crash is fixed
by the following commit, which re-runs the capture's initialization when
rebuilding the default member initializer.
DeltaFile
+48-8clang/lib/Sema/SemaExpr.cpp
+37-0clang/test/CodeGenCXX/gh196469-default-member-init-lambda-cleanup.cpp
+22-0clang/test/SemaCXX/gh196469-default-member-init-lambda-capture.cpp
+0-12clang/test/SemaCXX/source_location.cpp
+3-0clang/docs/ReleaseNotes.md
+110-205 files

LLVM/project 2945ec1clang/lib/Sema SemaExpr.cpp, clang/test/CodeGenCXX gh196469-default-member-init-lambda-capture-copy.cpp

[Clang] Re-run init-capture initialization when rebuilding default member initializers

When a default member initializer containing a lambda is rebuilt at its
point of use (CWG1815/CWG2631 aggregate initialization),
EnsureImmediateInvocationInDefaultArgs::TransformLambdaExpr transformed
each init-capture initializer with TransformInitializer but never
re-performed the capture's initialization.

TransformInitializer lowers an initializer to its syntactic form -- a
stripped source expression for copy-init, a ParenListExpr for
direct-init, or an InitListExpr for list-init -- and expects the
enclosing context to rebuild the initialization against the target
entity. Without that second step the rebuilt closure was left with a
bare capture initializer: CodeGen crashed for a trivially destructible
closure (aggregate-copy of a non-trivially copyable type) and silently
left the capture uninitialized otherwise.

Re-run buildLambdaInitCaptureInitialization on the transformed
initializer, as the canonical TreeTransform::TransformLambdaExpr does, so

    [7 lines not shown]
DeltaFile
+76-0clang/test/CodeGenCXX/gh196469-default-member-init-lambda-capture-copy.cpp
+24-2clang/lib/Sema/SemaExpr.cpp
+100-22 files

LLVM/project 5188dfcllvm/include/llvm/IR IntrinsicsAMDGPU.td, llvm/lib/Target/AMDGPU SIISelLowering.cpp

[AMDGPU] Guard intrinsics that need vmem-to-lds-load-insts (#214842)
DeltaFile
+24-12llvm/include/llvm/IR/IntrinsicsAMDGPU.td
+24-10llvm/test/CodeGen/AMDGPU/llvm.amdgcn.buffer.load.lds.err.ll
+0-2llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+48-243 files

LLVM/project 8f9778dllvm/include/llvm/CodeGen SelectionDAG.h, llvm/lib/CodeGen/GlobalISel LegalizerHelper.cpp

Disable tail mem libcalls in swifterror functions (#214590)

Tail calls in functions with a swifterror parameter aren't supported yet
and there's a guard against this but the same guard is missing in the
memcpy/memmove/memset libcall paths, which caused a miscompile/crash.
Apply this guard in those places.

https://github.com/swiftlang/swift/issues/90477
rdar://181625760
DeltaFile
+34-4llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+33-0llvm/test/CodeGen/AArch64/swifterror-tailcall-memops.ll
+15-2llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+4-1llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+1-2llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+2-0llvm/include/llvm/CodeGen/SelectionDAG.h
+89-96 files

LLVM/project be9dcc5clang/lib/Analysis/LifetimeSafety FactsGenerator.cpp, clang/test/Sema/LifetimeSafety explicit-object-param-no-crash.cpp

[LifetimeSafety] Fix crash on explicit object member functions (#212154)

`-Wlifetime-safety` crashes on a call to an explicit object member
function whose object parameter is an rvalue reference, when the call
passes at least one further argument:
```c++
struct Foo {
  template <typename T>
  int get(this Foo &&self, T) { return self.field; }
  
  int field;
};

void call() { Foo().get(0); }
```

`handleMovedArgsInCall` pairs `Args[I]` with `getParamDecl(I - 1)`,
assuming the object argument has no corresponding `ParmVarDecl`. An
explicit object parameter is a `ParmVarDecl`, so the offset misaligned

    [11 lines not shown]
DeltaFile
+87-0clang/test/Sema/LifetimeSafety/explicit-object-param-no-crash.cpp
+15-7clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+102-72 files

LLVM/project a7fc371llvm/docs LangRef.md

[Docs] Fix a DIExpression fragment example (#214839)

Use DW_OP_LLVM_fragment for the source-variable fragment example. The
previous DW_OP_bit_piece form is not valid in LLVM DIExpression metadata
- the other code was changed a bit ago, this is just some documentation
that didn't catch up.
DeltaFile
+1-1llvm/docs/LangRef.md
+1-11 files

LLVM/project eb1c953clang/test/Analysis builtin_overflow.c

Update clang/test/Analysis/builtin_overflow.c

Co-authored-by: Balázs Benics <benicsbalazs at gmail.com>
DeltaFile
+1-2clang/test/Analysis/builtin_overflow.c
+1-21 files

LLVM/project 80ced39llvm/lib/Transforms/Vectorize VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize vplan-based-stride-mv-btc.ll

Fixes around PredicatedMaxBTC

* Don't use "clamp" for tail-folded loops
* Use `SE->getElementCount` for scalable non-tail-folded loops
DeltaFile
+228-16llvm/test/Transforms/LoopVectorize/vplan-based-stride-mv-btc.ll
+15-17llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+243-332 files

LLVM/project ebe102fclang/lib/Analysis IssueHash.cpp, clang/unittests/Analysis IssueHashTest.cpp

address comments
DeltaFile
+4-3clang/lib/Analysis/IssueHash.cpp
+1-1clang/unittests/Analysis/IssueHashTest.cpp
+5-42 files

LLVM/project b243fa2clang/docs ReleaseNotes.md, clang/include/clang/AST DeclCXX.h

[clang] Compute value dependence for references to structured bindings (#212368)

In some cases, a reference to a structured binding is value-dependent. I
think this has been possible since they were originally defined in
C++17. C++26 makes it easier to trigger issues, though.

CWG 2984 proposes a resolution to this issue, but the proposed
resolution makes a bunch of cases value-dependent where it isn't really
necessary. A comment in the code describes my alternative.

Fixes #211930
DeltaFile
+65-0clang/test/SemaCXX/binding-value-dependence.cpp
+23-0clang/lib/AST/ComputeDependence.cpp
+3-3clang/include/clang/AST/DeclCXX.h
+4-0clang/docs/ReleaseNotes.md
+2-1clang/lib/AST/ASTImporter.cpp
+97-45 files