[flang] Reject INTENT on non-pointer dummy procedure (#240042)
### Summary
Fix missing semantic diagnostic for INTENT on non-pointer dummy
procedures. The existing check only covered `ProcEntityDetails`, missing
procedures represented by `SubprogramDetails`. Moved the validation to
the shared `CheckHelper::Check()` path to ensure consistent enforcement
across both representations, with regression tests added.
Fixes #229220.
---------
Co-authored-by: Jay Satish Kumar Patel <kumarpat at pe31.hpc.amslabs.hpecorp.net>
Co-authored-by: Copilot <223556219+Copilot at users.noreply.github.com>
[MC] Fold CFI advance_loc when applicable. NFC (#245130)
In many cases both labels are in the fixed part of a fragment without
linker relaxation. We should fold the advance_loc to save space and
time.
https://reviews.llvm.org/D150004 removed a fast path because it folded
deltas across linker-relaxable instructions. `absoluteSymbolDiff` now
rejects such fragments.
[libc][FPUtil] Make hardware helpers usable in constant expressions (#242283)
## Summary
Part of #195623 (split 1/2). Makes the `FPUtil` hardware helpers usable
in constant expressions, which is the foundation the shared math
functions build on in #242285.
## What this PR does
- Guards the hardware/intrinsic paths in `FEnvImpl`, `sqrt`, `FMA`,
`nearest_integer`, and `multiply_add` behind `is_constant_evaluated()`,
so they fall through to the generic implementation during constant
evaluation while still using the hardware path at runtime.
- Applies this across all supported architectures: aarch64, arm,
hexagon, riscv, and x86_64.
## Compatibility
[10 lines not shown]
[mlir][Affine] Fix crash in loopUnrollUpToFactor on zero-trip loops (#245019)
When the constant trip count was lower than the unroll factor,
loopUnrollUpToFactor clamped the factor to the trip count. For a
zero-trip loop (e.g. `affine.for %i = 0 to 0`) this called
loopUnrollByFactor with factor 0 and tripped its "unroll factor should
be positive" assertion. Return early for zero-trip loops as
loopUnrollFull does, since there is nothing to unroll. Fixes #220458.
Assisted-by: MiMo-V2.6-Pro
[MC] Change section group name from Twine to StringRef. NFC (#245125)
str() conversions are expensive. All but one caller
(MCObjectFileInfo::getPseudoProbeDescSection) pass a StringRef. Take a
StringRef.
Coroutines: Only invalidate analyses of lowered functions in CoroCleanup
CoroCleanupPass already invalidates the analyses of the functions it
lowers, but then reported no preserved analyses, which clears every
cached function.
Also stop preserving CFG analyses for lowered functions, since noop
coroutine elision can change the CFG.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[MC] Hash section names once in recordELFMergeableSectionInfo. NFC (#245122)
Key both ELFSeenGenericMergeableSections and ELFEntrySizeMap by
CachedHashStringRef so that hash lookups don't need to recompute the
section name hash. ELFSeenGenericmergeableSections contains most
sections and the long C++ mangled names are expensive.
RuntimeLibcalls: Add SME attributes to the AArch64 SME support routines
SMEAttrs currently assumes these attributes based on the function
name. Add them to the function definition so this code can be cleaned
up in the future.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[orc-rt] Add DlfcnLoaderAdapter. (#245120)
DlfcnLoaderAdapter simplifies exposing an ORC runtime loader through the
dlfcn.h APIs. Subclasses implement dlopen, dlclose, dlsym, and dladdr in
terms of their underlying loader, reporting failures with Error and
Expected as usual in the ORC runtime. The adapter takes care of
translating those results into dlfcn.h's error-reporting scheme: each
failure returns the operation's POSIX failure value, and its message is
made available to the calling thread through dlerror. Failures are also
logged, under a new LoaderAPIs logging category.
JIT'd code reaches an adapter through C entry points
(orc_rt_DlfcnLoaderAdapter_*) and an instance symbol,
orc_rt_DlfcnLoaderAdapter_Instance, which the adapter adds to a symbol
table supplied by its creator. The creator publishes that table to the
session once the whole loader system has been constructed.
Supporting changes:
- orc-rt-c/bedrock/sys/posix/dlfcn-types.h provides orc_rt_Dl_info and
[6 lines not shown]
LowerTypeTests: Only invalidate analyses of modified functions in SimplifyTypeTests
SimplifyTypeTests tried to preserve the CFG analyses, but did not
preserve the function analysis manager proxy, so all function analyses
were invalidated.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Add attributes to __arm_sc_memcpy, memmove and memset
The streaming-compatible variants behave like memcpy, memmove and
memset. Omit captures(none) since these can be used to implement volatile
memory intrinsics.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
build.sh: retry the Pi device-tree downloads (#688)
Run 45103400295's Server rpi5 image failed because
raw.githubusercontent.com answered one of the eight BCM2712 device-tree
downloads (bcm2712d0-rpi-5-b.dtb) with "Service Unavailable"; build.sh
made a single attempt per file, so one transient error failed the job.
The Desktop rpi5 job fetched the same files a minute earlier without
trouble.
Add fetch_retry: up to five tries with a growing wait (5, 10, 15, 20 s),
writing OUT.part and renaming it only on success so a failed try never
leaves a half-written file that a later build would treat as cached. Use
it for the device trees; the existing check that each file starts with
the flattened-device-tree magic stays.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Utils: Preserve function analyses in CanonicalizeAliases and NameAnonGlobals (#244987)
These passes only change aliases and the names of globals, so they do
not need to invalidate any function analyses.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
GlobalSplit: Preserve CFG analyses (#244959)
GlobalSplit only changes global variables, so it does not need to
invalidate every function analysis.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[MC] Allow relocation section to share name with a label (#245121)
We currently reject the new case in reloc-same-name-section.s as
"invalid symbol redefinition" while GAS allows it. Allow it by creating
a MCSectionELF directly with a null `Begin` symbol.
Revert "[SPIR-V] Default to NewPM" (#245119)
Reverts llvm/llvm-project#239489
Breaks https://lab.llvm.org/buildbot/#/builders/225/builds/26922. Looks
like a latent machine code verification bug where the legacy pipeline
wasn't running the machine verifier.
build.sh: retry the Pi device-tree downloads
Run 45103400295's Server rpi5 image failed because
raw.githubusercontent.com answered one of the eight BCM2712 device-tree
downloads (bcm2712d0-rpi-5-b.dtb) with "Service Unavailable"; build.sh
made a single attempt per file, so one transient error failed the job.
The Desktop rpi5 job fetched the same files a minute earlier without
trouble.
Add fetch_retry: up to five tries with a growing wait (5, 10, 15, 20 s),
writing OUT.part and renaming it only on success so a failed try never
leaves a half-written file that a later build would treat as cached. Use
it for the device trees; the existing check that each file starts with
the flattened-device-tree magic stays.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[X86] Skip finishLayout without MCBoundaryAlignFragment. NFC (#245114)
-x86-pad-for-branch-align defaults to true, so `finishLayout` walks
every text section even when branch alignment is disabled. Skip
it in the majority of cases when AllowAutoPadding is false.
Also add a test for -x86-pad-for-branch-align=0, which was uncovered.