[InstCombine] Move sext(trunc(lshr(...))) combine before same type combine
The same type sext(trunc(...)) combine will fire on the lshr case, but the lshr produces one less shift. Move it afterwards to give the lshr combine a chance to fire first. Fixes the motivating x264 case
[lld][MachO] Support Objective-C class selector stubs
Support Objective-C class selector stubs in lld's Mach-O backend.
This consumes the class-stub symbols emitted by Clang in [ObjC] Emit class
msgSend stub calls (#186433), using the form
`_objc_msgSendClass$<selector>$_OBJC_CLASS_$_<class>`.
Class stubs load the class object into `x0`, load the selector into `x1`, and
branch to `_objc_msgSend`. Local class symbols are materialized directly with
`adrp`/`add`; dylib or dynamic class symbols are loaded indirectly.
The implementation also tracks the resolved class symbol before dead stripping
so live class stubs can retain the needed class definition without keeping dead
dylib references alive.
[RISCV] Ensure Shadow Stack checks correct RA (#226309)
This primarliy applies to the save-restore case, which was using
`__riscv_restore_<N>` incorrectly, entirely circumventing the software
shadow call stack.
This fix keeps the code size improvements of `__riscv_save_<N>` when
there is a shadow call stack, but it avoids the incorrect use of
`__riscv_restore_<N>`, instead emitting the correct sequence inline.
In the future, when there are better versions of `__riscv_save_<N>` and
`__riscv_restore_<N>` which support the shadow call stack variants (both
hardware and software), then we can revisit this approach and use the
correct pairs in all cases.
WebAssembly: Take the exception model from the module flag
The WebAssembly EH passes chose whether and how to run from
MCAsmInfo::getExceptionHandlingType() and TargetOptions::ExceptionModel,
A module that asked for Wasm EH through the module flag alone would have
its invokes rewritten by LowerInvoke before WasmEHPrepare ran.
Schedule the passes unconditionally and read the module flag inside the
passes instead. Passes for other models can noop on the models they are
not intended for.
Co-authored-by: Claude Opus 5 <noreply at anthropic.com>
[CIR][CodeGen][NFC] Share isEmptyFieldForLayout and isEmptyRecordForLayout (#223424)
Deduplicates `isEmptyFieldForLayout` and `isEmptyRecordForLayout` between CIR
and classic CodeGen into a new `RecordLayoutUtils.h`. The 25 callers now name
them as `CodeGenUtils::isEmptyFieldForLayout` and
`CodeGenUtils::isEmptyRecordForLayout`, like the other shared helpers.
Assisted-by: Claude Code (Claude Fable 5.1).
[alpha.webkit.NoDeleteChecker] Handle CXXStdInitializerListExpr in trivial analysis (#224723)
TrivialFunctionAnalysisVisitor had no handler for
CXXStdInitializerListExpr, so a braced list bound to a
std::initializer_list fell through to VisitStmt and was conservatively
treated as non-trivial. This made any nodelete function containing e.g.
std::min({a, b, c}) report that it "contains code that could destruct an
object".
The backing array of a std::initializer_list is a temporary whose
lifetime ends in the enclosing function, so its elements really are
destructed there. Accept the node when the array's element type is
trivially destructible and recurse into the initializers, and keep
rejecting it otherwise.
[SLP]Vectorize aggregates of bit packs as a single vector
An insertvalue aggregate built of or-packs of zero-extended fields (e.g.
the { i64, i64 } returned for std::array<int16_t, 8>) was vectorized
pack by pack, leaving the vectors half as wide as possible. Vectorize
the fields of all packs as one tree and bitcast the result to the vector
of the packs.
Fixes #48223
Assisted-by: Cursor
Reviewers: bababuck, RKSimon
Pull Request: https://github.com/llvm/llvm-project/pull/228955
[SLP]Keep dbg_value of the lanes replaced by extractelement
Redirect the debug values of an erased scalar to the extract emitted for
its external user. A record placed before the extract is cloned right
after it, unless that passes a record of the same variable. Lanes
without external users still lose their debug values.
Part of #45507.
Assisted-by: Cursor
Reviewers: RKSimon, bababuck
Pull Request: https://github.com/llvm/llvm-project/pull/228937
[SLP]Keep dbg_value of the lanes replaced by extractelement
Redirect the debug values of an erased scalar to the extract emitted for
its external user. A record placed before the extract is cloned right
after it, unless that passes a record of the same variable. Lanes
without external users still lose their debug values.
Part of #45507.
Assisted-by: Cursor
Reviewers: RKSimon, bababuck
Pull Request: https://github.com/llvm/llvm-project/pull/228937
[libclc][test] Fix a regression in libclc/test/work-item/get_group_id.cl (#228621)
Add a missing noundef in libclc/test/work-item/get_group_id.cl from a
recent commit.
Fixes: 552ea17e0a93 ([ValueTracking] Handle zext/sext in
computeConstantRange (#227726), 2026-09-30)
[CIR][CodeGen][NFC] Share the Itanium __pbase_type_info flags and predicates (#228187)
Deduplicates the `__pbase_type_info` flags, `containsIncompleteClassType` and
`extractPBaseFlags` between CIR and classic CodeGen into `ItaniumCXXABIUtils.h`.
Re-landing #223422, which Erich Keane approved; its merge went into the parent
branch of the stack instead of main.
Assisted-by: Claude Code (Claude Fable 5.1).
[DWARFLinker] Unset TF_SkipPC for children in debug map (#228612)
If a subprogram is not in the debug map, then we add the `TF_SkipPC`
flag as before to omit `DW_AT_low_pc` from the dwarf. But if it is in
the input map, then we want to retain `DW_AT_low_pc` by removing the
`TF_SkipPC` flag. This makes a difference when the parent already has
`TF_SkipPC`, which is propagated to its children.
Interestingly, this does not seem to be an issue for the parallel
linker.
LLM assisted
[webkit.UncountedLambdaCapturesChecker] Treat call_once arguments as noescape (#224492)
call_once does not store the lambda in heap so consider all its
arguments as noescape.