[ORC] Add host-jit-triple lit feature, gate some JIT tests (#220929)
The JIT does not support throwing exceptions on Darwin/arm64e yet. Add
an llvm-lit feature flag, "host-jit-triple", that reports the process
triple as detected by `lli` so that we can mark exception-throwing tests
as unsupported when they would be run as arm64e. (Feature flags based on
build settings, e.g. host-triple and target-triple, don't reliably
report arm64e).
Adds a -host-jit-triple option to lli to print the value for the
feature-flag.
rdar://185482009
[CIR] Fix a problem with global view index calculation (#221066)
When a global that was declared with an incomplete array type is
replaced by a global with the completed type, the byte offset of each
global view on the old global is recomputed from its indices, and new
indices are derived from that offset. The offset computation rounded its
running total up to the ABI alignment of the record being indexed, which
incorrectly assumes that every member starts at a multiple of its
enclosing record's alignment. That does not hold for a member followed
by padding, so the offset came out too large. The recomputed view then
designated the wrong address or, when the inflated offset no longer
landed on a subelement boundary, fell back to a global offset attribute
holding the wrong offset.
Assisted-by: Cursor / claude-opus-5
[flang] Warn rather than error on out-of-range constant subscripts (#220435)
A reference with an out-of-range constant subscript is now accepted with
a
warning instead of being rejected with an error, and
`-fno-out-of-bounds-subscripts`
restores the error.
A subscript value is required to be within its bounds only when the
reference is
executed (F'2023 9.5.3.1 paragraph 2), so a reference that never runs
does not
render a program nonconforming. Whether a reference is ever executed
cannot be
determined in general -- consider a procedure whose only call site is in
dead
code, or one that is never called at all -- so rejecting these outright
turns
away conforming programs. Semantics already recognized the narrow case
[108 lines not shown]
[CIR] Add support for coroutine allocation failure (#220466)
This PR adds support for the coroutine promise member function
`get_return_object_on_allocation_failure()`.
When a coroutine fails to allocate its frame, the default behavior is to
throw `std::bad_alloc`. If the promise type defines
`get_return_object_on_allocation_failure()`, the coroutine uses the
nothrow form of `operator new`. If the allocation returns `nullptr`,
`get_return_object_on_allocation_failure()` is called and its return
value is returned to the caller instead of throwing.
One difference from OG is that we reverse the allocation condition. OG
checks whether the allocation was successful and branches to the
initialization path when the allocation succeeds. CIR checks whether the
allocated pointer is `nullptr` and handles the allocation failure case
inside a `cir.if`.
[LLVMABI] Align RecordType::isEmpty() with Clang's isEmptyRecord() (#218546)
[LLVMABI] Align RecordType::isEmpty() with Clang's isEmptyRecord()
While working on empty record handling for AArch64, I stumbled across a
couple of differences between the LLVM ABI library's
`RecordType::isEmpty()` and Clang's `CodeGen::isEmptyRecord()`. Testing
verified this led to observable differences in classification when using
the ABI library.
This change updates the ABI library's empty record handling to match
Clang.
Assisted-by: Cursor / various models
Reapply "[SandboxIR] Callback registration now allows specifying order (#221008) (#221017)
This reverts commit 89082772bed1ed16c0311b12147a96c35bb063d8.
And includes the fix.
[orc-rt] Make ExecutorProcessInfo platform-generic (#220938)
ExecutorProcessInfo was part generic, part system-specific: some of its
methods were implemented directly in its own .cpp, others only existed
as out-of-line definitions in per-OS files under lib/bedrock/sys/.
Move the system-specific pieces into free functions under orc_rt::sys
(mirroring the existing support/sys/ convention), and have
ExecutorProcessInfo consume them like any other client. The class itself
is now fully generic, with no system-specific code of its own.
No functional change, except that page-size detection (previously
hardcoded to POSIX sysconf) now goes through the same per-OS split as
the rest of ExecutorProcessInfo; a Windows implementation is left for a
follow-up.
[lldb][test] Rerun tests that hit a known flaky failure (#221006)
macOS 26.3 denies debugserver permission to attach when too many debug
sessions start at once, which surfaces as a test failing with "process
exited with status -1". The denial is intermittent and a rerun normally
gets through.
Gate the rerun on a list of known flake signatures rather than retrying
every failure, because a blanket retry masks real bugs. Adding to that
list is a last resort for defects outside LLDB's control.
[MLIR] Move inferred remainder bounds into results (NFC) (#221081)
Move locally computed signed and unsigned remainder bounds into their
final range accumulators when the special-case bounds are selected.
Found by Coverity.
Assisted-by: Codex