[SimpleLoopUnswitch] Allow trivial unswitch when exit LCSSA is a header PHI (#222962)
Trivial unswitch bails on a common loop shape: a loop-invariant branch
in the header that exits the loop returning a loop-carried value.
```
int acc = 0;
for (...) {
if (c)
return acc;
acc++;
}
```
After loop-rotate the `if` sits in the header, and the exit reads the
header PHI `%acc`. Trivial unswitch hoists the branch into the
preheader, so the exit value must be available there. It only accepts
loop-invariant values, and `%acc` is not one, so it gives up. But `%acc`
is safe here: the branch is invariant, so if the loop exits it exits on
[10 lines not shown]
[flang][cuda] Record implicit pinned attribution in module files
Under -gpu=mem:pinned an unattributed ALLOCATABLE is attributed as pinned by
the compiler, the same way -gpu=mem:managed attributes one as managed, but
only the latter recorded that it had done so. The module file therefore spelled
an implicitly applied PINNED the same as one the user wrote, and a reader
treated it as a user requirement: adding -gpu=mem:pinned to a module's build
rejected its OpenACC-only consumers over an attribute the user never wrote.
Record the attribution for pinned as well, so it is written as
PINNED(IMPLICIT) and consumers can tell the two apart.
[orc-rt] Fix unit test. (#225299)
Use !! to convert EPI to bool, and ExecutorProcessInfo::pageSize() to
get the page size (ExecutorProcessInfo::PageSize is private).
[libomp] OpenMP 6.0 Device-Scope Environment Variables (#197191)
The patch introduces `_ALL` `_DEV` `_DEV_<id>` env var suffixes to the
LLVM's OpenMP host runtime `libomp`. The eligible-list env var currently
supports `OMP_NUM_THREADS`.
Assisted by Claude Opus 4.7 / Claude 4.6 Sonnet
[Clang][OpenMP] Delay `collapse/ordered` nest walk until instantiation (#225052)
Do not fold `collapse` and `ordered` counts in `checkOpenMPLoop` until
the expression is no longer instantiation-dependent.
Clause parsing already waits. The loop walker did not. A count like
`sizeof(sizeof(T() + T()))` was folded in the template, so Clang could
walk the wrong number of loops before instantiation.
[RISCV] Add assembler support for the Qualcomm Xqccmi vendor extension (#225119)
This patch adds support for assembling and disassembling the Qualcomm
Xqccmi 16-bit Instruction Lookup Table vendor extension. The extension
has a single `qc.cm.ilut` instruction which executes one or two
instructions from an instruction lookup table. The encoding overlaps
with `c.fld`, making `Xqccmi` and `Zcd` mutually exclusive.
The extension also adds two CSR's `qc.itba` and `qc.itdec` that contain
the lookup table base address and the leading double entries count
respectively.
Spec:
https://github.com/qualcomm/riscv-unified-db/releases#release-Xqccmi-0.2.0
Assisted by gpt-5.6-luna.
[ORC] Mangle MachOUnwindInfoRegistrar CI names as C (#225278)
Flip the MachOUnwindInfoRegistrar register/deregister-sections
descriptors from Verbatim to C, so their names carry the target's C
mangling. Served in-tree by UnwindInfoManager (via mangledCopy of the
same specs) and resolved by UnwindInfoRegistrationPlugin through the
same specs, so both sides stay in sync; nothing else defines them.
[ORC] Mangle SharedMemoryMapper CI names as C (#225277)
Flip the SharedMemoryMapper descriptors (instance +
reserve/initialize/deinitialize/release) from Verbatim to C, so their
names carry the target's C mangling. Served by the in-tree
ExecutorSharedMemoryMapperService; controller and executor mangle the
same specs and nothing else defines these names.
[ORC] Mangle GDBJITRegistrar alloc-action CI names as C (#225275)
Flip RegisterJITLoaderGDBAllocActionName and its deregister counterpart
from Verbatim to C, so their names carry the target's C mangling. The
register action is served in-tree by llvm_orc_registerJITLoaderGDBAlloc-
Action (DefaultHostBootstrapValues, via mangledCopy of the same spec)
and resolved by the debugger-support plugins through the same spec, so
both sides stay in sync.
[PAC][ELF] Support R_AARCH64_AUTH_TLSDESC_CALL relocation (#198327)
The R_AARCH64_AUTH_TLSDESC_CALL is introduced to allow linker relaxation
of AUTH TLSDESC call sequences for non-preemptible undefined weak
symbols.
The lld patch introducing the relaxation: #194636
Corresponding ARM docs PR:
https://github.com/ARM-software/abi-aa/pull/395
[ABI] Add IndirectAliased kind to abi::ArgInfo (#225005)
Changes:
- Mirror `clang::CodeGen::ABIArgInfo::IndirectAliased:` an indirect
argument whose pointer may alias an object referenced elsewhere and is
never byval.
- Add the kind, a `getIndirectAliased` factory, an `isIndirectAliased`
predicate, and widens the indirect align/addrspace/realign accessors to
both kinds.
- Add unit tests in FunctionInfoTest.
Relates to : https://github.com/llvm/llvm-project/issues/220471
Assisted by: claude opsu 4.8
[LTO] Add PassBuilderCallback to Config (#224896)
This allows LTO backend to register PassBuilder extension point
callbacks, mirroring the existing PreCodeGenPassesHook.
[ABI] Hoist isSingleElementStruct into TargetInfo and fix array reduction (#224994)
Changes:
- Move `isSingleElementStruct` from `X86_64TargetInfo` into the shared
`TargetInfo` base so other targets can reuse it, and restore the
`isAggregateTypeForABI` guard from classic CodeGen so a multi-element
array field no longer reduces (e.g. struct { short a[2]; } stays i32
instead of [2 x i16]).
- Add unit tests for the reduction in to new test file `TargetInfoTest`.
Relates to : https://github.com/llvm/llvm-project/issues/220471
Assisted by: claude opus 4.8
[RISCV][MC] Prioritize features in MultiMismatchFallback (#215737)
Add the `PrioritizeFeatureInMultipleNearMisses` AsmParser option and
enable it for RISCV.
When an instruction has both missing features and multiple invalid
operands, prioritize the feature entry when populating `MultiMismatchFallback` so
that diagnostics identify the missing extension.
Keep the existing `MultiMismatchFallback` behavior unchanged for targets
that do not enable the option.
This change was assisted by AI.
[Option] Remove OPTTABLE_STR_TABLE_CODE (#224822)
Its two users read OptionStrTable to spell an option. The unittest now
compares option IDs. lldb prepends '-' to the name it reads, which has
been the prefixed name since 501f92d34382 (2023), so it passes
"--mmacos-version-min=<ver>", which the driver rejects and drops; spell
it with the driver option table instead.
Aided by Opus 5