[libc++][ranges][test-suite][NFC] Consistency improvements after P3050 merge (#213062)
Consistency improvements and other small tweaks.
A follow-up to https://github.com/llvm/llvm-project/pull/193891 - the
changes were deferred to reduce the size of an already large and
approved PR.
[clang][llvm][AArch64] Set hardening fn attrs on synthetic functions (#211013)
Compiler-synthesized functions such as `__llvm_gcov_writeout`,
`__llvm_gcov_reset` and `__llvm_gcov_init` were previously never
receiving the AArch64 hardening function attributes (ptrauth-returns,
ptrauth-auth-traps, ptrauth-indirect-gotos and
aarch64-jump-table-hardening) since the attributes were only emitted by
Clang and gated by `PointerAuthOptions` structure's corresponding
fields. See `setPointerAuthFnAttributes` and
`initPointerAuthFnAttributes` member functions of `TargetCodeGenInfo`.
This patch resolves this in the same manner as #83153 does for several
other attributes. Particularly, Clang now emits corresponding 4 module
flags (conditionally on whether the related feature is enabled) with Max
behavior, and LLVM's `Function::createWithDefaultAttr` derives the
matching function attributes from them. Max behavior with conditional
emission is safe because none of these features affect ABI, so promoting
an absent flag on module merge cannot break compatibility.
[CIR] Implement fenv lowering to constrained intrinsic calls (#213105)
This change adds support for lowering floating-point operations with the
fenv attribute set to a call to the corresponding constrained intrinsic
when the operation is lowered to the LLVM dialect.
Generation of operations with the Fenv attribute set will be implemented
in a later change. This only adds support for lowering.
Assisted-by: Cursor / claude-opus-4.8
cmake: Derive CMake system name from a triple via new mechanism
This is a reimplementation of the cmake functionality first implemented in
6e4e181c83, which has now been reverted twice. Implement the raw cmake functionality
without introducing the uses yet.
The runtimes build needs to translate the build target (configured with a target
triple) to cmake's naming scheme, to use for CMAKE_SYSTEM_NAME. Use the OS/environment
list from TargetParser as the source of truth; add an additional entry for the
cmake name to ensure the build system and compiler always recognize the same set
of names.
Upgrade the previous cmake regexes to a new python script which parses the
authoritative def file. The new script logic should match Triple::normalize's
permissiveness for various legacy and malformed triple shapes. This should be
more maintainable than the previous cmake regexes, since there's now a unit test
mirroring the triple unit test.
Co-Authored-By: Claude (Opus 4.8) <noreply at anthropic.com>
[TableGen] Use DenseMap in getValueType instead of StringSwitch (#213229)
StringSwitch is linear.
getValueType gets called often, identified by callgrind to be
responsible for 11% of the executed instructions for NVPTX
-gen-dag-isel.
With DenseMap or StringMap, NVPTX and RISCV -gen-dag-isel runs 20% and
15% faster respectively.
Modest 2-6% improvement for others.
DAG: Skip poison elements in BUILD_VECTOR computeKnownBits
This defends against regressions in future patches. Copies the logic
from the IR version of computeKnownBits's handling of ConstantVector.
I'm not sure why the IR version doesn't directly return a value for poison,
but this follows suit.
Co-authored-by: Claude (Claude-Opus-4.8)
Reapply "Make result variables obey their dynamic values in subsequent expressions" (#211321) (#213308)
This adds back the patch that makes result variables retain their
dynamic type when you use them in subsequent expressions or fetch their
SBValues.
This reverts commit e1af868257eb4a49db9149cc239ca9b9338d6419.
The first time I submitted this I had some flakey tests, but when I
fixed the accounting for synthetic children those went away. But the
patch was still failing in a set of ObjC tests on x86_64. Those failures
weren't caused by this patch, but rather uncovered a bug in Tagged
Pointer detection, which I fixed in:
https://github.com/llvm/llvm-project/pull/213163
[flang][debug] Add compressed DWARF support in Flang (#212584)
Re-use most of the clang implementation for compressed DWARF support in
flang.
AI attribution: Co-developed with Claude Opus 4.6
AMDGPU/GlobalISel: Switch more FP opcodes to extended LLTs (part 3) (#213135)
Migrate trigonometric, division, remainder, multiply-add, and min/max
opcodes to extended floating-point LLTs.
Remove redundant scalar clamps that request unsupported f128-to-f64
narrowing, while retaining required f16-to-f32 widening.
Also update the relevant MIR tests.
[offload][lit] Re-enable olCreateProgram JIT test on AMDGPU (#213321)
Should be passing now.
Context: https://github.com/llvm/llvm-project/pull/213149
Signed-off-by: Nick Sarnie <nick.sarnie at intel.com>
rc.d/bthidd: Correct load_kld invocations
Pass a single module name to load_kld for kbdmux and vkbd, allowing
bthidd_prestart to load both modules successfully.
Fixes: cfe1962a1925 (rc: Fix improper use of load_kld)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
rc.d/bthidd: Correct load_kld invocations
Pass a single module name to load_kld for kbdmux and vkbd, allowing
bthidd_prestart to load both modules successfully.
Fixes: cfe1962a1925 (rc: Fix improper use of load_kld)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
[mlir][acc] Introduce ACCToLLVM and executable directive codegen (#213165)
Adds initial infrastructure for converting the acc dialect to LLVM,
specifically around generating libacctarget runtime calls. The current
libacctarget APIs are not yet finalized, but the draft proposal can be
found at https://github.com/llvm/llvm-project/pull/197894. This PR adds
codegen for acc init, shutdown, set, and wait.
[SPARC] Add patterns for i64->i32 and i64->i16 BSWAP-STOREs (#210483)
The lack of those is causing instruction selection to fail.
Also, for completeness, add variants of extending/truncating ops for
LOAD-BSWAP pairs too.
[IR] Remove deprecated typed-pointer creation APIs (#212812)
Removes `PointerType::get(Type*, unsigned)`,
`PointerType::getUnqual(Type*)`, and `Type::getPointerTo(unsigned)`, the
last typed-pointer-creation leftovers from the opaque pointers
migration. All three have been marked deprecated for a while and have no
remaining in-tree callers; every caller already uses the
LLVMContext-taking overloads.
Co-authored-by: Claude <noreply at anthropic.com>
linuxkpi: Add xa_insert_irq wrapper
This just invokes xa_insert similar to other xa_*_irq wrappers.
Reviewed by: bz
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D58576
linuxkpi: Add xa_insert_irq wrapper
This just invokes xa_insert similar to other xa_*_irq wrappers.
Reviewed by: bz
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D58576
kld: Reject kernel modules with PT_LOAD segments where filesz > memsz
All sorts of places in the ELF loading code assume that filesz <=
memsz, so check that explicitly up front.
Reported by: Jane Smith <thebugfixers at pm.me> (via D57785)
Reviewed by: jrtc27, kib
Differential Revision: https://reviews.freebsd.org/D58542
kld: Reject kernel modules with PT_LOAD segments where filesz > memsz
All sorts of places in the ELF loading code assume that filesz <=
memsz, so check that explicitly up front.
Reported by: Jane Smith <thebugfixers at pm.me> (via D57785)
Reviewed by: jrtc27, kib
Differential Revision: https://reviews.freebsd.org/D58542