LLVM/project f7b7ec8llvm/docs AlignedBundling.rst, llvm/lib/MC MCELFStreamer.cpp MCAssembler.cpp

[MC][X86] Reintroduce aligned instruction bundling (#175830)

Aligned bundling partitions instructions into fixed-size, naturally
aligned groups called bundles and guarantees that no instruction
crosses a bundle boundary, giving the instruction stream a single
canonical decoding. It is a building block for software-based fault
isolation: control flow cannot jump into the middle of an instruction
to manufacture a different, unchecked sequence, and when combined with
masking of indirect branch targets it constrains control flow to a
statically verifiable set of locations.

The previous target-independent implementation was removed in #148781,
which simplified MC by eliminating per-fragment BundlePadding, the
virtual emitInstToData, and BundleGroupBeforeFirstInst. This change
reimplements the feature in the X86 backend on top of the existing
MCBoundaryAlignFragment infrastructure added for branch alignment,
keeping the generic MC surface smaller:

* AsmParser parses .bundle_align_mode, .bundle_lock and .bundle_unlock

    [36 lines not shown]
DeltaFile
+208-22llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
+165-0llvm/test/MC/X86/AlignedBundling/prefix-padding.s
+151-0llvm/test/MC/X86/AlignedBundling/bundle-errors.s
+106-0llvm/docs/AlignedBundling.rst
+63-31llvm/lib/MC/MCAssembler.cpp
+92-0llvm/lib/MC/MCELFStreamer.cpp
+785-5321 files not shown
+1,418-6027 files

LLVM/project a805dd6llvm/include/llvm/Frontend/OpenMP OMPIRBuilder.h, llvm/lib/Frontend/OpenMP OMPIRBuilder.cpp

[Flang][OpenMP][OpenMPIRBuilder] Implement module scope declare target use rewrite mechanism (#212920)

During lowering of declare target'd variables we generate new global
variables for device that replace the use of the pre-existing global
variable. In Flang we currently rewrite this for each target region, but
that's not enough to cover indirect use cases inside of declare target
functions which can be imported into the module and utilised inside of a
target region. This PR tries to extend the scope of the rewriting to the
module than a per target region rewrite.

It does so by creating a mechanism where we can register globals for
replacement which will trigger on finalization of the OMPIRBuilder. This
is required as due to the ordering of lowering for MLIR, where we
generate the replacement global at the beginning of the module before
any uses have been generated, effectively meaning we cannot replace the
uses at that point. So, we defer the replacement to the OMPIRBuilder as
there is no deferral mechanism directly in the OpenMP MLIR lowering.

The alternative might be to rebind the global maps in ModuleTranslation

    [7 lines not shown]
DeltaFile
+270-0mlir/test/Target/LLVMIR/omptarget-declare-target-module-rewrite-device.mlir
+103-0llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+14-74mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+37-0llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+36-0llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+460-745 files

LLVM/project 7a0afd3clang/lib/CIR/Dialect/IR CIRTypes.cpp, clang/test/CIR/CodeGen empty-union.cpp

[CIR] Fix record layout for a union with no storage type (#213591)

A union whose CIR type ends up with no members keeps its whole size in
its
padding field, and `UnionType::getTypeSizeInBits` returned early in
exactly that
case, before reaching the padding. A union need not look empty in the
source to
land there: a lone zero-length bitfield is dropped during lowering,
leaving the
same no-storage state.

A record embedding such a union was then laid out wrong. In an unpacked
record
`insertPadding` pads whenever the end of the members placed so far,
rounded up
to the next member's alignment, falls short of that member's offset, so
a union
measuring zero earns a pad the AST layout does not have.  In C++,

    [22 lines not shown]
DeltaFile
+151-19clang/test/CIR/CodeGen/empty-union.cpp
+6-9clang/lib/CIR/Dialect/IR/CIRTypes.cpp
+157-282 files

LLVM/project 1f22cc1llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp, llvm/test/CodeGen/AMDGPU dagcombine-setcc-select.ll

[DAGCombine] Fold (select_cc (select cond, x, y), x, a, b, eq) to (select cond, a, b) (#199688)

(select_cc (select cond, x, y), x, a, b, eq) which could be simplified
to (select cond, a, b)
DeltaFile
+78-0llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+11-15llvm/test/CodeGen/X86/zext-sext.ll
+4-4llvm/test/CodeGen/AMDGPU/dagcombine-setcc-select.ll
+93-193 files

LLVM/project e91d4c7llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/lib/Transforms/Vectorize/SLPVectorizer SLPCompatibilityAnalysis.cpp SLPCompatibilityAnalysis.h

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+62-73llvm/test/Transforms/SLPVectorizer/X86/fmuladd-copyable-fadd.ll
+65-44llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+22-13llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCompatibilityAnalysis.h
+26-6llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCompatibilityAnalysis.cpp
+175-1364 files

LLVM/project cb8a602clang/lib/CodeGen CodeGenFunction.h CGExpr.cpp, clang/test/CodeGen attr-sized-by-for-pointers.c attr-counted-by-or-null-for-pointers.c

[CodeGen] Fix -fsanitize=array-bounds for __sized_by / _or_null pointers

`EmitCountedByBoundsChecking()` assumed a CountAttributedType is always
a __counted_by pointer. That isn't true, there are four versions of the
attribute:

* `__counted_by`: Already handled correctly.
* `__counted_by_or_null`: Incorectly handled.
* `__sized_by`: Incorreclty handled.
* `__sized_by_or_null`: Incorreclty handled.

In particular:

* __sized_by / __sized_by_or_null: the loaded bound is a byte count, but the
  element index was compared against it directly, so an access was only
  flagged once the index exceeded the byte count -- missing out-of-bounds
  accesses for a pointee larger than one byte. Scale the index to bytes
  ('index * sizeof(element)') before comparing. counted_by counts elements
  and is unchanged; a void (or otherwise zero-sized) pointee uses the GNU

    [13 lines not shown]
DeltaFile
+396-173clang/test/CodeGen/attr-sized-by-or-null-for-pointers.c
+295-98clang/test/CodeGen/attr-counted-by-or-null-for-pointers.c
+291-81clang/test/CodeGen/attr-sized-by-for-pointers.c
+43-9clang/lib/CodeGen/CGExpr.cpp
+2-1clang/lib/CodeGen/CodeGenFunction.h
+1,027-3625 files

LLVM/project 14cb4c0clang/lib/CodeGen CGBuiltin.cpp, clang/test/CodeGen attr-counted-by-for-pointers.c attr-sized-by-for-pointers.c

[CodeGen] Fix __builtin_dynamic_object_size for __sized_by / _or_null pointers

`emitCountedByPointerSize()` assumed a CountAttributedType is always
a __counted_by pointer. That isn't true, there are four versions of the
attribute:

* `__counted_by`: Already handled correctly.
* `__counted_by_or_null`: Incorectly handled.
* `__sized_by`: Incorreclty handled.
* `__sized_by_or_null`: Incorreclty handled.

In particular:

* __sized_by / __sized_by_or_null: the attribute argument is a byte count,
  but the object size was computed as count * sizeof(*ptr), over-reporting by
  the element size for any pointee larger than one byte. Use the count
  directly for the byte-counting variants.

* __counted_by_or_null / __sized_by_or_null: a null pointer describes no

    [20 lines not shown]
DeltaFile
+655-0clang/test/CodeGen/attr-sized-by-or-null-for-pointers.c
+514-0clang/test/CodeGen/attr-counted-by-or-null-for-pointers.c
+401-2clang/test/CodeGen/attr-sized-by-for-pointers.c
+169-5clang/test/CodeGen/attr-counted-by-for-pointers.c
+98-43clang/lib/CodeGen/CGBuiltin.cpp
+1,837-505 files

LLVM/project f24f86cllvm/lib/Target/AMDGPU AMDGPUTargetMachine.cpp SIInstructions.td

Set up M0 for VGPR-memory accesses in finalizeLowering instead of a separate pass
DeltaFile
+0-110llvm/lib/Target/AMDGPU/AMDGPUAssignIdxToM0.cpp
+34-0llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+6-5llvm/lib/Target/AMDGPU/AMDGPULowerVGPREncoding.cpp
+0-10llvm/lib/Target/AMDGPU/AMDGPU.h
+0-9llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+7-2llvm/lib/Target/AMDGPU/SIInstructions.td
+47-1364 files not shown
+47-14610 files

LLVM/project a56d758clang/include/clang/Basic TargetID.h, clang/lib/Basic TargetID.cpp

clang: Use TargetID parsing from AMDGPUTargetParser (#209845)

We had grown 2 parallel parsing implementations for
triple+gpu name+feature flag target ID strings. Mostly
eliminate the redundant clang version.

Co-authored-by: Claude (Opus 4.8)
DeltaFile
+29-165clang/lib/Basic/TargetID.cpp
+48-50clang/lib/Driver/ToolChains/AMDGPU.cpp
+39-42clang/lib/Driver/OffloadBundler.cpp
+10-34clang/include/clang/Basic/TargetID.h
+25-18clang/lib/Basic/Targets/AMDGPU.cpp
+18-14clang/lib/Basic/Targets/AMDGPU.h
+169-3237 files not shown
+227-35913 files

LLVM/project f306c27clang/test/CodeGen attr-sized-by-for-pointers.c attr-counted-by-for-pointers.c

[CodeGen][NFC] Split __sized_by tests into their own file and rename test cases

In future patches the coverage of the __counted_by family attributes is
going to be increased. To help with this patch refactors the existing
test file.

1. Split `__sized_by` tests into their own file. In later commits files
   will be added for each attribute so it makes sense for each attribute
   to have its own file.
2. Replace `testN` test case names with human readable descriptions. Not
   all test cases that will be added in the future will apply to all
   attributes. If we kept on using the `testN` naming convention it
   would leave odd gaps in the test numbering because we try to keep
   what a test case tests consistent between files (i.e. `testN` would
   roughly test the same thing but with a different attribute). Using
   named test cases completely avoids this.
DeltaFile
+150-287clang/test/CodeGen/attr-counted-by-for-pointers.c
+158-0clang/test/CodeGen/attr-sized-by-for-pointers.c
+308-2872 files

LLVM/project db4690ellvm/test/Transforms/SLPVectorizer/X86 fmuladd-copyable-fadd.ll

[SLP][NFC]Add a test for fadd conversion to fmuladd, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/213781
DeltaFile
+479-0llvm/test/Transforms/SLPVectorizer/X86/fmuladd-copyable-fadd.ll
+479-01 files

LLVM/project a5f7de0clang/lib/Driver/ToolChains Clang.cpp, clang/test/Driver openmp-target-fast-flag.c

Revert "[OpenMP] target-fast implies teams/threads oversubscription" (#213769)

Reverts llvm/llvm-project#205775

breaks no-loop-4 no-loop-7 downstream

take a look please
DeltaFile
+7-15clang/test/Driver/openmp-target-fast-flag.c
+2-2clang/lib/Driver/ToolChains/Clang.cpp
+9-172 files

LLVM/project 463a8d6clang/lib/Basic/Targets OSTargets.h, clang/test/Sema darwin-tls.c

[clang][darwin] armv6m Firmware crashes spilling the TLS wrapper (#213595)

Thread local storage isn't universally supported on all architectures.
Only enable it for the ones that are known to support it.

rdar://183822457
DeltaFile
+21-2clang/lib/Basic/Targets/OSTargets.h
+7-0clang/test/Sema/darwin-tls.c
+28-22 files

LLVM/project e1e6193llvm/lib/Transforms/Utils LoopUnroll.cpp, llvm/test/Transforms/LoopUnroll/branch-weights-freq unroll-complete.ll unroll-partial-unconditional-latch.ll

[LoopUnroll] Fix freq accuracy calculations (#213762)

This problem was reported at
<https://github.com/llvm/llvm-project/pull/182405#issuecomment-5165268733>
for the case of very large loop probabilities.

The biggest issue is that, when using linear and quadratic equations to
determine loop latch probabilities, asserts introduced by PR #182405 to
verify the accuracy of the resulting loop body frequency can fail.

Another issue is that iterations introduced by PR #182404 and PR #182405
terminate upon achieving a desired accuracy, but they can iterate longer
than necessary, wasting time achieving higher accuracy than desired.

This patch fixes the accuracy calculations to use relative differences
instead of absolute differences. It updates existing tests that reveal
the impact on the N>2 uniform case. Its adds new tests to cover the N=1,
N=2, and N>2 fast cases.
DeltaFile
+151-5llvm/test/Transforms/LoopUnroll/branch-weights-freq/unroll-partial-unconditional-latch.ll
+10-7llvm/lib/Transforms/Utils/LoopUnroll.cpp
+1-1llvm/test/Transforms/LoopUnroll/branch-weights-freq/unroll-complete.ll
+162-133 files

LLVM/project 9c0528flldb/test/API/tools/lldb-dap/databreakpoint TestDAP_setDataBreakpoints.py, lldb/test/API/tools/lldb-dap/locations main.cpp TestDAP_locations.py

[lldb-dap] Migrate setDataBreakpoint and Locations test (#213269)

Drop the raw line number when matching the expected location.
DeltaFile
+183-202lldb/test/API/tools/lldb-dap/databreakpoint/TestDAP_setDataBreakpoints.py
+53-67lldb/test/API/tools/lldb-dap/locations/TestDAP_locations.py
+8-8lldb/test/API/tools/lldb-dap/locations/main.cpp
+244-2773 files

LLVM/project 1611cc4lldb/packages/Python/lldbsuite/test/tools/lldb_dap types.py, lldb/test/API/tools/lldb-dap/extendedStackTrace TestDAP_extendedStackTrace.py

[lldb-dap] Migrate extended stackTrace and source test (#213234)

Migrated tests
- TestDAP_extendedStackTrace.py
- TestDAP_source.py
- TestDAP_source_x86.py
DeltaFile
+58-90lldb/test/API/tools/lldb-dap/source/TestDAP_source.py
+70-71lldb/test/API/tools/lldb-dap/extendedStackTrace/TestDAP_extendedStackTrace.py
+30-27lldb/test/API/tools/lldb-dap/stackTrace-x86/TestDAP_source_x86.py
+2-2lldb/test/API/tools/lldb-dap/source/main.c
+1-1lldb/packages/Python/lldbsuite/test/tools/lldb_dap/types.py
+161-1915 files

LLVM/project 6293a73flang/test/Lower/OpenMP/Todo metadirective-block-host-association-clause.f90 metadirective-loop-unsupported-replacements.f90

Consolidate metadirective lowering TODO tests

Group related block, loop data-environment, iteration-variable, and unsupported-replacement cases into split-file tests. This keeps each diagnostic isolated while reducing the number of TODO test files.
DeltaFile
+101-4flang/test/Lower/OpenMP/Todo/metadirective-loop-data-environment.f90
+74-0flang/test/Lower/OpenMP/Todo/metadirective-loop-iteration-variable.f90
+68-3flang/test/Lower/OpenMP/Todo/metadirective-block-data-environment.f90
+0-60flang/test/Lower/OpenMP/Todo/metadirective-loop-enclosing-data-environment.f90
+52-0flang/test/Lower/OpenMP/Todo/metadirective-loop-unsupported-replacements.f90
+0-37flang/test/Lower/OpenMP/Todo/metadirective-block-host-association-clause.f90
+295-1049 files not shown
+295-29215 files

LLVM/project dad5573llvm/lib/Target/SPIRV SPIRVLegalizerInfo.cpp, llvm/test/CodeGen/SPIRV/hlsl-intrinsics atan2_mat.ll

[SPIR-V] Legalize wide-vector atan2 by splitting first (#213341)

fixes #213340

This was simple fix we just had to change the order in which we were
doing the splitting and widdening.

This change prioritize splitting G_FATAN2 vectors wider than four
elements before attempting power-of-two widening, which G_FATAN2 does
not support.

Add float and half coverage for vector widths 6, 8, 9, 12, and 16.
DeltaFile
+189-1llvm/test/CodeGen/SPIRV/hlsl-intrinsics/atan2_mat.ll
+2-2llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
+191-32 files

LLVM/project 5e532bbllvm/test/TableGen AMDGPUTargetDefErrors.td, llvm/utils/TableGen/Basic AMDGPUTargetDefEmitter.cpp

AMDGPU: Validate generic processor features in TargetParser emitter

Perform some initial validation that the feature set of generic
targets is consistent with the set of covered targets. For now, this
only validates the frontend exported list so it should be good for
catching missed builtins that ought to be accepted on the generic.
In the future arbitrary features should be validated, but this is
complicated by workaround features and size features which need to
clamp to the common monimum.

Co-authored-by: Claude (Claude-Opus-4.8)
DeltaFile
+60-0llvm/utils/TableGen/Basic/AMDGPUTargetDefEmitter.cpp
+30-0llvm/test/TableGen/AMDGPUTargetDefErrors.td
+90-02 files

LLVM/project 2e14bedllvm/include/llvm/TargetParser AMDGPUTargetParser.h, llvm/lib/TargetParser AMDGPUTargetParser.cpp

AMDGPU: Export the TargetParser feature bitset

Previously this bitset was only used to populate the feature
name string map used by clang. Eventually this will replace
the current bitmask integer. AArch64 already has a similar
interface.

Co-authored-by: Claude (Claude-Opus-4.8)
DeltaFile
+17-14llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+29-0llvm/unittests/TargetParser/TargetParserTest.cpp
+16-0llvm/include/llvm/TargetParser/AMDGPUTargetParser.h
+62-143 files

LLVM/project 97b34d6llvm/lib/Target/AMDGPU AMDGPU.td, llvm/lib/TargetParser AMDGPUTargetParser.cpp

AMDGPU: Tablegenerate TargetParser feature sets (#212945)

Traditionally we maintained 2 parallel feature mechanisms,
one in clang (later moved to TargetParser), with largely
mirrored subtarget features defined in the backend. Start
directly taking feature information from the backend and putting
it into TargetParser. This is still in a compromise mid-migration
state. We still have both the legacy "ArchAttr" bitfield integer,
plus a new AMDGPUFeatureBitset field stored in the table, which
isn't yet exported.

For the moment, the new bitset is only used to populate the
feature string name map, which is the big maintainability win.
This also lists an explicit subset of exported features to
avoid churn.

Co-authored-by: Claude (Claude-Opus-4.8)
DeltaFile
+51-517llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+115-3llvm/utils/TableGen/Basic/AMDGPUTargetDefEmitter.cpp
+41-0llvm/unittests/TargetParser/TargetParserTest.cpp
+39-0llvm/lib/Target/AMDGPU/AMDGPU.td
+246-5204 files

LLVM/project 377945aclang/lib/Driver/ToolChains Clang.cpp, clang/test/Driver openmp-target-fast-flag.c

Revert "[OpenMP] target-fast implies teams/threads oversubscription (#205775)"

This reverts commit 981286a235471cfffbf2b18201aea926a0803b9c.
DeltaFile
+7-15clang/test/Driver/openmp-target-fast-flag.c
+2-2clang/lib/Driver/ToolChains/Clang.cpp
+9-172 files

LLVM/project d6e58d2libc/src/__support freestore.h tlsf_table.h

improve docs
DeltaFile
+42-28libc/src/__support/tlsf_table.h
+22-0libc/src/__support/freestore.h
+64-282 files

LLVM/project 7d9580dlibc/include/llvm-libc-proxy CMakeLists.txt elf_proxy.yaml, utils/bazel/llvm-project-overlay/libc BUILD.bazel

[libc] Fix elf_proxy header generation (#213737)

Followup to fix the generated proxy header after #211428.

Assisted-by: Automated tooling, human reviewed.
DeltaFile
+1-4utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+1-1libc/include/llvm-libc-proxy/elf_proxy.yaml
+0-1libc/include/llvm-libc-proxy/CMakeLists.txt
+2-63 files

LLVM/project 7f04a40lldb/source/Plugins/ObjectFile/Minidump MinidumpFileBuilder.cpp, lldb/test/API/functionalities/process_save_core_minidump/partial_read Makefile main.cpp

[lldb][minidump] write the memory after an unreadable page when saving minidump (#212641)

**Issue**
An internal failing test found a latent bug in lldb's save-core
(minidump writer). When it saved a memory range that had an unreadable
page in it, it:
  - stopped at that page and threw away the readable memory after it, 

Result: We couldnot get the stack traces from the minidump. in the below
example the **current logic is bailing out at the 6th region and not
writing other 70 regions.**

```
[satyajanga at devgpu011.eag2 ~/fbsource/fbcode (eacbfddefa|remote/master)]$ lldb
(lldb) file /data/users/satyajanga/fbsource/buck-out/v2/art/fbcode/55005549ebc49982/sand/tests/__Coro__/Coro
Current executable set to '/data/users/satyajanga/fbsource/buck-out/v2/art/fbcode/55005549ebc49982/sand/tests/__Coro__/Coro' (x86_64).
(lldb) b coro.cpp:44                                                                                                                              Breakpoint 1: where = Coro`::co_main() + 197 at coro.cpp:44, address = 0x00000000002335a5
(lldb) r
Process 3374177 launched: '/data/users/satyajanga/fbsource/buck-out/v2/art/fbcode/55005549ebc49982/sand/tests/__Coro__/Coro' (x86_64)

    [47 lines not shown]
DeltaFile
+41-69lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
+101-0lldb/test/API/functionalities/process_save_core_minidump/partial_read/TestProcessSaveCoreMinidumpPartialRead.py
+26-0lldb/test/API/functionalities/process_save_core_minidump/partial_read/main.cpp
+3-0lldb/test/API/functionalities/process_save_core_minidump/partial_read/Makefile
+171-694 files

LLVM/project ccc9005offload/include/Shared APITypes.h, offload/plugins-nextgen/amdgpu/src rtl.cpp

[offload] Use pinned memory for KLE

Reduce kernel launch latency by using the fast path "pinned host memory
-> device memory" for submitting the kernel launch environment.

Claude assisted with this patch.
DeltaFile
+105-3offload/plugins-nextgen/common/src/PluginInterface.cpp
+74-0offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp
+38-0offload/plugins-nextgen/common/include/PluginInterface.h
+6-0offload/include/Shared/APITypes.h
+4-0offload/plugins-nextgen/amdgpu/src/rtl.cpp
+227-35 files

LLVM/project 1e30ad8llvm/lib/Target/NVPTX NVPTXRegisterInfo.cpp NVPTXTargetMachine.cpp

[NVPTX] Remove redundant state from TargetMachine and Subtarget (NFC) (#213715)
DeltaFile
+50-51llvm/lib/Target/NVPTX/NVPTXSubtarget.h
+9-35llvm/lib/Target/NVPTX/NVPTXTargetMachine.h
+9-32llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp
+5-30llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
+4-4llvm/lib/Target/NVPTX/NVPTXRegisterInfo.cpp
+77-1525 files

LLVM/project c676c7bflang/lib/Lower/OpenMP DataSharingProcessor.cpp OpenMP.cpp, flang/lib/Semantics openmp-utils.cpp

[flang][OpenMP] Lower DO and SIMD variants in metadirectives

A standalone metadirective and its associated DO are sibling PFT evaluations,
so a selected loop replacement cannot directly reuse ordinary OpenMP loop
lowering. Runtime selection must also preserve exactly one copy of the loop in
each reachable branch. Temporarily associate the evaluations while lowering
to support DO, SIMD, and DO SIMD replacements without losing or duplicating the
ordinary fallback loop.

For example:

```fortran
!$omp metadirective &
!$omp& when(user={condition(flag)}: do) &
!$omp& otherwise(nothing)
do i = 1, n
  a(i) = i
end do
```

    [49 lines not shown]
DeltaFile
+582-211flang/lib/Lower/OpenMP/OpenMP.cpp
+673-0flang/test/Lower/OpenMP/metadirective-loop.f90
+326-0flang/lib/Semantics/openmp-utils.cpp
+132-0flang/test/Lower/OpenMP/Todo/metadirective-block-data-environment.f90
+96-1flang/test/Lower/OpenMP/metadirective-implementation.f90
+69-8flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
+1,878-22022 files not shown
+2,396-23828 files

LLVM/project ece39fdclang/lib/CIR/Lowering LoweringHelpers.cpp, clang/lib/CIR/Lowering/DirectToLLVM LowerToLLVM.cpp

[CIR]Add RecordType to our dense-array optimization in lowering (#213725)

This is an issue in AMDGPUAsmParser.cpp self-build, we have a lot of
record elements (~360k+!) in an array that causes us to have this TU be
near-never-ending(hour+). Classic codegen compiles this sub-minute on my
machine. With this patch, we are only about a 30% increase in time.

Note: Claude wrote much of the tests after I got through every exception
I could think of. I think this covers everything, and I hope there is no
missing coverage.
DeltaFile
+41-1clang/test/CIR/Lowering/const-array-bulk-lowering-fallbacks.cir
+30-0clang/lib/CIR/Lowering/LoweringHelpers.cpp
+23-0clang/test/CIR/CodeGen/array.cpp
+1-1clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+95-24 files

LLVM/project 2df0db6clang/lib/CodeGen CGExprScalar.cpp, clang/test/CodeGen ubsan-pointer-overflow-constant-fold.c

[UBSan] Fix assertion failure in EmitCheckedInBoundsGEP for constant-… (#191278)

…folded overflowing offsets

EmitGEPOffsetInBytes has two paths: for fully constant GEPs it subtracts
pointer values and always returns OffsetOverflows=false, but for
non-constant GEPs it iterates operands using checked arithmetic. The
assertion in EmitCheckedInBoundsGEP assumed a constant TotalOffset
implies no overflow, conflating the two paths.

In the non-constant path, the offset can be entirely constant-folded
(constant index * constant element size) while the GEP itself remains
non-constant (runtime base pointer). If that arithmetic overflows
intptr_t, we get a constant TotalOffset with OffsetOverflows=true,
triggering the assertion. This is easily hit on 16-bit targets like
MSP430 with realistic struct array indices.

Remove the assertion. The existing codegen already handles this
correctly: the constant OffsetOverflows=true propagates into the check

    [4 lines not shown]
DeltaFile
+34-0clang/test/CodeGen/ubsan-pointer-overflow-constant-fold.c
+4-7clang/lib/CodeGen/CGExprScalar.cpp
+38-72 files