LLVM/project 3f420c9flang/lib/Semantics check-declarations.cpp, flang/test/Semantics bind-c19.f90

[flang] Diagnose BIND(C) procedures in submodules without ancestor interfaces (#194571)

This diagnoses `BIND(C)` procedures defined in submodules when their
interface is not declared in the ancestor module.

The check is added in `CheckBindC()` and covers plain `BIND(C)`,
explicit `NAME=`, empty/all-blank `NAME=`, valid ancestor-module
interfaces, and nested submodule cases.

Fixes #194570.

Co-authored-by: Sairudra More <moresair at pe31.hpc.amslabs.hpecorp.net>
DeltaFile
+117-0flang/test/Semantics/bind-c19.f90
+18-0flang/lib/Semantics/check-declarations.cpp
+135-02 files

LLVM/project 9803cd6llvm/lib/CodeGen AtomicExpandPass.cpp, llvm/test/CodeGen/ARM atomic-load-store.ll

[AtomicExpand] Add bitcasts when expanding store atomic vector

AtomicExpand fails for aligned \`store atomic <n x T>\` because it
does not find a compatible library call. This change adds appropriate
ptrtoint + bitcast so that the call can be lowered, mirroring the
load-side handling from #148900.
DeltaFile
+100-7llvm/test/CodeGen/X86/atomic-load-store.ll
+98-0llvm/test/Transforms/AtomicExpand/X86/expand-atomic-non-integer.ll
+49-0llvm/test/CodeGen/ARM/atomic-load-store.ll
+16-3llvm/lib/CodeGen/AtomicExpandPass.cpp
+263-104 files

LLVM/project 370bfb7utils/bazel/llvm-project-overlay/libc BUILD.bazel, utils/bazel/llvm-project-overlay/llvm BUILD.bazel

Revert "[libc] Port 2b2a63819f9f26d661bad5c269a03077d22ff6b4" (#197857)

Reverts llvm/llvm-project#197337

The original porting was reverted in
https://github.com/llvm/llvm-project/commit/1565f096d868f479f075fce3792db7b908cab9aa.
This is also causing some large build metric regressions for transitive
users of LLVM internally due to the large number of new rules and source
files.
DeltaFile
+1-506utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+0-1utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+1-5072 files

LLVM/project 3620ec1mlir/include/mlir/Dialect/OpenMP OpenMPOps.td, mlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp

Require explicit yield in iterator op

Remove the implicit terminator trait from omp.iterator so iterator
modifiers must explicitly yield the value used to form the iterated list.

Add and update verfier and test accordingly.
DeltaFile
+15-0mlir/test/Dialect/OpenMP/ops.mlir
+5-8mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+9-0mlir/test/Dialect/OpenMP/invalid.mlir
+1-3mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
+30-114 files

LLVM/project 26491bbmlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp

Remove unrelated empty line
DeltaFile
+0-1mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+0-11 files

LLVM/project 5d5a373flang/lib/Optimizer/OpenMP FunctionFiltering.cpp, mlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp

Reject target map iterators without captures

Reject target map iterators until the follow-up capture-binding
representation is added since currently map_iterated on omp.target
only represents the dynamic map list and does not consider the
target-region arguments required by IsolatedFromAbove.
DeltaFile
+0-23mlir/test/Dialect/OpenMP/ops.mlir
+0-19mlir/test/Target/LLVMIR/openmp-todo.mlir
+5-5mlir/test/Dialect/OpenMP/invalid.mlir
+5-0mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+0-1flang/lib/Optimizer/OpenMP/FunctionFiltering.cpp
+10-485 files

LLVM/project 7fab358mlir/include/mlir/Dialect/OpenMP OpenMPOps.td, mlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp

Simplify map iterator clause assembly

- Split MLIR map syntax into separate map_entries(...) and map_iterated(...),
  removing the custom MapEntryList parser/printer.
- Moved omp.target map_iterated out of TargetOpRegion
  - it now prints before the target region instead of as map_iterated_entries(...) after the region.
- Renamed LLVMIR TODO helper to clause-style checkMap.
- Added DeclareMapperInfoOp builder from DeclareMapperInfoOperands
  and updated Flang call sites so they do not need to spell out newly
  added operands..
DeltaFile
+12-89mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+14-14mlir/test/Dialect/OpenMP/ops.mlir
+12-12mlir/test/Dialect/OpenMP/invalid.mlir
+7-7mlir/test/Target/LLVMIR/openmp-todo.mlir
+6-8mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+5-2mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
+56-1323 files not shown
+62-1409 files

LLVM/project 86a6fa2flang/lib/Optimizer/OpenMP FunctionFiltering.cpp, mlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp

Reject target map iterators without captures

Reject target map iterators until the follow-up capture-binding
representation is added since currently map_iterated on omp.target
only represents the dynamic map list and does not consider the
target-region arguments required by IsolatedFromAbove.
DeltaFile
+0-23mlir/test/Dialect/OpenMP/ops.mlir
+0-19mlir/test/Target/LLVMIR/openmp-todo.mlir
+5-5mlir/test/Dialect/OpenMP/invalid.mlir
+5-0mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+0-1flang/lib/Optimizer/OpenMP/FunctionFiltering.cpp
+10-485 files

LLVM/project 0b47918mlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp

Remove unrelated empty line
DeltaFile
+0-1mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+0-11 files

LLVM/project 6ada2e3mlir/include/mlir/Dialect/OpenMP OpenMPOps.td, mlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp

Require explicit yield in iterator op

Remove the implicit terminator trait from omp.iterator so iterator
modifiers must explicitly yield the value used to form the iterated list.

Add and update verfier and test accordingly.
DeltaFile
+15-0mlir/test/Dialect/OpenMP/ops.mlir
+5-8mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+9-0mlir/test/Dialect/OpenMP/invalid.mlir
+1-3mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
+30-114 files

LLVM/project 935b6bemlir/include/mlir/Dialect/OpenMP OpenMPOps.td, mlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp

Simplify map iterator clause assembly

- Split MLIR map syntax into separate map_entries(...) and map_iterated(...),
  removing the custom MapEntryList parser/printer.
- Moved omp.target map_iterated out of TargetOpRegion
  - it now prints before the target region instead of as map_iterated_entries(...) after the region.
- Renamed LLVMIR TODO helper to clause-style checkMap.
- Added DeclareMapperInfoOp builder from DeclareMapperInfoOperands
  and updated Flang call sites so they do not need to spell out newly
  added operands..
DeltaFile
+9-85mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+14-14mlir/test/Dialect/OpenMP/ops.mlir
+12-12mlir/test/Dialect/OpenMP/invalid.mlir
+7-7mlir/test/Target/LLVMIR/openmp-todo.mlir
+6-8mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+6-3mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
+54-1293 files not shown
+60-1379 files

LLVM/project 096bae0mlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp, mlir/lib/Target/LLVMIR/Dialect/OpenMP OpenMPToLLVMIRTranslation.cpp

Add verifier check for iterated map info and tests for declare mapper
DeltaFile
+92-75mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+112-4mlir/test/Dialect/OpenMP/invalid.mlir
+24-0mlir/test/Target/LLVMIR/openmp-todo.mlir
+18-0mlir/test/Dialect/OpenMP/ops.mlir
+6-0mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+252-795 files

LLVM/project a15409ellvm/utils/gn README.rst

gn build: Remove a step from the README.

No longer necessary after https://gn-review.googlesource.com/c/gn/+/18500

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/197854
DeltaFile
+0-2llvm/utils/gn/README.rst
+0-21 files

LLVM/project e2bdf2cflang/lib/Optimizer/OpenMP LowerWorkdistribute.cpp, mlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp

[mlir][OpenMP] Add iterator support to motion clauses

Extend omp.target_data, omp.target_enter_data, omp.target_exit_data,
and omp.target_update to support `!omp.iterated<Ty>`.

This is part of feature work for #188061

Assisted with copilot
DeltaFile
+128-21mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+100-1mlir/test/Dialect/OpenMP/ops.mlir
+83-0mlir/test/Target/LLVMIR/openmp-todo.mlir
+38-4mlir/test/Dialect/OpenMP/invalid.mlir
+19-18flang/lib/Optimizer/OpenMP/LowerWorkdistribute.cpp
+14-3mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+382-475 files not shown
+403-6111 files

LLVM/project 88eb98ellvm/utils/gn README.rst

gn build: Remove a step from the README. (#197842)

No longer necessary after
https://gn-review.googlesource.com/c/gn/+/18500
DeltaFile
+0-2llvm/utils/gn/README.rst
+0-21 files

LLVM/project 39e42e8flang/lib/Lower/OpenMP Utils.cpp ClauseProcessor.cpp, flang/lib/Optimizer/OpenMP MapInfoFinalization.cpp

[Flang][OpenMP] Support iterator modifiers in map and motion clauses

Support iterated array elements and array sections in map and motion clauses for
target data, target enter data, target exit data, and target update constructs.

Preserve mapper resolution for iterated entries, including explicit mappers,
user-defined default mappers, declare mapper entries, and implicit default
mappers.

This PR stacked on top of #197047 and #197752.

This patch is part of the feature work for #188061.

Assisted with copilot.
DeltaFile
+507-0flang/test/Lower/OpenMP/motion-iterator.f90
+175-0flang/lib/Lower/OpenMP/Utils.cpp
+95-12flang/lib/Lower/OpenMP/ClauseProcessor.cpp
+25-0flang/test/Lower/OpenMP/declare-mapper-iterator.f90
+15-0flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp
+13-0flang/lib/Lower/OpenMP/Utils.h
+830-123 files not shown
+830-399 files

LLVM/project 3d7c5e0libclc CMakeLists.txt, libclc/cmake/modules AddLibclc.cmake

[libclc] Move sources collection into libclc_add_builtin_library, merge opencl library creation into libclc_add_library (#197654)

Merging opencl library creation into libclc_add_library undos part of
change in 14bf8e7.
This simplifies creating different libraries by invoking
libclc_add_library multiple times, without the need of splitting
intermediate library creation and its finalization.

add_subdirectory(clc) and add_subdirectory(opencl) only updates sources
list of existing library target, so it is safe to move inside
libclc_add_builtin_library.
DeltaFile
+38-19libclc/cmake/modules/AddLibclc.cmake
+8-13libclc/CMakeLists.txt
+46-322 files

LLVM/project 7d70022clang/lib/CodeGen CGExprAgg.cpp CGExprCXX.cpp, clang/test/CodeGen ubsan-aggregate-null-align.c

[UBSan] add pointer/array access checks for aggregate assignment/initialization operands (#190739)

This PR adds UbSan `null`, `alignment`, and `array-bounds` checks for
aggregate copy operations.

When copying scalar types, clang emits `null`/`alignment` checks via
`EmitCheckedLValue`. However, aggregate copies used `EmitLValue`,
skipping these checks entirely.

Code changes:
- `CGExprAgg.cpp`: `EmitCheckedLValue` in `EmitAggLoadOfLValue` (RHS
check)
- `CGExprAgg.cpp`: `EmitCheckedLValue` in `VisitBinAssign` (LHS check)
- `CGClass.cpp`: `EmitCheckedLValue` for trivial copy/move constructor
arg
- `CGExprCXX.cpp`: `EmitCheckedLValue` for trivial `operator=` RHS

Test updates:
- `ubsan-aggregate-null-align.c`:

    [11 lines not shown]
DeltaFile
+129-195clang/test/CodeGen/ubsan-aggregate-null-align.c
+4-3clang/test/CodeGenCXX/ubsan-new-checks.cpp
+2-2clang/lib/CodeGen/CGExprAgg.cpp
+1-1clang/lib/CodeGen/CGExprCXX.cpp
+1-1clang/lib/CodeGen/CGClass.cpp
+137-2025 files

LLVM/project 5c86d85llvm/lib/Target/AMDGPU SIInstructions.td AMDGPUInstructions.td, llvm/test/CodeGen/AMDGPU andorn2.ll

[AMDGPU] Add v2i32 V_BFI combines for andn2 and orn2 (#196325)

Add vector v2i32 pattern matches that lower to two lane wise V_BFI_B32
operations.

TODO: Support v2i16, v4i16 pattern.
DeltaFile
+921-0llvm/test/CodeGen/AMDGPU/andorn2.ll
+53-48llvm/lib/Target/AMDGPU/SIInstructions.td
+2-1llvm/lib/Target/AMDGPU/AMDGPUInstructions.td
+976-493 files

LLVM/project b1c020blldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime AppleObjCRuntime.cpp

[lldb] Stop looking for libarclite symbol (#197848)

libarclite is a helper library used for Automatic Reference Counting
(ARC) support on older operating systems. It hasn't been necessary since
Mac OS X Mountain Lion, released in 2012.
DeltaFile
+4-14lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+4-141 files

LLVM/project b571b4dlldb/include/lldb/Symbol UnwindTable.h

[lldb] Fix data race in UnwindTable::Initialize (#197816)

UnwindTable::Initialize uses double-checked locking (DCL) against
m_scanned_all_unwind_sources, but the flag was a plain bool. The
fast-path read outside the mutex is unsynchronized with the write inside
the mutex, so concurrent first-time callers can observe partially
initialized state.

Make m_scanned_all_unwind_sources std::atomic<bool>. The default memory
ordering (seq_cst) is sufficient for the DCL pattern used here.

Found by ThreadSanitizer as part of #197792.
DeltaFile
+5-5lldb/include/lldb/Symbol/UnwindTable.h
+5-51 files

LLVM/project 7e667c3lldb/include/lldb/Target StackFrameList.h, lldb/source/Target StackFrameList.cpp

[lldb] Use llvm::sys::RWMutex instead of std::shared_mutex (NFC) (#197847)

On Darwin, pthread_rwlock is faster than std::shared_mutex, which is why
the implementation of llvm::sys::RWMutex used that on our platform.
Everywhere else, it uses std::shared_mutex under the hood.

Also see #70151

rdar://177113951
DeltaFile
+11-11lldb/source/Target/StackFrameList.cpp
+4-5lldb/include/lldb/Target/StackFrameList.h
+15-162 files

LLVM/project 81e41bdllvm/lib/MC DXContainerInfo.cpp, utils/bazel/llvm-project-overlay/llvm BUILD.bazel

[Bazel] Port ca6e386cbf5b3e75a2a62e6c4d29b24109727a52 (#197841)

obj2yaml now depends on MC (although probably not for much), and remove
an unnecessary header creating a layering violation.
DeltaFile
+1-0utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+0-1llvm/lib/MC/DXContainerInfo.cpp
+1-12 files

LLVM/project 42b563bflang/lib/Optimizer/OpenMP MapInfoFinalization.cpp, flang/test/Integration/OpenMP map-types-and-sizes.f90

[Flang][OpenMP][Offload] Modify MapInfoFinalization to handle attach mapping and 6.1's ref_* and attach map keywords (#177715)

This PR is one of four required to implement the attach mapping
semantics in Flang, alongside the ref_ptr/ref_ptee/ref_ptr_ptee map
modifiers and the attach(always/never/auto) modifiers.

This PR is the MapInfoFinalization changes required to support these
features, it mainly deals with applying the correct attach map type and
manipulating the descriptor types maps for base address and descriptor
so that when we specify ref_ptr/ref_ptee we emit one of the two maps and
when we emit ref_ptr_ptee we emit our usual default maps. In all cases
we add the "glue" of an new attach map except in cases where a user has
provided attach never. In cases where we are provided an always, we
apply the always map type to our attach maps.

It's important to note the runtime has a toggle for the auto map
behavior, which will flip the attach behavior to the newer semantics or
the older semantics for backwards compatibility (outside the purview of
this PR but good to mention).
DeltaFile
+715-332flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp
+388-284mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+273-0mlir/test/Target/LLVMIR/omptarget-host-ref-semantics.mlir
+101-165flang/test/Integration/OpenMP/map-types-and-sizes.f90
+107-0flang/test/Lower/OpenMP/attach-and-ref-modifier.f90
+30-61mlir/test/Target/LLVMIR/omptarget-record-type-with-ptr-member-host.mlir
+1,614-84264 files not shown
+2,300-1,21470 files

LLVM/project 21e436fclang/lib/Analysis/LifetimeSafety LifetimeAnnotations.cpp, clang/test/Sema warn-lifetime-safety-lifetimebound.cpp

[LifetimeSafety] Recognize declarations nested under std namespace (#197604)

Previously `isInStlNamespace()` only checked the immediate declaration
context. This missed declarations nested below `std` through records or
intermediate namespaces, such as `std::basic_string_view` constructors.

This commit fixes the problem by walking the `DeclContext` chain in
`isInStlNamespace`.

Closes #197454
DeltaFile
+12-11clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp
+4-0clang/test/Sema/warn-lifetime-safety-lifetimebound.cpp
+3-0clang/test/Sema/Inputs/lifetime-analysis.h
+19-113 files

LLVM/project 439d42fclang/test/CIR/CodeGen cleanup-scope-goto-out.cpp, clang/test/CodeGen builtins-nvptx-mma.cu

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.6-beta.1

[skip ci]
DeltaFile
+3,706-328llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-local.mir
+344-258llvm/test/CodeGen/AMDGPU/llvm.amdgcn.kill.ll
+284-284clang/test/CodeGen/builtins-nvptx-mma.cu
+246-112llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-store-s16-true16.mir
+356-0clang/test/CIR/CodeGen/cleanup-scope-goto-out.cpp
+318-0llvm/lib/Transforms/IPO/Instrumentor.cpp
+5,254-982543 files not shown
+9,367-2,635549 files

LLVM/project 7022d6dclang/test/CIR/CodeGen cleanup-scope-goto-out.cpp, clang/test/CodeGen builtins-nvptx-mma.cu

[𝘀𝗽𝗿] initial version

Created using spr 1.3.6-beta.1
DeltaFile
+3,706-328llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-local.mir
+395-389llvm/utils/gn/secondary/clang/lib/Headers/BUILD.gn
+344-258llvm/test/CodeGen/AMDGPU/llvm.amdgcn.kill.ll
+284-284clang/test/CodeGen/builtins-nvptx-mma.cu
+246-112llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-store-s16-true16.mir
+356-0clang/test/CIR/CodeGen/cleanup-scope-goto-out.cpp
+5,331-1,371573 files not shown
+9,970-3,154579 files

LLVM/project 6c1381eclang/test/CIR/CodeGen cleanup-scope-goto-out.cpp, clang/test/CodeGen builtins-nvptx-mma.cu

[𝘀𝗽𝗿] initial version

Created using spr 1.3.6-beta.1
DeltaFile
+3,706-328llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-local.mir
+344-258llvm/test/CodeGen/AMDGPU/llvm.amdgcn.kill.ll
+284-284clang/test/CodeGen/builtins-nvptx-mma.cu
+246-112llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-store-s16-true16.mir
+356-0clang/test/CIR/CodeGen/cleanup-scope-goto-out.cpp
+318-0llvm/lib/Transforms/IPO/Instrumentor.cpp
+5,254-982544 files not shown
+9,367-2,637550 files

LLVM/project fda2694clang/test/CIR/CodeGen cleanup-scope-goto-out.cpp, clang/test/CodeGen builtins-nvptx-mma.cu

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.6-beta.1

[skip ci]
DeltaFile
+3,706-328llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-local.mir
+344-258llvm/test/CodeGen/AMDGPU/llvm.amdgcn.kill.ll
+284-284clang/test/CodeGen/builtins-nvptx-mma.cu
+246-112llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-store-s16-true16.mir
+356-0clang/test/CIR/CodeGen/cleanup-scope-goto-out.cpp
+318-0llvm/lib/Transforms/IPO/Instrumentor.cpp
+5,254-982543 files not shown
+9,367-2,635549 files

LLVM/project 8095cbaflang/test/Integration/OpenMP map-types-and-sizes.f90, mlir/lib/Target/LLVMIR/Dialect/OpenMP OpenMPToLLVMIRTranslation.cpp

[OpenMP][MLIR] Modify OpenMP Dialect lowering to support attach mapping (#179023)

This PR adjusts the LLVM-IR lowering to support the new attach map type
that the runtime uses to link data and pointer together, this swaps the
mapping from the older OMP_MAP_PTR_AND_OBJ map type in most cases and
allows slightly more complicated ref_ptr/ptee and attach semantics.
DeltaFile
+378-281mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+273-0mlir/test/Target/LLVMIR/omptarget-host-ref-semantics.mlir
+101-165flang/test/Integration/OpenMP/map-types-and-sizes.f90
+27-58mlir/test/Target/LLVMIR/omptarget-record-type-with-ptr-member-host.mlir
+70-0offload/test/offloading/fortran/map_attach_always.f90
+55-0offload/test/offloading/fortran/map_attach_never.f90
+904-50415 files not shown
+1,077-59821 files