[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.
[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.
[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.
[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.
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)
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)
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.
Reject interrupted metadirective loop associations
Treat an intervening OpenMP declarative directive as the end of a pending
loop association, matching ordinary loop-directive handling. Preserve
pending variants from enclosing scopes.
[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.
AMDGPU: Add -gen-amdgpu-target-def TableGen backend
Currently subtarget information is duplicated between a def file and
the backend. There are also increasingly unwieldy mapping tables
for subarches. Work towards unifying these, starting with r600. This
mirrors aarch64 and riscv's existing custom targetparser backends (i.e.,
the prompt was copy what riscv does).
Co-authored-by: Claude (Claude-Opus-4.8)
RuntimeLibcalls: Migrate to dag libcall predicates (#210674)
Switch to using dag predicates instead of free-form code predicates.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
Diagnose eager privatization for metadirective loops
Metadirective loop IVs do not have the construct-scoped host
association required by eager privatization. Emit a focused TODO instead of
reaching an assertion or null dereference.
[flang][OpenMP] Lower DO and SIMD variants in metadirectives
Lower DO, SIMD, and DO SIMD replacement directives selected by a
metadirective. Support standalone and begin/end forms with static or runtime
selection.
A standalone metadirective and its associated loop are represented as sibling
PFT evaluations. For example:
```fortran
!$omp metadirective &
!$omp& when(user={condition(flag)}: do) &
!$omp& otherwise(nothing)
do i = 1, n
a(i) = i
end do
```
has the following evaluation shape:
[54 lines not shown]
[LLDB] Hide unresolvable children from ObjC tagged pointers (#211936)
Foundation's small value inline representations have valid summaries and
sometimed synthetic children, but LLDB cannot access any ivars from
their base classes (such as [NSObject isa]).
Use a synthetic child provider to hide them.
rdar://182434208
Assisted-by: claude
[llvm-objcopy] Remove unnecessary AMDGPU ELF flag from test
The EF_AMDGPU_MACH_AMDGCN_GFX900 flag was not needed in the test input.
The test only verifies that llvm-objcopy correctly sets EM_AMDGPU machine
type, 64-bit class, and little-endian encoding -- none of which depend on
the e_flags value. Use the same approach as all other architectures in
the test (no explicit FLAGS, defaulting to <none>).
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)
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)
AMDGPU: Add -gen-amdgpu-target-def TableGen backend
Currently subtarget information is duplicated between a def file and
the backend. There are also increasingly unwieldy mapping tables
for subarches. Work towards unifying these, starting with r600. This
mirrors aarch64 and riscv's existing custom targetparser backends (i.e.,
the prompt was copy what riscv does).
Co-authored-by: Claude (Claude-Opus-4.8)
AMDGPU: Add -gen-amdgpu-target-def TableGen backend
Currently subtarget information is duplicated between a def file and
the backend. There are also increasingly unwieldy mapping tables
for subarches. Work towards unifying these, starting with r600. This
mirrors aarch64 and riscv's existing custom targetparser backends (i.e.,
the prompt was copy what riscv does).
Co-authored-by: Claude (Claude-Opus-4.8)
[HLSL] Add UsedByAtomic64 shader flag (#211691)
This PR adds the `UsedByAtomic64` shader flag.
It detects any usage of an atomic instruction with a 64 bit type, and if
detected, sets the shader flag to true.
This is needed to pass DXIL validation.
Fixes https://github.com/llvm/llvm-project/issues/104392
Assisted by: Github Copilot
[libc++] Rename the test suite used on LNT (#212347)
The LNT instance on http://lnt.llvm.org was wiped since I created the
original schema, and we can now start over clean with a new test suite
named `libcxx`.
[Offload] Decouple CUDA source from NVPTX syncthreads assumption (#212339)
With the introduction of offloading via LLVM, the frontend language will
not necessarily determine the backend target anymore. Thus it is
necessary to guard against NVPTX instead of CUDA, since we could have
CUDA-language device code targeting a non-NVPTX backend, where Clang
does not provide __syncthreads as an NVPTX builtin and the generic shim
is still needed.
This also avoids duplicate definitions on NVPTX. Clang already provides
`__syncthreads` as an NVPTX target builtin, so
`__clang_gpu_device_functions.h` should not also define an inline
`__syncthreads` shim for NVPTX targets.
[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.
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.