LLVM/project 6a55a52llvm/lib/Transforms/Vectorize VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize/RISCV truncate-to-minimal-bitwidth-cost.ll strided-access-wide-stride.ll

[VPlan] zext canonical IV in convertToStridedAccesses (#212291)

Currently we sext it which isn't correct at TCs > UINT32_MAX. Makes
#209611 NFC
DeltaFile
+4-4llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses-narrow-iv.ll
+2-2llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses.ll
+1-1llvm/test/Transforms/LoopVectorize/RISCV/truncate-to-minimal-bitwidth-cost.ll
+1-1llvm/test/Transforms/LoopVectorize/RISCV/strided-access-wide-stride.ll
+1-1llvm/test/Transforms/LoopVectorize/RISCV/dead-ops-cost.ll
+1-1llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+10-106 files

LLVM/project 0651796mlir/lib/Dialect/OpenACC/Transforms ACCCGToGPU.cpp, mlir/test/Dialect/OpenACC acc-cg-to-gpu-reduction-array.mlir

[mlir][OpenACC] Lower single-block thread-only array reductions (#212369)

Example:
```fortran
!$acc parallel loop vector reduction(+:b)
do i = 1, n
  b(i) = i
end do
```

In this code the array reduction is thread(vector)-only with no
gang/block launch dim, so a within-block `all_reduce` is a complete
reduction. ACCCGToGPU still rejected it as NYI because the accumulate
had no block context.

Fix: keep the NYI only when the region actually launches block
dimensions; allow the existing per-element `all_reduce` path for
single-block thread-only array accumulates.
DeltaFile
+30-0mlir/test/Dialect/OpenACC/acc-cg-to-gpu-reduction-array.mlir
+7-3mlir/lib/Dialect/OpenACC/Transforms/ACCCGToGPU.cpp
+37-32 files

LLVM/project 1e1274bllvm/lib/Target/AMDGPU AMDGPUTargetParser.td R600Processors.td, llvm/lib/TargetParser AMDGPUTargetParser.cpp

AMDGPU: Add -gen-amdgpu-target-def TableGen backend (#212318)
DeltaFile
+134-0llvm/utils/TableGen/Basic/AMDGPUTargetDefEmitter.cpp
+64-0llvm/unittests/TargetParser/TargetParserTest.cpp
+40-21llvm/lib/Target/AMDGPU/R600Processors.td
+42-0llvm/test/TableGen/AMDGPUTargetDefErrors.td
+31-0llvm/lib/Target/AMDGPU/AMDGPUTargetParser.td
+4-4llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+315-253 files not shown
+321-259 files

LLVM/project bba25a8llvm/lib/Target/NVPTX NVPTXRegisterInfo.cpp NVPTXAsmPrinter.cpp, llvm/lib/Target/NVPTX/MCTargetDesc NVPTXTargetStreamer.h NVPTXTargetStreamer.cpp

[NVPTX] Emit some more PTX directives through target streamer (#212070)

Move `.branchtargets`, `.reg`, `.local`, `.alias`, `.pragma`, and the
empty `.debug_macinfo` section out of hand-built strings in
`NVPTXAsmPrinter` and into `NVPTXTargetStreamer` hooks.
Opportunistically pulled at a few other threads that could use cleanup
as well.

Three behavior changes: 
1. Jump table labels now come from `MachineFunction::getJTISymbol`, so
`$L_brx_<idx>` becomes `JTI<func>_<idx>` and is no longer shared across
functions
2. `.alias` names its aliasee by mangled symbol rather than raw IR name,
fixing `.alias a, ;` for an unnamed aliasee.
3. The rest of the test diff is a duplicated blank line that functions
with no register declarations no longer emit.

Co-Authored by Opus 5
DeltaFile
+41-62llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
+0-60llvm/test/CodeGen/NVPTX/fence.ll
+53-0llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXTargetStreamer.cpp
+41-0llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXTargetStreamer.h
+0-38llvm/test/CodeGen/NVPTX/vector-returns.ll
+1-36llvm/lib/Target/NVPTX/NVPTXRegisterInfo.cpp
+136-19638 files not shown
+174-35044 files

LLVM/project e6d0532llvm/docs ReleaseNotes.md, llvm/lib/Target/RISCV RISCVISelDAGToDAG.h

Use std::array and merge release notes

Created using spr 1.3.6-beta.1
DeltaFile
+2-2llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
+2-2llvm/docs/ReleaseNotes.md
+4-42 files

LLVM/project 30b8cb2llvm/include/llvm/Target TargetMacroFusion.td, llvm/test/TableGen MacroFusion.td

[MacroFusion] Add RunPreRA/RunPostRA to select the scheduling stage (#212182)

MacroFusion runs in both the pre-RA and post-RA machine schedulers.
Add two `bit` fields to the `Fusion` base class, `RunPreRA` and
`RunPostRA`, both defaulting to `true`, so a fusion can opt out of a
scheduling stage. At least one of them must be `true`.

When a stage is disabled, `MacroFusionPredicatorEmitter` emits an early
`return false` guard for that stage (detected via the `NoVRegs` machine
function property) and only keeps the statistic counter for the stage
the fusion actually runs in. A pre-RA-only fusion is generated as:

```cpp
  STATISTIC(NumNAMEPreRA, "Times NAME Triggered (pre-ra)");
  bool isNAME(...) {
    ...
    if (SecondMI.getMF()->getProperties().hasNoVRegs())
      return false;
    /* Predicates */

    [9 lines not shown]
DeltaFile
+92-0llvm/test/TableGen/MacroFusion.td
+68-14llvm/utils/TableGen/MacroFusionPredicatorEmitter.cpp
+9-0llvm/include/llvm/Target/TargetMacroFusion.td
+169-143 files

LLVM/project cc8e2b8llvm/test/tools/llvm-objcopy/ELF binary-output-target.test

[llvm-objcopy] Add AMDGPU case to binary-output-target.test

Add test coverage for converting binary input to elf64-amdgpu format,
verifying the output has the correct format string, arch (amdgpu),
and machine type (EM_AMDGPU 0xE0). Follows the same pattern as all
other architectures in this test file.
DeltaFile
+6-0llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
+6-01 files

LLVM/project d111119llvm/test/tools/llvm-objcopy/ELF binary-output-target.test

[llvm-objcopy] Fix AMDGPU arch checks in tests

ELFObjectFile.h getArch() for EM_AMDGPU returns Triple::UnknownArch
when e_flags & EF_AMDGPU_MACH is 0 (no GPU target specified). Only
when a MACH flag in the AMDGCN range is present does it return
Triple::amdgpu.

- cross-arch-headers.test: restore EF_AMDGPU_MACH_AMDGCN_GFX900 flag
  on the input ELF so that after format conversion the output correctly
  reports Arch: amdgpu.

- binary-output-target.test: expect Arch: unknown since converting
  from raw binary input (-I binary) produces an ELF with e_flags=0
  (no MACH flags), giving UnknownArch. This is correct behavior.
DeltaFile
+1-1llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
+1-11 files

LLVM/project 5e91f5dllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 schedule-bundle-missing-for-expanded-binop-parent.ll

[SLP]Fix dep accounting for expanded binops in non-scheduled entries

The extra dependency counted for the expanded form was never released
when the expanding entry had no schedule bundle and the block had no
copyable elements, leaving the operand's bundle unscheduled forever.
Take the pseudo-bundle path also when the instruction is an expanded
binop in some tree entry.

Fixes #212220

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/212380
DeltaFile
+47-0llvm/test/Transforms/SLPVectorizer/X86/schedule-bundle-missing-for-expanded-binop-parent.ll
+17-14llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+64-142 files

LLVM/project 67861a2llvm/test/tools/llvm-objcopy/ELF cross-arch-headers.test binary-output-target.test

[llvm-objcopy] Fix AMDGPU arch checks in tests

ELFObjectFile.h getArch() for EM_AMDGPU returns Triple::UnknownArch
when e_flags & EF_AMDGPU_MACH is 0 (no GPU target specified). Only
when a MACH flag in the AMDGCN range is present does it return
Triple::amdgpu.

- cross-arch-headers.test: restore EF_AMDGPU_MACH_AMDGCN_GFX900 flag
  on the input ELF so that after format conversion the output correctly
  reports Arch: amdgpu.

- binary-output-target.test: expect Arch: unknown since converting
  from raw binary input (-I binary) produces an ELF with e_flags=0
  (no MACH flags), giving UnknownArch. This is correct behavior.
DeltaFile
+1-1llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test
+1-1llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
+2-22 files

LLVM/project 9121283clang/docs ReleaseNotes.md, clang/lib/UnifiedSymbolResolution USRGeneration.cpp

[clang][Index][USR] Generate USRs for class-type non-type template arguments (#212356)

A class-type non-type template parameter is represented in the AST by a
TemplateParamObjectDecl, which has an empty DeclarationName.
USRGenerator had no visitor for it, so it fell through to
VisitNamedDecl, where EmitDeclName fails on the empty name and sets
IgnoreResults. That discarded the USR of the enclosing declaration.

Add a visitor that encodes the parameter object's type and value, so
specializations on distinct values get distinct USRs and equal values
agree.

Fixes #212351
DeltaFile
+27-0clang/test/Index/USR/class-type-tpl-arg.cpp
+10-0clang/lib/UnifiedSymbolResolution/USRGeneration.cpp
+2-0clang/docs/ReleaseNotes.md
+39-03 files

LLVM/project 123063fclang/lib/CodeGen CGOpenMPRuntime.cpp, clang/test/OpenMP target_map_nested_ptr_member_mapper_codegen.cpp

[OpenMP] Propagate PRESENT to pointee entries in mapper codegen

Extend map-type-modifier propagation in emitUserDefinedMapper to the PRESENT
modifier, but only for entries that have an attach ptr (the pointee data, whose
storage differs from the struct's own). A present modifier on the outer clause
must require that pointee to be present on the device.

This is gated on a new PropagatePresentToPointee argument, which Clang sets from
CGM.getLangOpts().OpenMP >= 60. Before 6.0 the present modifier is treated as
not applying to the pointee: the spec committee confirmed the divergence
between the present motion modifier (to/from) and the present map-type modifier
(map) was unintentional, to be fixed as an OpenMP 6.0 erratum. Only propagation
is gated; present written directly in a mapper's own clause applies at all
versions.

A TODO notes PRESENT should also propagate to the struct's own members, which
is blocked while pointer members use PTR_AND_OBJ.

Update the present-check tests to their final 6.0-gated behavior.

    [2 lines not shown]
DeltaFile
+36-11llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+10-17offload/test/mapping/mapper_target_update_present_ptee.c
+14-13offload/test/mapping/mapper_map_mbr_then_present_mbr_ptee.c
+13-4llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+6-9clang/test/OpenMP/target_map_nested_ptr_member_mapper_codegen.cpp
+12-3clang/lib/CodeGen/CGOpenMPRuntime.cpp
+91-576 files

LLVM/project 5f0e43bclang/lib/CodeGen CGOpenMPRuntime.cpp, clang/test/OpenMP declare_mapper_codegen.cpp target_map_nested_ptr_member_mapper_codegen.cpp

[OpenMP][Clang] Enable ATTACH-style maps for mappers.

Track per-entry attach-ptr info (HasAttachPtr) through mapper codegen so that
emitUserDefinedMapper does not add a new outer MEMBER_OF to pointee/combined
entries (which occupy different storage than the struct) or to ATTACH entries.
Clang and the MLIR translator populate the per-entry array in parallel with the
other MapInfosTy arrays.

Address review:
  - Rename MapSkipMemberOfArrayTy to MapHasAttachPtrArrayTy to match the
    HasAttachPtr field it backs.
  - Restructure the emitUserDefinedMapper comment into a bulleted (*)/(**)/(***)
    list keyed to the example entries.
  - Reword the Clang comments: HasAttachPtr marks pointee entries that have a
    base attach-ptr; a combined entry has a base attach-ptr if its constituents
    do; cross-reference emitUserDefinedMapper for the MEMBER_OF rationale.
  - Update the moved present-check tests to their now-correct behavior (the
    attach-style maps make the inbounds present checks pass and remove the
    "explicit extension" errors).

    [2 lines not shown]
DeltaFile
+196-160clang/test/OpenMP/target_map_nested_ptr_member_mapper_codegen.cpp
+68-60clang/test/OpenMP/declare_mapper_codegen.cpp
+56-15llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+65-5clang/lib/CodeGen/CGOpenMPRuntime.cpp
+18-24offload/test/mapping/mapper_enter_data_always_present_ptee.c
+18-22offload/test/mapping/mapper_map_mbr_then_present_mbr_ptee.c
+421-28611 files not shown
+493-36117 files

LLVM/project 021f7f4clang/test/OpenMP declare_mapper_codegen.cpp target_map_array_section_of_structs_with_nested_mapper_codegen.cpp, llvm/lib/Frontend/OpenMP OMPIRBuilder.cpp

[OpenMP] Propagate ALWAYS/DELETE/CLOSE map-type modifiers to mapper entries

When a map clause uses a user-defined mapper, the map-type-modifying bits
(ALWAYS, DELETE, CLOSE) on the outer clause must apply to each map the mapper
inserts (OpenMP 6.0:281:34). Propagate them in emitUserDefinedMapper by OR-ing
the imported modifier bits into each pushed component, except ATTACH entries
(ATTACH|ALWAYS is reserved for attach(always) and the other bits are
meaningless for ATTACH).

PRESENT is intentionally not propagated here yet (a TODO notes it is handled in
a follow-on, since it requires distinguishing pointee entries from the struct's
own storage).

Update the offload always-propagation tests to their now-correct behavior:
ALWAYS forces a member transfer that the ref count would otherwise suppress, so
mapper_map_always_from.c reads s.y back as 111, and the enter-data variants
(C and Fortran) see 111 in the device copy (all were 0 before this change).
Since emitUserDefinedMapper is shared between clang and flang, the Fortran test
covers the flang path as well.

    [2 lines not shown]
DeltaFile
+152-136clang/test/OpenMP/target_map_nested_ptr_member_mapper_codegen.cpp
+87-77clang/test/OpenMP/target_map_array_section_of_structs_with_nested_mapper_codegen.cpp
+87-77clang/test/OpenMP/target_map_array_of_structs_with_nested_mapper_codegen.cpp
+38-2llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+27-9clang/test/OpenMP/declare_mapper_codegen.cpp
+11-17offload/test/offloading/fortran/mapper-map-always-to-enter-data.f90
+402-3187 files not shown
+443-37013 files

LLVM/project ece9735offload/test/mapping mapper_map_always_to_enter_data.c, offload/test/offloading/fortran mapper-map-always-to-enter-data.f90

[OpenMP][test] Add mapper ALWAYS-propagation tests with no target construct

Companions to mapper_map_always_from.c that exercise ALWAYS propagation into a
user-defined mapper's entries without entering any target region. The device
copy is inspected directly via omp_get_mapped_ptr() and omp_target_memcpy(), so
the check covers only the data-motion performed by `target enter data`.

The Fortran variant is the first Fortran offload test that runs on the host
(x86_64) target: it needs no device kernel, so it does not depend on a device
runtime being available.

Both tests currently CHECK the pre-propagation behavior (the transfer is
suppressed for the already-mapped entry) and record the expected value in a
FIXME.
DeltaFile
+71-0offload/test/offloading/fortran/mapper-map-always-to-enter-data.f90
+60-0offload/test/mapping/mapper_map_always_to_enter_data.c
+131-02 files

LLVM/project e364a21llvm/include/llvm/Transforms/IPO Instrumentor.h, llvm/lib/Transforms/IPO Instrumentor.cpp

[Instrumentor] Reintroduce runtime inlining (#208072)

The ability to link in and eagerly inline a specified runtime was
present in older dev versions of the instrumentor. This patch ports that
functionality to the current instrumentor pass and adds a test.

Co-authored-by: Johannes Doerfert <johannes at jdoerfert.de>
Co-authored-by: Kevin Sala <salapenades1 at llnl.gov>
Co-authored-by: Ivan Radanov Ivanov <ivanov.i.aa at m.titech.ac.jp>
DeltaFile
+218-0llvm/test/Instrumentation/Instrumentor/inline_runtime.ll
+71-0llvm/lib/Transforms/IPO/Instrumentor.cpp
+14-0llvm/test/Instrumentation/Instrumentor/inline_runtime_config.json
+13-0llvm/test/Instrumentation/Instrumentor/runtimes/bytes_computed_rt.ll
+5-1llvm/test/Instrumentation/Instrumentor/default_config.json
+6-0llvm/include/llvm/Transforms/IPO/Instrumentor.h
+327-12 files not shown
+330-28 files

LLVM/project 63fe0cfllvm/include/llvm/CodeGen BasicTTIImpl.h, llvm/test/Transforms/RelLookupTableConverter unnamed_addr.ll

Reapply "Disable RelLookupTableConverter on AArch64" (#212358)

This reverts commit ce8cf3f0a427f7fcf178a9a64ea48a4167211f82 (#207046).

Reland of #204669.


https://github.com/ARM-software/abi-aa/blob/main/sysvabi64/sysvabi64.rst#code-models
says that under the small code model rodata + text must fit in 2GB, but
the RelLookupTableConverter pass introduces PREL32 relocations from
.rodata to .data.rel.ro:

```
$ cat /tmp/a.c
extern void ext_func0(void);
extern void ext_func1(void);

typedef void (*func_t)(void);


    [24 lines not shown]
DeltaFile
+47-0llvm/test/Transforms/RelLookupTableConverter/AArch64/no_relative_lookup_table.ll
+0-40llvm/test/Transforms/RelLookupTableConverter/unnamed_addr.ll
+4-3llvm/include/llvm/CodeGen/BasicTTIImpl.h
+51-433 files

LLVM/project 828456fllvm/test/tools/llvm-objcopy/ELF binary-output-target.test

[llvm-objcopy] Add AMDGPU case to binary-output-target.test

Add test coverage for converting binary input to elf64-amdgpu format,
verifying the output has the correct format string, arch (amdgpu),
and machine type (EM_AMDGPU 0xE0). Follows the same pattern as all
other architectures in this test file.
DeltaFile
+6-0llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
+6-01 files

LLVM/project 7d96bd2llvm/lib/Target/AMDGPU VOP3PInstructions.td, llvm/test/CodeGen/AMDGPU pk-lshl-add-u64.ll

[AMDGPU] Allow scalar operands in V_PK_LSHL_ADD_U64 (#212334)

Patch creates dummy source modifiers for this instruction to use
with OPSEL. Even though these do not support modifiers we can reuse
the same mechanics as with packed fp64 and other u64 to allow scalar
operands.
DeltaFile
+115-0llvm/test/CodeGen/AMDGPU/pk-lshl-add-u64.ll
+16-13llvm/lib/Target/AMDGPU/VOP3PInstructions.td
+131-132 files

LLVM/project 4053f2bflang-rt README.md CMakeLists.txt, flang-rt/lib/cuda allocator.cpp

[flang-rt][cuda] Keep CUFDeviceIsActive working under runtime/driver skew (#212320)

Resolve cuDevicePrimaryCtxGetState via the installed driver version, and
prefer running scope-exit cleanup when the probe cannot prove teardown,
so local device allocations are not leaked when the unversioned lookup
fails.
DeltaFile
+23-13flang-rt/lib/cuda/allocator.cpp
+2-6flang-rt/unittests/Runtime/CUDA/AllocatorCUF.cpp
+6-0flang-rt/CMakeLists.txt
+1-1flang-rt/README.md
+32-204 files

LLVM/project bd5883cclang/lib/AST RecordLayoutBuilder.cpp, clang/test/CodeGenCXX override-layout-aligned-base.cpp

[clang] Fix record alignment lost via external layout on Arm64 (#212362)

An external layout source (such as LLDB reading DWARF) supplies a
record's final alignment directly, since `alignas` / `__declspec(align)`
attributes are not recoverable from debug info. `finalizeLayout`
captured `NonRequiredAlignment` before applying the external alignment,
so an externally laid out record published a stale, too-small value.

On Arm64 this field is used to fold a base's alignment into the derived
record, so a derived class picked up the stale value instead of the
base's actual alignment. This regressed
`lldb/test/API/lang/cpp/alignas_base_class` when #210461 was merged,
where `alignof(Derived)` evaluated to 1 instead of 8. Other targets were
unaffected as they do not read this field.

Treat all of an externally supplied alignment as non-required, as there
is no way to tell how much of it was imposed by an alignment attribute.
DeltaFile
+29-0clang/test/CodeGenCXX/override-layout-aligned-base.cpp
+8-0clang/test/CodeGenCXX/Inputs/override-layout-aligned-base.layout
+6-1clang/lib/AST/RecordLayoutBuilder.cpp
+43-13 files

LLVM/project 8f0815bmlir/include/mlir/Analysis FlatLinearValueConstraints.h, mlir/include/mlir/Dialect/Affine/Analysis AffineStructures.h

[MLIR] Allow recovering from semi-affine sets in FlatLinearValueConstraints

The IntegerSet constructor of FlatLinearValueConstraints asserts when
flattening fails, which happens for semi-affine integer sets. Since the
failure is signalled from inside a constructor, callers have no way to
detect the unsupported case ahead of time and no way to work around it;
they simply crash.

Make that constructor protected and expose the construction through
`FlatLinearValueConstraints::create` (and the corresponding
`FlatAffineValueConstraints::create`), which returns a `FailureOr` and
so lets callers handle a semi-affine set gracefully.

Existing in-tree users are updated: `addAffineIfOpDomain` keeps asserting
as before, and `simplifyIntegerSet` now returns the set unchanged instead
of asserting, since a semi-affine set simply cannot be simplified this way.
DeltaFile
+17-3mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
+15-2mlir/lib/Analysis/FlatLinearValueConstraints.cpp
+8-4mlir/lib/Dialect/Affine/Analysis/Utils.cpp
+10-2mlir/include/mlir/Analysis/FlatLinearValueConstraints.h
+5-1mlir/unittests/Analysis/Presburger/Parser.h
+5-0mlir/include/mlir/Dialect/Affine/Analysis/AffineStructures.h
+60-126 files

LLVM/project 05eba61llvm/lib/Transforms/Vectorize VPlanUtils.h VPlanUtils.cpp

[VPlan] Add vputils::getEarlyExits helper (NFC) (#212348)

Both handleUncountableEarlyExits and the countable early-exit disconnect
in handleEarlyExits walk all exit blocks and skip predecessors coming
from the middle block to find the early exiting blocks.

Factor that walk out into vputils::getEarlyExits, returning the (early
exiting block, exit block) pairs.
DeltaFile
+28-32llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+6-12llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+10-0llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+5-0llvm/lib/Transforms/Vectorize/VPlanUtils.h
+49-444 files

LLVM/project 0fa9cfallvm/docs CIBestPractices.rst Reference.md

[CI] Add documentation for self-hosted runners (#211622)

This patch adds (work in progress) documentation for the various
self-hosted runner groups we have access to in the LLVM monorepo.
DeltaFile
+105-0llvm/docs/GitHubActionsRunners.rst
+5-0llvm/docs/Reference.md
+3-0llvm/docs/CIBestPractices.rst
+113-03 files

LLVM/project d8d33abmlir/include/mlir/Analysis FlatLinearValueConstraints.h, mlir/include/mlir/Dialect/Affine/Analysis AffineStructures.h

[MLIR] Allow recovering from semi-affine sets in FlatLinearValueConst… (#212346)

…raints

The IntegerSet constructor of FlatLinearValueConstraints asserts when
flattening fails, which happens for semi-affine integer sets. Since the
failure is signalled from inside a constructor, callers have no way to
detect the unsupported case ahead of time and no way to work around it;
they simply crash.

Add an optional `bool *error` parameter to the constructor. When it is
non-null, hitting the unimplemented case sets `*error` to true and
returns instead of asserting, letting callers bail out gracefully.
`*error` is set to false on success. When the pointer is null the
previous assert behavior is retained, so existing callers are
unaffected.
DeltaFile
+17-3mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
+15-2mlir/lib/Analysis/FlatLinearValueConstraints.cpp
+8-4mlir/lib/Dialect/Affine/Analysis/Utils.cpp
+10-2mlir/include/mlir/Analysis/FlatLinearValueConstraints.h
+4-1mlir/unittests/Analysis/Presburger/Parser.h
+5-0mlir/include/mlir/Dialect/Affine/Analysis/AffineStructures.h
+59-126 files

LLVM/project 1acf5ddclang/lib/Basic/Targets AMDGPU.cpp, llvm/include/llvm/TargetParser AMDGPUTargetParser.h

AMDGPU: Handle more TargetParser queries in tablegen

Previously we had various enum switches. Start generated tables
indexed by enums. Avoid some special cases by defining the dummy
"generic" and "generic-hsa" targets as real processors.

Co-authored-by: Claude (Claude-Opus-4.8)
DeltaFile
+62-82llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+87-30llvm/utils/TableGen/Basic/AMDGPUTargetDefEmitter.cpp
+7-4llvm/lib/Target/AMDGPU/GCNProcessors.td
+2-5clang/lib/Basic/Targets/AMDGPU.cpp
+2-4llvm/include/llvm/TargetParser/AMDGPUTargetParser.h
+4-0llvm/lib/Target/AMDGPU/AMDGPUTargetParser.td
+164-1253 files not shown
+168-1269 files

LLVM/project f879bdfllvm/include/llvm/TargetParser AMDGPUTargetParser.def, llvm/lib/Target/AMDGPU AMDGPUTargetParser.td GCNProcessors.td

AMDGPU: Generate TargetParser table from TableGen

Migrate .def file to tablegen. The initial TargetParser
AMDGPU backend only handled R600. Extend to modern targets.
Stub out some tablegen definitions which will be used in future
changes.

Co-authored-by: Claude (Claude-Opus-4.8)
DeltaFile
+255-191llvm/lib/Target/AMDGPU/GCNProcessors.td
+0-155llvm/include/llvm/TargetParser/AMDGPUTargetParser.def
+117-7llvm/utils/TableGen/Basic/AMDGPUTargetDefEmitter.cpp
+22-22llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+28-2llvm/lib/Target/AMDGPU/AMDGPUTargetParser.td
+16-0llvm/test/TableGen/AMDGPUTargetDefErrors.td
+438-3775 files not shown
+456-38411 files

LLVM/project a9a5ab3llvm/lib/Transforms/Utils SimplifyCFG.cpp, llvm/test/Transforms/SimplifyCFG/AMDGPU convergent-jump-threading.ll

[SimplifyCFG] Do not thread branches into uncontrolled convergent regions

SimplifyCFG's foldCondBranchOnValueKnownInPredecessor can thread an edge past
a block that acts as a reconvergence point. If the threaded destination reaches
an uncontrolled convergent operation before returning to the threaded-through
block, the transform can change which dynamic instance of the convergent
operation is executed.

Add a conservative destination scan for this fold and skip the threading
candidate when it can reach an uncontrolled convergent call before returning
to the original block. Controlled convergent operations using convergence
control tokens are left alone.

Fixes ROCM-26496.
DeltaFile
+68-6llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+52-3llvm/test/Transforms/SimplifyCFG/AMDGPU/convergent-jump-threading.ll
+120-92 files

LLVM/project a341835llvm/test/Transforms/SimplifyCFG/AMDGPU convergent-jump-threading.ll

[NFC] Pre-commit a test case for a SimplifyCFG issue
DeltaFile
+94-0llvm/test/Transforms/SimplifyCFG/AMDGPU/convergent-jump-threading.ll
+94-01 files

LLVM/project 6be5be5flang/include/flang/Semantics openmp-utils.h, flang/lib/Lower/OpenMP OpenMP.cpp

Apply metadirective loop checks after variant selection

Determine reachable replacements before preparing the associated loop. Apply
loop-only limitations only when a loop replacement can actually be selected.

Keep candidate-wide loop preparation for runtime cascades, where multiple
replacement arms remain reachable.
DeltaFile
+47-226flang/lib/Lower/OpenMP/OpenMP.cpp
+250-8flang/lib/Semantics/openmp-utils.cpp
+50-0flang/test/Semantics/OpenMP/metadirective-loop-nest.f90
+45-3flang/lib/Semantics/check-omp-variant.cpp
+48-0flang/test/Lower/OpenMP/metadirective-loop.f90
+46-0flang/include/flang/Semantics/openmp-utils.h
+486-2372 files not shown
+491-2378 files