RuntimeLibcalls: Fix adding __safestack_pointer_address by default (#182936)
This was accidentally added to the default set of libcalls, so move
it out of the giant let block over functions in the default set.
Should fix regression on SPARC bot.
[lld][MachO] Enable LoopVectorization and SLPVectorization for ThinLTO (#182748)
Commit 21a4710c67a97838dd75cf60ed24da11280800f8 previously enabled
LoopVectorization and SLPVectorization CodeGen options for the ELF and
COFF LTO backends. Since the Mach-O LTO port did not exist at the time,
it missed this configuration.
This patch adds these options to the Mach-O LTO setup for consistency
with the other backends. Without this, SLP and loop vectorization passes
are silently skipped during Mach-O LTO for O2 and O3 builds.
[AArch64][clang][llvm] Add ACLE `stshh` atomic store builtin
Add `__arm_atomic_store_with_stshh` implementation as defined
in the ACLE. Validate that the arguments passed are correct, and
lower it to the stshh intrinsic plus an atomic store with the
allowed orderings.
Gate this on FEAT_PCDPHINT so that availability matches
hardware support for the `STSHH` instruction. Use an i64
immediate and side-effect modeling to satisfy tablegen and decoding.
[bazel] Add missing llc test dep (#182937)
Used by mlir/test/Dialect/X86Vector/dot-bf16.mlir, which seems to not be
running due to some other misconfiguration.
[NFC][IR] Fix MSVC C4706 diagnostic w/ 741b2cda32e1 (#182682)
Fix error:
llvm\include\llvm\IR\Operator.h(279) : error C2220: the following
warning is treated as an error
llvm\include\llvm\IR\Operator.h(279) : warning C4706: assignment within
conditional expression
[openmp] Allow testing OpenMP without a full clang build tree (#182470)
Having a build tree with "not" and "FileCheck" is still required, but if
Clang/Flang isn't configured in that build, run the tests with the same
compiler CMake uses. This is how testing worked in the standalone build
configurations that now have been removed.
RuntimeLibcalls: Fix adding __safestack_pointer_address by default
This was accidentally added to the default set of libcalls, so move
it out of the giant let block over functions in the default set.
Should fix regression on SPARC bot.
[flang] Restrict mem2reg promotion through fir.declare to single-block case (#182933)
The PromotableOpInterface on fir.declare allows mem2reg to promote
allocas accessed through declare ops. However, MLIR's mem2reg computes
defining blocks and live-in sets only from direct users of the slot
pointer. Stores through fir.declare are users of the declare result, not
the alloca, so they are not registered as defining blocks. This causes
missing phi nodes at join points (loop headers, merge blocks), which
silently drops conditional updates to promoted variables.
This was observed in CUDA Fortran kernels where a loop variable updated
conditionally (e.g., mywatch = max(1, mywatch-32)) became constant after
promotion, producing incorrect results at runtime.
The fix restricts promotion through fir.declare to cases where all users
of the declare are in the same block. In single-block cases no phi nodes
are needed, so the MLIR limitation does not apply. Cross-block cases are
left unpromoted until the MLIR mem2reg infrastructure is extended to
track defining blocks through PromotableOpInterface results.
With the current behavior, this would be the result.
[37 lines not shown]
[unittests][Support] Fix FileSystemTest for BSD semantics (#181487)
BSD semantics (also available on Linux with mount -o bsdgroups/grpid)
for file/directory creation are to inherit the group ID from the parent
directory, rather than using the set-group-ID bit. When running these
tests on FreeBSD (and likely other BSDs), temporary files and
directories are created underneath /tmp, which is root:wheel (0:0), and
so they, and all their descendants, have a group of wheel.
For FileSystemTest.RemoveDirectoriesNoExePerm, in order to allow
traversing the directory which has just been made non-executable, i.e.
non-searchable, so that it can be deleted, the test first sets its
permissions to all_perms. However, all_perms is not just the
user/group/owner read/write/execute bits, it also includes the
set-user-ID, set-group-ID and sticky bits. Since the directory on
FreeBSD has a group of wheel, any users not in the wheel group cannot
set the set-group-ID bit, so this will fail with EPERM, leaving the
directory non-executable, and the following removal will fail, due to
the foo child not being searchable, and then the test harness cleanup
[15 lines not shown]
[CIR] Implement initial flattening of cleanup scopes with EH (#182636)
This implements flattening of cir.cleanup_scope operations that require
exception handling. Calls within the cleanup scope body that may throw
an exception are replaced by cir.try_call operations that unwind to an
exception handling block that executes the operations in the cleanup
scope's cleanup region and then unwinds to the caller using a cir.resume
operation.
If the cleanup scope is nested within a try operation, the flattening of
the try op will be responsible for updating the resume operation to flow
through its dispatch block. However, that is not yet implemented, so
only the case of a try op with no handlers is accepted after this PR.
Flattening of cleanup scopes that require exception handling nested
within other cleanup scopes is not yet implemented.
Substantial amounts of this PR were created using agentic AI tools, but
I have carefully reviewed the code, comments, and tests and made changes
as needed.
[NFC][VPlan] Add initial tests for future VPlan-based stride MV
I tried to include both the features that current
LoopAccessAnalysis-based transformation supports (e.g., trunc/sext of
stride) but also cases where the current implementation behaves poorly,
e.g., https://godbolt.org/z/h31c3zKxK; as well as some other potentially
interesting scenarios I could imagine.
devel/abseil: fix __is_trivially_relocatable warnings with clang 21
With clang 21 ports using devel/abseil will run into warnings similar
to:
In file included from /usr/local/include/absl/strings/string_view.h:40:
In file included from /usr/local/include/absl/base/nullability.h:154:
In file included from /usr/local/include/absl/base/internal/nullability_impl.h:23:
/usr/local/include/absl/meta/type_traits.h:527:22: warning: builtin __is_trivially_relocatable is deprecated; use __builtin_is_cpp_trivially_relocatable instead [-Wdeprecated-builtins]
527 | (__is_trivially_relocatable(T) &&
| ^
/usr/local/include/absl/meta/type_traits.h:527:22: warning: builtin __is_trivially_relocatable is deprecated; use __builtin_is_cpp_trivially_relocatable instead [-Wdeprecated-builtins]
/usr/local/include/absl/meta/type_traits.h:147:24: note: in instantiation of template class 'absl::is_trivially_relocatable<absl::str_format_internal::FormatArgImpl>' requested here
147 | : std::conditional<T::value, conjunction<Ts...>, T>::type {};
| ^
Upstream abseil fixed this in
<https://github.com/abseil/abseil-cpp/commit/a4950fb>, so pull it in as
a patch.
[6 lines not shown]
devel/abseil: fix __is_trivially_relocatable warnings with clang 21
With clang 21 ports using devel/abseil will run into warnings similar
to:
In file included from /usr/local/include/absl/strings/string_view.h:40:
In file included from /usr/local/include/absl/base/nullability.h:154:
In file included from /usr/local/include/absl/base/internal/nullability_impl.h:23:
/usr/local/include/absl/meta/type_traits.h:527:22: warning: builtin __is_trivially_relocatable is deprecated; use __builtin_is_cpp_trivially_relocatable instead [-Wdeprecated-builtins]
527 | (__is_trivially_relocatable(T) &&
| ^
/usr/local/include/absl/meta/type_traits.h:527:22: warning: builtin __is_trivially_relocatable is deprecated; use __builtin_is_cpp_trivially_relocatable instead [-Wdeprecated-builtins]
/usr/local/include/absl/meta/type_traits.h:147:24: note: in instantiation of template class 'absl::is_trivially_relocatable<absl::str_format_internal::FormatArgImpl>' requested here
147 | : std::conditional<T::value, conjunction<Ts...>, T>::type {};
| ^
Upstream abseil fixed this in
<https://github.com/abseil/abseil-cpp/commit/a4950fb>, so pull it in as
a patch.
[4 lines not shown]