LLVM/project be1d8d4llvm/lib/Target/AArch64 AArch64ISelLowering.cpp, llvm/test/CodeGen/AArch64 cttz-of-bool-vector-bitcast.ll

[AArch64] Lower cttz(bitcast <Nxi1> to iN) with shrn-based compressed movemask (#199081)

The existing lowering in vectorToScalarBitmask() creates a 1 bit per
lane movemask using a powers of 2 reduction (and+addv with a constant
pool entry).

This patch adds a DAG combine on ISD::CTTZ that recognizes cttz(bitcast
<N x i1> to iN) and produces a compressed movemask with shrn (for i8
lanes) or xtn (for wider lanes) then runs scalar cttz on a 64- or
128-bit value. Dividing by bits per lane gives the lane index.

Supports lane counts {2, 4, 8, 16, 32} (one or two NEON registers)

For the example in the issue (`<16 x i8> -> i16`):

Before:
```asm
adrp x8, .LCPI0_0
cmlt v0.16b, v0.16b, #0

    [34 lines not shown]
DeltaFile
+940-0llvm/test/CodeGen/AArch64/cttz-of-bool-vector-bitcast.ll
+132-0llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+1,072-02 files

LLVM/project 604db5fcompiler-rt/lib/profile InstrProfilingPlatformROCm.cpp

[PGO][HIP][NFC] Fix hipModuleGetGlobal -Wunused-function warning (#207293)

The functions trigger the warning on Windows (without elf.h) and is
fatal under -Werror.
Fix by adding [[maybe_unused]]. Alternatively it could be moved inside
the existing __has_include(<elf.h>) block,; however that would trigger
-Wunused-but-set-global on pHipModuleGetGlobal.
Current fix is minimal and can be removed once hipModuleGetGlobal is
supported without elf.h.
DeltaFile
+1-0compiler-rt/lib/profile/InstrProfilingPlatformROCm.cpp
+1-01 files

LLVM/project 247a272clang/lib/Sema SemaDecl.cpp, clang/test/SemaCXX injected-class-name-crash.cpp

[clang] fix redeclarations of the injected class name

The declaration used to represent an injected class name should never
be part of any redeclaration chain.

This is a regression since Clang 22, and this will be backported, so no release notes.

Fixes #202320
DeltaFile
+14-11clang/lib/Sema/SemaDecl.cpp
+7-0clang/test/SemaCXX/injected-class-name-crash.cpp
+21-112 files

LLVM/project d7cd957clang-tools-extra/clangd ModulesBuilder.cpp Preamble.cpp, clang-tools-extra/clangd/unittests PrerequisiteModulesTest.cpp

[clangd] Invalidate preamble when new module imports are added (#199460)

When using `SkipPreambleBuild`, adding a new `import` statement to a
file did
not invalidate the existing preamble because `isPreambleCompatible` only
checked whether existing prerequisite modules were up-to-date, not
whether
the set of required modules itself had changed.

Fixes: #199389
Partially addresses: #126350
DeltaFile
+56-0clang-tools-extra/clangd/unittests/PrerequisiteModulesTest.cpp
+24-0clang-tools-extra/clangd/ModulesBuilder.cpp
+16-1clang-tools-extra/clangd/Preamble.cpp
+7-0clang-tools-extra/clangd/ModulesBuilder.h
+103-14 files

LLVM/project 9d103e0llvm/lib/FileCheck FileCheckImpl.h

Rename printVariables to printVariableDefAttempts
DeltaFile
+2-2llvm/lib/FileCheck/FileCheckImpl.h
+2-21 files

LLVM/project c9c7b8allvm/lib/FileCheck FileCheck.cpp

Rename printVariables to printVariableDefAttempts
DeltaFile
+4-4llvm/lib/FileCheck/FileCheck.cpp
+4-41 files

LLVM/project b3d0b1fflang-rt/include/flang-rt/runtime allocator-registry.h

[flang-rt] Use posix_memalign instead of std::aligned_alloc (#207248)

MallocWrapper called std::aligned_alloc for over-aligned requests, but
that C11 function is only available on macOS 10.15 and newer. flang-rt
builds with a Darwin deployment target of 10.7 (set in
AddFlangRT.cmake), so the build failed under
-Werror=unguarded-availability-new.

Use posix_memalign instead, as it is available on all supported POSIX
targets.
DeltaFile
+14-2flang-rt/include/flang-rt/runtime/allocator-registry.h
+14-21 files

LLVM/project a4b1846llvm/docs MergeFunctions.md Vectorizers.md, llvm/docs/Frontend PerformanceTips.md

[docs] Rewrite 20 selected rst LLVM docs to Markdown (#205923)

Tracking issue: https://github.com/llvm/llvm-project/issues/201242
Migration guide docs:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
RFC:
https://discourse.llvm.org/t/rfc-make-myst-markdown-the-llvm-docs-format-rip-rest/90840
DeltaFile
+224-250llvm/docs/MergeFunctions.md
+227-241llvm/docs/Vectorizers.md
+191-243llvm/docs/MyFirstTypoFix.md
+166-204llvm/docs/MemProf.md
+152-195llvm/docs/Frontend/PerformanceTips.md
+147-154llvm/docs/AdvancedBuilds.md
+1,107-1,28715 files not shown
+2,174-2,45221 files

LLVM/project 20a60c5llvm/docs MergeFunctions.md MergeFunctions.rst

[docs] Rename 20 selected rst docs to Markdown (#205921)

Tracking issue: https://github.com/llvm/llvm-project/issues/201242
Migration guide docs:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
RFC:
https://discourse.llvm.org/t/rfc-make-myst-markdown-the-llvm-docs-format-rip-rest/90840

This may break the doc build, but it will be fixed in a follow-up.
DeltaFile
+785-0llvm/docs/MergeFunctions.md
+0-785llvm/docs/MergeFunctions.rst
+0-522llvm/docs/MyFirstTypoFix.rst
+522-0llvm/docs/MyFirstTypoFix.md
+0-511llvm/docs/Vectorizers.rst
+511-0llvm/docs/Vectorizers.md
+1,818-1,81837 files not shown
+5,461-5,46143 files

LLVM/project 1ed13f9.github CODEOWNERS

Fix CODEOWNERS error, remove Lanza from ClangIR owners

The github project reports:
Unknown owner on line 39: make sure <name> exists and has write access to the repository

I assume Nathan's commit access lapsed and he has the `triage` role now.

I added a comment saying he is an emeritus owner. This is reversible,
and I assume if he needs or wants write access, we can revisit this in
the future.
DeltaFile
+5-3.github/CODEOWNERS
+5-31 files

LLVM/project ab6058allvm/docs LangRef.md

[docs] Rewrite LangRef.md as Markdown
DeltaFile
+14,672-17,477llvm/docs/LangRef.md
+14,672-17,4771 files

LLVM/project d619174llvm/docs LangRef.md

Migrate 11 tables back from list-table to regular markdown tables
DeltaFile
+80-202llvm/docs/LangRef.md
+80-2021 files

LLVM/project ad38f51.github new-prs-labeler.yml, llvm/docs LangRef.md LangRef.rst

[docs] Rename LangRef.{rst|md}

Tracking issue: #201242

This commit does not use valid markdown, so the docs will not build, but they will be fixed in an immediate follow-up commit that does the migration.
DeltaFile
+33,180-0llvm/docs/LangRef.md
+0-33,180llvm/docs/LangRef.rst
+1-1.github/new-prs-labeler.yml
+1-1llvm/docs/AddingConstrainedIntrinsics.rst
+33,182-33,1824 files

LLVM/project c3b744bclang/lib/CIR/CodeGen CIRGenBuiltinX86.cpp, clang/test/CIR/CodeGen builtins-x86.c

[clang][CIR]: X86 movnti/movntsd/movntss CIR implementation. (#206388)

### Implements X86 CIR codegen builtins:

- __builtin_ia32_movnti
- __builtin_ia32_movnti64
- __builtin_ia32_movntsd
- __builtin_ia32_movntss

Folow the original codegen architecture lowering to movntss call.

Towards #167765.
DeltaFile
+31-3clang/test/CIR/CodeGen/builtins-x86.c
+18-0clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp
+49-32 files

LLVM/project 5302608offload/plugins-nextgen/common/src GlobalHandler.cpp

[Offload] Guard __llvm_write_custom_profile null check on non-Windows (#207170)

On Windows __llvm_write_custom_profile is defined as a strong stub (MSVC
lacks proper weak symbol support) by 09a51b2818e2, so its address is a
compile-time constant that is never null. The `if
(!__llvm_write_custom_profile)` check therefore triggers
-Wpointer-bool-conversion, which is fatal under -Werror.

Assisted-by: Claude
DeltaFile
+4-0offload/plugins-nextgen/common/src/GlobalHandler.cpp
+4-01 files

LLVM/project b1e2dd3llvm/docs MergeFunctions.md HowToCrossCompileLLVM.md

[docs] Finish MyST migration for selected docs
DeltaFile
+117-120llvm/docs/MergeFunctions.md
+96-96llvm/docs/HowToCrossCompileLLVM.md
+19-20llvm/docs/MyFirstTypoFix.md
+22-16llvm/docs/Vectorizers.md
+14-15llvm/docs/HowToBuildWithPGO.md
+13-10llvm/docs/CycleTerminology.md
+281-27712 files not shown
+331-34318 files

LLVM/project 3d3ca2allvm/docs MergeFunctions.md MergeFunctions.rst

[docs] Rename selected rst docs to Markdown
DeltaFile
+785-0llvm/docs/MergeFunctions.md
+0-785llvm/docs/MergeFunctions.rst
+522-0llvm/docs/MyFirstTypoFix.md
+0-522llvm/docs/MyFirstTypoFix.rst
+511-0llvm/docs/Vectorizers.md
+0-511llvm/docs/Vectorizers.rst
+1,818-1,81837 files not shown
+5,461-5,46143 files

LLVM/project f7abd23llvm/docs MergeFunctions.md MyFirstTypoFix.md, llvm/docs/Frontend PerformanceTips.md

[docs] Convert selected rst docs with rst2myst
DeltaFile
+279-302llvm/docs/MergeFunctions.md
+194-245llvm/docs/MyFirstTypoFix.md
+208-228llvm/docs/Vectorizers.md
+166-203llvm/docs/MemProf.md
+153-195llvm/docs/Frontend/PerformanceTips.md
+154-153llvm/docs/AdvancedBuilds.md
+1,154-1,32614 files not shown
+2,225-2,49120 files

LLVM/project 7b11c7cclang/lib/AST ExprConstant.cpp, clang/lib/AST/ByteCode InterpBuiltin.cpp Interp.h

[Clang] Fix offsetof sign-extending unsigned array indices >= 128 (#204139)

When evaluating __builtin_offsetof with an unsigned integer array index
(e.g. uint8_t, uint16_t) whose value has the high bit set, Clang was
calling getSExtValue() on the APSInt index, which sign-extends the value
and produces a large bogus offset.

Fix this to use the correct kind of extension to extend smaller values, and to check for overflow in conversions of larger values.

Fixes #199319

AI Tool Use: GitHub Copilot (Claude Sonnet 4.6) was used to assist in
identifying the root cause of the bug in ExprConstant.cpp and drafting
the fix. The fix was reviewed, tested, and validated manually.
DeltaFile
+56-0clang/test/Sema/offsetof-unsigned-index.c
+17-1clang/lib/AST/ByteCode/InterpBuiltin.cpp
+13-1clang/lib/AST/ExprConstant.cpp
+13-0clang/lib/AST/ByteCode/Interp.h
+10-0clang/lib/AST/ByteCode/Opcodes.td
+7-0clang/lib/AST/ByteCode/Compiler.cpp
+116-22 files not shown
+121-28 files

LLVM/project 475f4e8bolt/lib/Core DIEBuilder.cpp BinaryContext.cpp

[BOLT] Stop materializing .dwo DIE vectors early in the pipeline

Summary: preprocessDWODebugInfo() eagerly force-extracted every .dwo
compile unit's DIE tree (getNonSkeletonUnitDIE(false)) very early in
BOLT pipeline, way before DWARFRewriter kicked in. Those vectors then
sit in memory throughout the entire rewrite pipeline, directly
contributing to BOLT's RSS peak. I did a fair amount of digging and
didn't find any reason as to why we need to keep all DIEs of DWO CU
materialized at all, since DWARFRewriter won't even read this vector
(the #197359 concurrency fix did use that, but that is unnecessary).
The problem is that these DIE trees are a massive contribution to RSS
when processing large binaries where we have 10s of K of dwos, storing
complete trees for each processed dwo.

This diff changes the #197359 concurrency fix to not rely on the DIE
sibling/children structure. It parses DWP type units selectively per
compile unit (DIEBuilder::buildDWPTypeUnitsForUnit ->
collectReferencedTypeSignatures) by finding the DW_FORM_ref_sig8
references in a unit's DIEs to decide which type units belong in that

    [23 lines not shown]
DeltaFile
+19-17bolt/lib/Core/DIEBuilder.cpp
+8-8bolt/lib/Core/BinaryContext.cpp
+27-252 files

LLVM/project 879f762bolt/include/bolt/Core BinaryFunction.h BinaryContext.h, bolt/lib/Core BinaryContext.cpp BinaryFunction.cpp

[BOLT] Fix shifted DWARF inline-scope ranges; track scope boundaries

Summary:
BOLT updated DWARF lexical-scope ranges (DW_TAG_inlined_subroutine /
lexical_block low_pc/high_pc and DW_AT_ranges) via
translateInputToOutputRange(), which mapped a boundary using its input
offset relative to the start of the containing basic block:

  OutAddr = BB.getOutputAddressRange().first + (InputOffset - BB.getOffset())

This assumes intra-block byte offsets are preserved input->output. Any
pass that changes instruction sizes within a block ahead of a scope
boundary breaks that assumption. With --plt=all, each `call foo at PLT`
(5 bytes, e8+rel32) is rewritten to `call *foo at GOT(%rip)` (6 bytes,
ff 15+rel32); N such calls before a boundary shift its emitted low_pc/
high_pc N bytes too early, onto the preceding instruction. The range
stays within the parent so `llvm-dwarfdump --verify` does not catch it;
symbolizers then attribute samples on those instructions to the wrong
inlined frames.

    [43 lines not shown]
DeltaFile
+614-0bolt/test/X86/dwarf-inline-range-plt-shift.s
+81-0bolt/lib/Core/BinaryContext.cpp
+54-4bolt/include/bolt/Core/BinaryFunction.h
+42-12bolt/lib/Core/BinaryFunction.cpp
+5-10bolt/include/bolt/Core/BinaryContext.h
+14-0bolt/lib/Rewrite/RewriteInstance.cpp
+810-261 files not shown
+814-287 files

LLVM/project c2b50a1llvm/test/CodeGen/RISCV determine-callee-saves-gpr.mir

[CodeGen] Add tests for `determineCalleeSaves`. (#204855)
DeltaFile
+1,283-0llvm/test/CodeGen/RISCV/determine-callee-saves-gpr.mir
+1,283-01 files

LLVM/project b7623f5llvm/test/Transforms/LoopVectorize/AArch64 reduction-recurrence-costs-sve.ll partial-reduce-dot-product-neon.ll, llvm/test/Transforms/LoopVectorize/RISCV gather-scatter-cost.ll

[VPlan] Strip early-bail in noalias-check (#203936)

canHoistOrSinkWithNoAliasCheck currently bails eagerly when the
candidate memory location doesn't have a scope. This is unnecessary,
because the alias check automatically handles this: stripping this check
allows us to run the loop, which would never get to the alias check if
none of the recipes write to memory. The end result is that a read-only
FirstBB to LastBB ranges are determined not to alias with anything, even
if the scope metadata is absent, leading to licm-load-store
improvements.
DeltaFile
+306-107llvm/test/Transforms/LoopVectorize/AArch64/reduction-recurrence-costs-sve.ll
+43-81llvm/test/Transforms/LoopVectorize/RISCV/gather-scatter-cost.ll
+60-60llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product-neon.ll
+57-15llvm/test/Transforms/LoopVectorize/X86/cost-model-i386.ll
+39-23llvm/test/Transforms/LoopVectorize/X86/replicating-load-store-costs.ll
+30-30llvm/test/Transforms/LoopVectorize/AArch64/pr60831-sve-inv-store-crash.ll
+535-31632 files not shown
+759-54338 files

LLVM/project e8c4e99llvm/lib/Transforms/Vectorize VPlan.h, llvm/unittests/Transforms/Vectorize VPlanTest.cpp

[VPlan] Strip secondary SIVSteps constructor (NFC) (#207193)

Migrate the only use-site in unit-test to use the canonical constructor.
DeltaFile
+2-12llvm/lib/Transforms/Vectorize/VPlan.h
+1-2llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
+3-142 files

LLVM/project 7be1887llvm/lib/Transforms/Vectorize VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize/VPlan expand-scev.ll

[VPlan] Don't preserve NSW in mul -> shl conversion for bw-1 op. (#207280)

When the shift amount is bitwidth - 1, shl nsw would be poison, while
mul nsw is defined. Don't preserve the flag.

https://alive2.llvm.org/ce/z/NgHU_m

Fixes https://github.com/llvm/llvm-project/issues/205252.
DeltaFile
+9-3llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+1-1llvm/test/Transforms/LoopVectorize/VPlan/expand-scev.ll
+10-42 files

LLVM/project 11576callvm/lib/Analysis ConstantFolding.cpp, llvm/test/Transforms/InstSimplify/ConstProp saturating-add-sub.ll

[ConstFold] Eliminate some undef-folding (#207184)

The patch is merely a cleanup, with no real-world impact: undef-folding
is no longer useful these days.
DeltaFile
+12-12llvm/test/Transforms/InstSimplify/ConstProp/saturating-add-sub.ll
+0-7llvm/lib/Analysis/ConstantFolding.cpp
+12-192 files

LLVM/project 9a896c3lldb/include/lldb/Target Target.h, lldb/source/Breakpoint BreakpointResolver.cpp

Add a pre-filter to the breakpoint resolver overrides (#198845)

That way if an override only wants to override, say, file and line
breakpoints, it can say that when it registers itself, and we won't do
the work of creating the resolver and checking with it if the breakpoint
wasn't of the requested type.

---------

Co-authored-by: Jonas Devlieghere <jonas at devlieghere.com>
DeltaFile
+185-44lldb/test/API/functionalities/breakpoint/scripted_bkpt/overrides_resolver/TestOverridesResolver.py
+62-1lldb/test/API/functionalities/breakpoint/scripted_bkpt/overrides_resolver/bkpt_resolver.py
+44-11lldb/source/Target/Target.cpp
+51-0lldb/source/Breakpoint/BreakpointResolver.cpp
+15-14lldb/include/lldb/Target/Target.h
+19-2lldb/source/Commands/CommandObjectBreakpoint.cpp
+376-727 files not shown
+428-7813 files

LLVM/project 130d6c3clang/test/CXX/drs cwg3088.cpp cwg30xx.cpp, clang/www cxx_dr_status.html

[clang] Add test for CWG3088 about macros defining special identifiers (#189309)

This PR adds a test for
[CWG3088](https://cplusplus.github.io/CWG/issues/3088.html) "Clarify
macro treatment of identifiers with special meaning".

[[cpp.replace.general] paragraph
9](https://eel.is/c++draft/cpp.replace.general#9) reads as follows:
> A translation unit shall not `#define` or `#undef` macro names
lexically identical to keywords, to the identifiers listed in Table
[4](https://eel.is/c++draft/lex.name#tab:lex.name.special), or to the
[_attribute-token_](https://eel.is/c++draft/dcl.attr.grammar#nt:attribute-token)s
described in [[dcl.attr]](https://eel.is/c++draft/dcl.attr), except that
the macro names `likely` and `unlikely` may be defined as function-like
macros and may be
undefined[.](https://eel.is/c++draft/cpp.replace.general#9.sentence-1)
>
> [Note [1](https://eel.is/c++draft/cpp.replace.general#note-1): An
alternative token ([[lex.digraph]](https://eel.is/c++draft/lex.digraph))

    [20 lines not shown]
DeltaFile
+623-0clang/test/CXX/drs/cwg3088.cpp
+2-0clang/test/CXX/drs/cwg30xx.cpp
+1-1clang/www/cxx_dr_status.html
+626-13 files

LLVM/project abe1aeellvm/test/Transforms/LoopVectorize/VPlan expand-scev.ll

[LV] Add test showing incorrect nsw flag on shl. (NFC) (#207242)

Add test for https://github.com/llvm/llvm-project/issues/205252
DeltaFile
+34-0llvm/test/Transforms/LoopVectorize/VPlan/expand-scev.ll
+34-01 files

LLVM/project e1d11a6clang/lib/Sema SemaDeclCXX.cpp, clang/test/SemaTemplate ctad.cpp

[clang] fix crash-on-invalid with deduction guides (#207263)

Fix crash when a template template parameter specialization is used as a
deduced type.

This is a regression since Clang 22, and this will be backported, so no
release notes.

Fixes #203261
DeltaFile
+17-0clang/test/SemaTemplate/ctad.cpp
+4-3clang/lib/Sema/SemaDeclCXX.cpp
+21-32 files