[LLVMABI][AARCH64] Enable ABI library for all AArch64 targets (#217119)
This change updates the checks for enabling the LLVM ABI library on
AArch64 so that it is now enabled for Windows, aarch64_32, and
aarch64_be.
When I set the initial restrictions, I wasn't aware that these other
variants would be handled by the same ABI classification object with
only minor adjustments needed.
Assisted-by: Cursor / Grok 4.5 (test generation)
[HLSL] Add Texture2DMS (#211972)
Fixes https://github.com/llvm/llvm-project/issues/194933 and
https://github.com/llvm/llvm-project/issues/194955
This PR implements codegen for the IsMultiSampled resource attribute as
well as the new `Texture2DMS` type.
The codegen for the IsMultiSampled resource type implements the
`__builtin_hlsl_resource_load_ms` builtin.
The Texture2DMS type uses `__builtin_hlsl_resource_load_ms` instead of
`__builtin_hlsl_resource_load_level` for the `.Load()` method.
Unlike other HLSL resources, `Texture2DMS` takes an additional,
optional, `sample_count` template parameter.
The sample count is a non-type template parameter, so the resource
handle type `HLSLAttributedResourceType` now takes part in template
instantiation and lowers to the `dx.MSTexture` sample-count operand. A
sample count of 0 means the count comes from the bound resource at
runtime.
[15 lines not shown]
[flang][cuda] Route dynamic autos through malloc_unified/free_unified (#212965)
Example:
```fortran
subroutine work(n)
integer :: n
real :: a(n)
call compute(a)
end subroutine
```
In this code, `a` is an automatic array placed on the stack. Under
`-gpu=mem:unified|managed` it must come from the unified/managed
allocator
entry points instead. Renaming every host malloc/free in the module
would be
unsafe: `fir.freemem` also releases buffers the Fortran runtime
allocated with
libc malloc (transformational intrinsic results, polymorphic
[11 lines not shown]
AMDGPU: Only disassemble .amdhsa_reserve_xnack_mask on xnack targets (#212789)
The disassembler unconditionally printed .amdhsa_reserve_xnack_mask when
emitting a kernel descriptor. Targets that do not support xnack have no
xnack mask to reserve, and the assembler streamer already only emits the
directive when the subtarget supports xnack. Match that behavior in the
disassembler so the round-trip is consistent and gfx11/gfx12 descriptors
no longer carry a spurious directive.
As a guard against a malformed binary, if the object's ELF e_flags
erroneously select xnack "on" for a target that does not support xnack,
still print the directive so the invalid state remains visible in the
disassembly rather than being silently dropped.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
Stop treating an empty catalog as a valid catalog
## Problem
`get_trains()` returns an empty mapping when `catalog.json` is missing or unparseable, nothing prevents that from being cached for 25 hours, and the cache-hit test only asked whether the entry was `not None` — so an empty dict was served back as a legitimate hit. Every reader then reads "no catalog data" as "nothing to update": apps report `upgrade_available=false` with a null `latest_version`, `upgrade_summary` refuses to upgrade any app, Discover shows nothing, and the sync job reports SUCCESS while deleting `CatalogSyncFailed`, `CatalogNotHealthy` and `AppUpdate` — a false all-clear that nothing re-derives. The cache lives on tmpfs, so a poisoned entry survives a middlewared restart and only clears on reboot. The missing-`catalog.json` case logged nothing at all.
The cache key encoded only the catalog label, while the catalog location flips between the apps dataset and a tmpfs path depending on whether that dataset is mounted. `catalog.sync` and `catalog.apps` resolve the location independently, so a mount-state change between them lets a read be served data that was written for the other location.
## Solution
- **Never cache a non-answer.** `catalog.apps` only writes the cache when it actually parsed trains, and an empty entry it finds on the way in is popped so an already-affected system recovers without a reboot.
- **Fail the sync loudly.** Reading no trains at all now raises inside `sync()`, so the existing handler raises `CatalogSyncFailedAlert` and the job fails instead of publishing "no apps" as a healthy catalog. `catalog.synced` stays false, which finally makes it mean what it says.
- **Only clear the health alert on evidence.** `CatalogNotHealthy` was deleted before the trains were read, so a broken catalog dismissed the alert describing its own breakage. The delete now happens beside the create, after a successful read of every train.
- **Don't delete the update alert on no evidence.** `update_app_upgrade_alert` abstains when no catalog data is available, rather than reading "every app reports no upgrade" as proof that nothing needs updating. `upgrade_summary` says the catalog data is unavailable instead of claiming no upgrade exists.
- **Key the cache by location** so data written against one location is never served for the other.
- **Bound the git operations.** The clone/pull/reset/checkout/status calls had no timeout, so a wedged `git` held the repository lock and blocked every later sync.
Also removes the unused `image_updates_available` parameter from `upgrade_available_for_app()`. It was never passed by either call site, and the equivalent override in `list_apps()` is the one that actually runs. The two are not interchangeable: an ix-app is a catalog app, so the version comparison inside the helper answers first and would hide a pending image update. The new tests pin that behaviour so the parameter is not "fixed" by wiring it up.
[lldb] Consume the located result by rvalue reference (NFC) (#217667)
FinishSearch consumes the Expected it is handed, either taking the error
out of it or moving what the search found into the binary spec, and its
caller already hands over ownership with an explicit move. Taking it by
value move constructs 1.5 kB for nothing, where the signature can say
the same thing and copy nothing.
Reported by Coverity (CID 1685297).
Assisted-by: Claude
clang: Emit legacy amdgcn triple in HIP fatbin bundle entries (#217640)
Unfortunate the HIP runtime is hardcoding the amdgcn-amd-amdhsa--
prefix in the bundle ID checks, 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>
[clang][dataflow] Handle when `this` refers to a different location (#146900)
When `this` is under a CXXDefaultInitExpr it could refer to the location
of an InitListExpr object instead of the `this` of a member function.
E.g.:
```
struct S {
int x;
int y = this->x;
};
struct R {
int foo() {
// `this` for `a` refers to an R, but `this`
// for `x` refers to an S.
return S{this->a}.y;
}
int a;
};
```
[2 lines not shown]
clang: Emit "target-abi" module flag for ARM
Previously only RISCV emitted the "target-abi" module flag.
We probably should just generally emit this for non-empty ABI names
but that's a broader behavior change. I'm also confused because the
clang side defines a non-empty value for many targets with no apparent
use in llvm.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[GISel] Hold IRTranslatorImpl rather than recreating (#217440)
`IRTranslatorImpl` holds some state/data structures that are expensive
to fully recreate for each MF, so put it into a unique_ptr so we can use
a common implementation. Forward declare `IRTranslatorImpl` and define
constructors/operators in the source file so we can avoid needing to put
the definition of `IRTranslatorImpl` inside of `IRTranslator.h`. This
seems to resolve the performance regression observed in #216915.
https://llvm-compile-time-tracker.com/compare.php?from=9932f190f42e1a12c3cafea23938241abf6337ca&to=394a782c063f55377188044296c5911db45c9a38&stat=instructions:u
LLM assisted.
clang: Use the context printing policy in TemplateDiff (#217651)
TemplateDiff made a new PrintingPolicy instead of using ASTContext's.
Sema::getPrintingPolicy() tweaks ASTContext's, and sema template diffing
didn't pick up those changes.
Sema::getPrintingPolicy() does two things:
1. Something for bool vs _Bool for C (where template diffing doesn't
apply)
2. Set EntireContentsOfLargeArray to false
Before this patch, the latter had no effect in diff mode, meaning we the
same type printed differently in a diagnostic depending on if used
template diffing. Now they're consistent.
(This made no difference before https://reviews.llvm.org/D115031, which
probably just forgot to update this call site.)
[clang][test] Fix misspelled FileCheck prefix in static-init-3.cpp (#217628)
`clang/test/CodeGenCXX/static-init-3.cpp` uses `FileCheck %s` (prefix
`CHECK`) but the second instance line was `// CHECJ:`. That prefix is
undefined, so the check never ran.
Fixes one of the misspelled prefixes listed in #94108.
Assisted-by: Grok (xAI)
Revert "[flang][FIRToSCF] Recompute a typed induction variable in closed form (#217051)" (#217654)
This reverts commit de79344abe04cab8fe538cdd0f975f78d941cd24.
This caused regressions in some internal tests, so reverting for now.
[libsycl] Fix debug build error caused by RTTI option mismatch (#210997)
Fixes an undefined reference to typeinfo for `llvm::ErrorInfoBase`
during a debug build of libsycl.