[llvm-readobj][ELF] Remove flush from `GNUELFDumper::printField()` (#217602)
This dramatically improves the performance of the dumping of ELF
symbols. For `llvm-readelf -s UE5Demo.elf > symbols.txt`, example time
deltas are:
Windows: ~32s -> ~1s
Linux: ~10s -> ~1s
clang: Emit legacy amdgcn triple in HIP fatbin bundle entries
hardcoding the amdgcn-amd-amdhsa-- prefix in the bundle ID, so
force these to the legacy name regardless of the active triple.
Hopefully clr will stop hardcoding these so we can drop this at
some point.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
TargetMachine: Verify option/module-flag consistency once per module (#217597)
The -target-abi option / "target-abi" module flag conflict was reported
from the per-function getSubtargetImpl in RISCV and LoongArch, so a
module with multiple subtargets would repeatedly diagnose. Introduce a
new TargetMachine method to validate the module for the global options.
I wasn't sure the best place to actually perform this check. This is now
performing it in the earliest pass in codegen, MachineModuleInfo.
MachineModuleInfo is a glorified map from IR to MachineFunction, so I'm
not sure this is the right place. The other alternative I started with was
the AsmPrinter initialization.
Ideally we would eliminate the global options. In particular target-abi
is going to be a bit sticky, because it lives in MCOptions and is thus used
by non-codegen contexts which won't have an IR module to read a flag from.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[flang][Lower] Reassociate sums containing pure calls (#217286)
Part 5/6 of generalisations requested in #207377
Allow pure procedure references to remain opaque terms while splitting
an additive expression. Continue rejecting impure calls and expressions
that reference volatile or asynchronous objects.
There are no known effects on benchmark scores as a result of this
patch.
Assisted-by: Codex
---
<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
Add an optional mechanism, enabled by setting rcorder_cache=YES in
/etc/rc.conf, to precompute and cache the list of rc.d scripts that
will actually result in useful boot-time work. This cached list is
then consulted on subsequent boots to reduce the number of scripts
run during boot. This can have a huge impact on boot time on machines
with slow CPUs and/or highly constrained I/O. On the machine that
inspired this change, it reduced the number of scripts visited during
boot from 130 to 45 and reduced the boot time from 13 minutes to 7.
PR bin/60607
[mlir][acc] Update par_dims format after strict property assembly format (#217643)
This makes the assembly format of par_dims explicit so that it gets
handled similarly to other acc IR and appears before the types.
[MLIR][LLVM] Preserve unknown function metadata on import
Import representable non-debug function metadata without a kind-specific
dialect conversion into `LLVMFuncOp` `function_metadata`. Preserve repeated
metadata kinds through the generic carrier so LLVM IR import and export can
round-trip the supported generic metadata subset.
Warn and drop attachments outside that subset while continuing to import the
function.
[MLIR][LLVM] Translate LLVMFuncOp function metadata
Materialize LLVMFuncOp function_metadata through ModuleTranslation metadata conversion. Attach function metadata after module-level symbols are mapped so metadata references to functions, globals, aliases, and ifuncs can be resolved.
[MLIR][LLVM] Add function metadata to LLVMFuncOp (#203018)
Add a generic LLVM dialect carrier for LLVM IR function metadata on
LLVMFuncOp. Represent attachments as an ordered list so repeated
metadata kinds, such as multiple type metadata attachments, can be
preserved while keeping metadata names language-agnostic.
[AArch64][clang] Use tablegen rather than hard-coded feature dependencies
Refactor AArch64 frontend feature handling so extension relationships come
from the TargetParser extension graph instead of hand-written dependency
code in C++. This makes `llvm::AArch64::ExtensionSet` the source of
truth for dependency expansion while still keeping the short `Has...` names
used in the frontend code.
This removes a large amount of duplicated implication logic from
`handleTargetFeatures` and related feature queries. The frontend now
rebuilds its extension state from TableGen-derived data and then derives
its cached feature state from that, rather than maintaining parallel
dependency rules in C++.
I also preserved several pieces of historical frontend behaviour that are
not represented directly in the extension graph. Explicit disables such as
`no-sme` still win after implied-feature expansion, direct `+fullfp16` and
`+jscvt` still restore the expected NEON-facing state, and SME-family
features no longer incorrectly appear to enable AdvSIMD/NEON.
[4 lines not shown]
[flang] - Call _FortranAAssignSimple instead of _FortranAAssign for intrinsic-type array assignments.
This patch adds support for calling _FortranAAssignSimple, a faster-path for array assignments.
`_FortranAAssignSimple` is called when ALL the following conditions are true:
1. Intrinsic element type (not derived type)
2. Matching ranks (no scalar-to-array broadcasting)
3. Non-volatile
4. Not polymorphic
5. Not explicit-length character
6. Not temporary LHS
Otherwise, uses `_FortranAAssign` (or specialized variants like `_FortranAAssignPolymorphic`, `_FortranAAssignExplicitLengthCharacter`).
This is a (perhaps final) part of the fix for https://github.com/llvm/llvm-project/issues/203915
Reject CHARACTER types in AssignSimple and add death tests
AssignSimple is only intended for trivial intrinsic types (integer, real,
complex, logical). Add a guard that crashes on CHARACTER type input,
matching the existing derived-type guard.
Add death tests covering all five crash paths in AssignSimple: rank
mismatch, element-bytes mismatch, derived type, character type, and
non-allocatable element count mismatch.
Co-Authored-By: Claude Opus 4 (1M context) <noreply at anthropic.com>
[flang-rt] - Lightweight runtime assignment function (AssignSimple) for intrinsic-type assignments.
This PR introduces a lightweight assignment runtime path (`_FortranAAssignSimple`) for intrinsic-type arrays
with the goal of reducing compile-time overhead seen primarily in the form of severly increased time taken by LTO.
This PR includes only the changes to the runtime (flang-rt) and as such just with this PR compile-time improvements
will not be visible.
**Problem**
When compiling Fortran code with OpenMP GPU offload and `firstprivate(allocatable_array)`, LLVM's Attributor creates excessive abstract attributes analyzing complex runtime assignment machinery:
**Symptom:**
- **Test case:** 8-element allocatable integer array with `firstprivate` clause
- **Compile time:** 24.97s (vs 0.78s for `private` - **32x slower**)
- **Root cause:** LLVM Attributor analyzing complex Fortran runtime functions
**Why this happens:**
1. `firstprivate` requires copying arrays from host to device
[43 lines not shown]