[TableGen] Add OPC_EmitIntegerByHwMode0 and OPC_CheckChildXTypeByHwMode0. NFC (#182686)
Add versions of these opcodes that implicitly call getValueTypeForHwMode
with index 0.
This reduces llc size by ~100K.
[clang][diagnostics] Refactor `warn_doc_function_method_decl_mismatch` to use enum_select (#181769)
Related: https://github.com/llvm/llvm-project/issues/123121
This patch refactors the `warn_doc_function_method_decl_mismatch`
diagnostic to use `enum_select` instead of `select`. This gets rid of
magic numbers in its caller and improves readability.
[LLVM][ADT] Add some more `starts_with`, `ends_with`, and `contains` overloads to `SmallString` (#182692)
This makes `SmallString` consistent with `std::string`,
`std::string_view`, and `StringRef`.
[ELF] Add target-specific relocation scanning for ARM (#182440)
Implement ARM::scanSectionImpl, following the pattern established for
AArch64 and other targets. This merges the getRelExpr and TLS handling
for SHF_ALLOC sections into the target-specific scanner, enabling
devirtualization and eliminating abstraction overhead.
- Inline relocation classification into scanSectionImpl with a switch
on relocation type, replacing the generic rs.scan() path.
- Use processR_PC/processR_PLT_PC for common PC-relative and PLT
relocations.
- Handle TLS inline: checkTlsLe for TLS LE, handleTlsIe<false> for
TLS IE (no IE-to-LE optimization for ARM), and direct flag/reloc
emission for TLS GD/LD (no GD/LD optimization for ARM).
- Set hasGotOffRel for R_GOTREL/R_GOTONLY_PC relocations.
- Simplify getRelExpr to only handle relocations needed by
relocateNonAlloc and preprocessRelocs.
[flang][NFC] Converted five tests from old lowering to new lowering (part 19) (#182554)
Tests converted from test/Lower/forall: forall-construct-4.f90,
forall-construct.f90, forall-ranked.f90, forall-slice.f90,
forall-stmt.f90
[lldb][Process/FreeBSDKernel] Print unread message buffer on start (#178027)
This is equivalent of kgdb_dmesg() in fbsd-kvm.c in FreeBSD kgdb(1)
port. Unread kernel messages is only printed in interactive mode (i.e.
not in batch mode) to mimic KGDB's behaviour.
Example output:
```
➜ sudo ./build/bin/lldb /boot/kernel/kernel -c /var/crash/vmcore.last
(lldb) target create "/boot/kernel/kernel" --core "/var/crash/vmcore.last"
Unread portion of the kernel message buffer:
panic: kdb_sysctl_panic
cpuid = 1
time = 1769364579
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01b435fa20
vpanic() at vpanic+0x136/frame 0xfffffe01b435fb50
panic() at panic+0x43/frame 0xfffffe01b435fbb0
[16 lines not shown]
[llvm-mca][Darwin] Fix crash on .subsections_via_symbols in asm input (#182694)
## Summary
This PR fixes an llvm-mca crash on Darwin assembly containing
`.subsections_via_symbols`. The directive is forwarded by
`DarwinAsmParser` to `emitSubsectionsViaSymbols()`, which crashes when
it hits the base `MCStreamer` `llvm_unreachable` path. The fix adds a
no-op override in `llvm/tools/llvm-mca/CodeRegionGenerator.h`, scoped to
llvm-mca only
## Problem manifestation
I ran across this while tinkering around with making an interactive
interpreter/code analyzer and implementing apple silicon support.
## Root cause
- `DarwinAsmParser::parseDirectiveSubsectionsViaSymbols` calls
[77 lines not shown]
[SelectionDAG] Emit error instead of asserting for unsupported FP_EXTEND (#182660)
Replace the assertion failure in
`DAGTypeLegalizer::SoftenFloatRes_FP_EXTEND` with a user-friendly error
when no libcall is available for the requested
Fix
Replace the `assert` with an `emitError` call that reports the
unsupported
conversion gracefully and returns a poison value
Fixes: #182449
[BOLT] Always place new PT_LOAD after existing ones (#182642)
Insert new PT_LOAD segments right after the last existing PT_LOAD in the
program header table, instead of before PT_DYNAMIC or at the end. This
maintains the ascending p_vaddr order required by the ELF specification.
Previously, new segments could end up breaking PT_LOAD p_vaddr order
when PT_LOAD segments followed PT_DYNAMIC or PT_GNU_STACK. This lead to
runtime loader incorrectly assessing dynamic object size and silently
corrupting memory.
[clang-format] Add per-operator granularity for BreakBinaryOperations (#181051)
## Summary
Extend `BreakBinaryOperations` to accept a structured YAML configuration
with per-operator break rules and minimum chain length gating via
`PerOperator`.
- **Per-operator rules**: specify break style (`Never`, `OnePerLine`,
`RespectPrecedence`) for specific operator groups
- **Minimum chain length**: only trigger breaking when a chain has N or
more operators
- **Fully backward-compatible**: the simple scalar form
(`BreakBinaryOperations: OnePerLine`) behaves identically to the current
enum value
RFC discussion:
https://discourse.llvm.org/t/rfc-per-operator-granularity-for-breakbinaryoperations/89800
[30 lines not shown]
[profcheck][CVP] Adding 'unknown' branch weights for `urem` expansion in CVP (#180637)
This change ensures that !prof metadata is preserved and scaled
appropriately when the `CorrelatedValuePropagation` (CVP) pass expands
an expensive `urem` instruction into a sequence of `icmp`, `select`, and
`sub`.
In the RP, we add the `unknown`(50/50) branch weights for the new
`select` based on the original instruction's profile data.
Co-authored-by: Jin Huang <jingold at google.com>