LLVM/project 076226flld/ELF SyntheticSections.cpp SyntheticSections.h

[ELF] Separate relative and non-relative dynamic relocations (#187959)

Previously, the flow was:

1. Parallel scan adds relative relocs to per-thread `relocsVec`
2. `mergeRels()` copies all into `relocs`
3. `partitionRels()` uses `stable_partition` to separate

Now, relative relocs are routed at `addReloc` time by checking
`reloc.type == relativeRel`. In `mergeRels`, sharded entries are
classified through the same `addReloc` path rather than blindly
appended. `relocsVec` may contain non-relative entries like
`R_AARCH64_AUTH_RELATIVE`.

This eliminates the `stable_partition` on the full relocation vector
(543K entries for clang) and avoids copying relative relocations into
`relocs` only to move them out again.

Linking an x86_64 release+assertions build of clang is 1.04x as fast.

    [5 lines not shown]
DeltaFile
+26-25lld/ELF/SyntheticSections.cpp
+9-6lld/ELF/SyntheticSections.h
+35-312 files

LLVM/project 5567572clang-tools-extra/clang-tidy/misc NoRecursionCheck.cpp

[clang-tidy][NFC] Remove optimized container implementations in `misc-no-recursion` (#187630)

About half of this check's code is dedicated to implementing a pair of
set containers with optimizations for when the element count is small.
But the check only uses these containers while constructing the warning
message. That's not generally a hot path in any check. Just to confirm,
I ran the check over `clang/lib/Sema/Sema.cpp` and all its included
headers before and after, and saw no performance difference. So, these
containers seem like a false optimization.
DeltaFile
+6-136clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
+6-1361 files

LLVM/project 6dabcefmlir/lib/Dialect/IRDL IRDLLoading.cpp, mlir/python/mlir/dialects ext.py

[MLIR][IRDL][Python] Fix error while composing `irdl.any_of` and `irdl.base` (#187914)

Previously, while users compose `irdl.any_of` and `irdl.base`, e.g.
```mlir
module {
  irdl.dialect @ext_attr_in_op {
    irdl.operation @op_with_attr {
      %0 = irdl.base "#builtin.integer" 
      %1 = irdl.base "#builtin.string" 
      %2 = irdl.any_of(%0, %1) 
      irdl.attributes {"a" = %2}
    }
  }
}
```

The program will crash due to `llvm_unreachable("unknown IRDL
constraint")`.


    [2 lines not shown]
DeltaFile
+41-0mlir/test/python/dialects/ext.py
+35-0mlir/lib/Dialect/IRDL/IRDLLoading.cpp
+8-19mlir/python/mlir/dialects/ext.py
+84-193 files

LLVM/project 7482655clang/lib/AST TemplateBase.cpp

[clang] On Windows, silence warning when building with MSVC (#187937)

This fixes:
```
[2124/7029] Building CXX object tools\clang\lib\AST\CMakeFiles\obj.clangAST.dir\TemplateBase.cpp.obj
C:\git\llvm-project\clang\lib\AST\TemplateBase.cpp(753): warning C4312: 'reinterpret_cast': conversion from 'clang::SourceLocation::UIntTy' to 'clang::TemplateArgumentLocInfo::LocOrPointer' of greater size
```
DeltaFile
+2-2clang/lib/AST/TemplateBase.cpp
+2-21 files

LLVM/project e1286d9mlir/lib/Bytecode/Writer BytecodeWriter.cpp

[mlir] Deterministic containers in BytecodeWriter (#187819)

Iteration over use lists in writeUseListOrders is non-deterministic as a
result of using a DenseMap. Replacing with a Vector-backed `MapVector`
restores deterministic behaviour.
DeltaFile
+2-5mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
+2-51 files

LLVM/project 98f84f9clang-tools-extra/clangd CodeComplete.cpp, clang-tools-extra/clangd/unittests CodeCompleteTests.cpp

[clangd] Code completion for declaration of class method (#165916)

Code completion previously could not tell apart the declaration of
a method from a call to it, and provided call-like behaviour even
in declaration contexts. This included things like not offering 
completion for private methods, and inserting placeholders for
the parameters as though the user was going to fill in arguments.

This patch adds support to Parser and SemaCodeComplete to
detect and provide dedicated behaviour for declaration contexts.
In these contexts, the flag CodeCompletionResult::DeclaringEntity
is set, and createCodeCompletionString() is adjusted to handle this
flag, e.g. by inserting parameter declarations as text chunks rather
than placeholder chunks.

The DeclaringEntity flag is also available for consumers of
SemaCodeComplete, such as clangd, to customize their behaviour.

In addition, the patch tweaks the conditions under which the

    [6 lines not shown]
DeltaFile
+159-55clang/lib/Sema/SemaCodeComplete.cpp
+118-19clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
+40-2clang/include/clang/Parse/Parser.h
+6-4clang/lib/Parse/Parser.cpp
+6-4clang-tools-extra/clangd/CodeComplete.cpp
+6-3clang/include/clang/Sema/SemaCodeCompletion.h
+335-876 files not shown
+350-9812 files

LLVM/project ce288f4mlir/lib/Dialect/XeGPU/Transforms XeGPUSgToWiDistributeExperimental.cpp, mlir/test/Dialect/XeGPU sg-to-wi-experimental-unit.mlir

[MLIR][XeGPU] Add distribution patterns for vector insert & extract ops in sg to wi pass (#184665)

This PR adds patterns for following vector ops in the new sg-to-wi pass
1. ExtractOp
2. ExtractStridedSliceOp
3. InsertStridedSliceOp
4. InsertOp
DeltaFile
+292-2mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp
+199-0mlir/test/Dialect/XeGPU/sg-to-wi-experimental-unit.mlir
+7-1mlir/test/lib/Dialect/XeGPU/TestXeGPUTransforms.cpp
+498-33 files

LLVM/project 8d64f56clang/docs ReleaseNotes.rst, clang/lib/Sema Sema.cpp

[Clang] Honour [[maybe_unused]] on private fields (#187940)

Before this commit, [[maybe_unused]] on private fields was ignored. In
conjunction with `-Wunused-private-field`, false warnings were emitted
by clang. This commit fixes this by checking if an unused private field
is annotated with [[maybe_unused]].
DeltaFile
+11-0clang/test/SemaCXX/warn-maybe-unused-private-field.cpp
+4-0clang/docs/ReleaseNotes.rst
+1-1clang/lib/Sema/Sema.cpp
+16-13 files

LLVM/project b2ba795llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer insert-element-build-vector.ll insert-element-build-vector-inseltpoison.ll

[SLP]Fix patterns for compile time blow up with ordered reductions

Excluded patterns, leading to compile time blow up for integer ordered
reductions.
DeltaFile
+41-119llvm/test/Transforms/SLPVectorizer/insert-element-build-vector.ll
+41-119llvm/test/Transforms/SLPVectorizer/insert-element-build-vector-inseltpoison.ll
+38-2llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+5-5llvm/test/Transforms/SLPVectorizer/X86/reduced-ordered-values-update.ll
+125-2454 files

LLVM/project c079372llvm/lib/Transforms/Vectorize VPlanTransforms.cpp VPlanPatternMatch.h

[VPlan] Add m_VPPhi pattern matcher and use in removeDeadRecipes (NFC).

Add m_VPPhi to match VPPhi instructions with exactly 2 operands.

Split off from https://github.com/llvm/llvm-project/pull/156262.
DeltaFile
+4-4llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+6-0llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h
+10-42 files

LLVM/project 6514822llvm/utils/gn/secondary/clang/lib/ScalableStaticAnalysisFramework/Tool BUILD.gn, llvm/utils/gn/secondary/clang/tools/clang-ssaf-format BUILD.gn

[gn] port a2c0c436999
DeltaFile
+10-0llvm/utils/gn/secondary/clang/lib/ScalableStaticAnalysisFramework/Tool/BUILD.gn
+1-0llvm/utils/gn/secondary/clang/tools/clang-ssaf-format/BUILD.gn
+1-0llvm/utils/gn/secondary/clang/tools/clang-ssaf-linker/BUILD.gn
+12-03 files

LLVM/project 0e7a8acllvm/utils/gn/secondary/clang/lib/ScalableStaticAnalysisFramework/Core BUILD.gn, llvm/utils/gn/secondary/clang/unittests/ScalableStaticAnalysisFramework BUILD.gn

[gn build] Port c6ba0e00161e
DeltaFile
+3-2llvm/utils/gn/secondary/clang/unittests/ScalableStaticAnalysisFramework/BUILD.gn
+3-0llvm/utils/gn/secondary/clang/lib/ScalableStaticAnalysisFramework/Core/BUILD.gn
+6-22 files

LLVM/project c58f322llvm/utils/gn/secondary/llvm/unittests/Target/SPIRV BUILD.gn

[gn build] Port 78729251fbb2
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/unittests/Target/SPIRV/BUILD.gn
+1-01 files

LLVM/project ea489fellvm/benchmarks PointerUnionBM.cpp CMakeLists.txt

[llvm][ADT] Add PointerUnion benchmarks. NFC. (#187874)

Add microbenchmarks for `PointerUnion`'s `isa` and `isNull` operations
across union sizes of 2, 4, and 8 types. This it to establish baseline
performance numbers before making changes to the implementation.

I plan to refactor the implementation a bit and add support for more
variants using sparse encoding.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
DeltaFile
+121-0llvm/benchmarks/PointerUnionBM.cpp
+1-0llvm/benchmarks/CMakeLists.txt
+122-02 files

LLVM/project 6e66da1mlir/include/mlir/Dialect/LLVMIR LLVMIntrinsicOps.td, mlir/test/Dialect/LLVMIR roundtrip.mlir

[mlir][LLVM] Add more `llvm.intr.experimental.constrained.*` ops
DeltaFile
+105-0mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir
+77-0mlir/test/Target/LLVMIR/Import/intrinsic.ll
+67-2mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
+49-0mlir/test/Dialect/LLVMIR/roundtrip.mlir
+298-24 files

LLVM/project ca3d045.github new-prs-labeler.yml

[llubi][Github] Add llubi labelling support (#187877)

So that one can easily subscribe to llubi PRs which are currently not
labelled at all.
DeltaFile
+6-0.github/new-prs-labeler.yml
+6-01 files

LLVM/project 45039dfclang/unittests/Analysis CFGBackEdgesTest.cpp

[clang] On Windows, silence warning in `CFGBackEdgesTest` with MSVC (#187939)

This fixes:
```
[5804/7029] Building CXX object tools\clang\unittests\CMakeFiles\AllClangUnitTests.dir\Analysis\CFGBackEdgesTest.cpp.obj
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\xutility(721): warning C4018: '>': signed/unsigned mismatch
...
C:\git\llvm-project\clang\unittests\Analysis\CFGBackEdgesTest.cpp(170): note: see the first reference to 'testing::internal::PredicateFormatterFromMatcher<testing::internal::SizeIsMatcher<testing::internal::GtMatcher<int>>>::operator ()' in 'clang::analysis::`anonymous-namespace'::CFGBackEdgesTest_WhileWithContinueLoop_Test::TestBody'
```
DeltaFile
+1-1clang/unittests/Analysis/CFGBackEdgesTest.cpp
+1-11 files

LLVM/project 33a14cbllvm/lib/Target/RISCV RISCVMoveMerger.cpp, llvm/test/CodeGen/RISCV rv32-move-merge-crash.ll

[RISCV] Add guard to prevent GPRPair merge on targets without Zdinx or P (#186600)

Resolves #186527.

The issue points out that GPRPair merge logic in the RISCVMoveMerger
pass was being called on a target without `zdinx` or `experimental-P`,
triggering an unreachable in `getGPRPairCopyOpcode`.

This patch fixes this issue by guarding `isEvenRegisterCopy` and
`isOddRegisterCopy` to return false when neither Zdinx nor P is present.
DeltaFile
+82-0llvm/test/CodeGen/RISCV/rv32-move-merge-crash.ll
+10-6llvm/lib/Target/RISCV/RISCVMoveMerger.cpp
+92-62 files

LLVM/project 88f830allvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 deleted-inst-reduction-attempt.ll

[SLP]Do not try to reduced instruction, marked for deletion in previous attempts

Need to skip instructions, which were vectorized and marked for deletion
to prevent a compiler crash
DeltaFile
+59-0llvm/test/Transforms/SLPVectorizer/X86/deleted-inst-reduction-attempt.ll
+2-0llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+61-02 files

LLVM/project 34bc5d5clang/test/Misc noexecstack.c, clang/tools/driver cc1as_main.cpp

[MC,clang] Fix -Wa,--noexecstack not emitting .note.GNU-stack (#187880)

AsmPrinter (clang -c a.c) and AsmParser (clang -c a.s, llvm-mc
-filetype=obj a.s) have different ways to emit .note.GNU-stack section.

913c5b4d1fff removed a redundant initSections call from cc1as, but
that was the only place where NoExecStack was consumed for the
assembler path.

Unify the .note.GNU-stack emission in MCELFStreamer::finishImpl,
making the `initSections` parameter redundant.

Add a -filetype=obj test for Solaris (see
https://reviews.llvm.org/D159179), which doesn't use .note.GNU-stack

`initSections` has 20+ uses. The parameter cleanup will be deferred to a
subsequent change.

Fixes https://github.com/llvm/llvm-project/issues/186004
DeltaFile
+22-0clang/test/Misc/noexecstack.c
+0-17llvm/test/MC/ELF/noexec.s
+11-4llvm/lib/MC/MCELFStreamer.cpp
+11-0llvm/test/MC/ELF/noexecstack.s
+2-6llvm/tools/llvm-mc/llvm-mc.cpp
+1-0clang/tools/driver/cc1as_main.cpp
+47-276 files

LLVM/project cfefc82llvm/lib/Support CMakeLists.txt

fix support on windows
DeltaFile
+9-0llvm/lib/Support/CMakeLists.txt
+9-01 files

LLVM/project 2566961clang-tools-extra/clang-tidy/bugprone UseAfterMoveCheck.cpp, clang-tools-extra/docs ReleaseNotes.rst

[clang-tidy] use-after-move: Support null_after_move annotations (#186903)

Extend the bugprone-use-after-move check to recognize user defined
smart-pointer-like types that make guarantees on the state of a
moved-from object, leaving it in a valid and specified state that
matches the standard smart pointer's moved-from state (nullptr), where
it is safe to use but not dereference.

Following the RFC discussion:

* Use `[[clang::annotate]]` to mark the types.
* Use an schema for the `[[clang::annotate]]` annotation and arguments
to help avoid conflicts with other users of the attribute.
* The annotation will identify the tool ("clang-tidy") and the arguments
the plugin ("bugprone-use-after-move"), and the behavior of the type
("null_after_move"). E.g.:

`[[clang::annotate("clang-tidy", "bugprone-use-after-move",
"null_after_move")]]`

    [2 lines not shown]
DeltaFile
+101-0clang-tools-extra/test/clang-tidy/checkers/bugprone/use-after-move.cpp
+39-4clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp
+9-4clang-tools-extra/docs/ReleaseNotes.rst
+5-2clang-tools-extra/docs/clang-tidy/checks/bugprone/use-after-move.rst
+154-104 files

LLVM/project 1248f3aclang/lib/ScalableStaticAnalysisFramework/Core CMakeLists.txt

fix AnalysisRegistry
DeltaFile
+5-0clang/lib/ScalableStaticAnalysisFramework/Core/CMakeLists.txt
+5-01 files

LLVM/project 88b81cbflang/lib/Optimizer/HLFIR/Transforms CMakeLists.txt, flang/lib/Optimizer/Transforms CMakeLists.txt

fix build errors
DeltaFile
+11-0flang/lib/Optimizer/Transforms/CMakeLists.txt
+10-0flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt
+21-02 files

LLVM/project a344f0dclang-tools-extra/clangd/fuzzer CMakeLists.txt

LLVMFuzzerTestOneInput
DeltaFile
+3-0clang-tools-extra/clangd/fuzzer/CMakeLists.txt
+3-01 files

LLVM/project dda24c9. benchmark_build.sh

Change iteration count from 10 to 2
DeltaFile
+1-1benchmark_build.sh
+1-11 files

LLVM/project 2175d1f. benchmark_build.sh

normalize script
DeltaFile
+10-81benchmark_build.sh
+10-811 files

LLVM/project 60a7f7f. benchmark_build.sh

measure memory too
DeltaFile
+44-20benchmark_build.sh
+44-201 files

LLVM/project 62565b5. benchmark_build.sh

measure memory too
DeltaFile
+13-39benchmark_build.sh
+13-391 files

LLVM/project 4bed1c6. benchmark_build.sh

use time
DeltaFile
+29-10benchmark_build.sh
+29-101 files