LLVM/project e26c371llvm/include/llvm/Support BranchProbability.h, llvm/lib/Support BranchProbability.cpp

[LoopPeel] Fix BFI when peeling last iteration without guard

LoopPeel sometimes proves that, when reached, the original loop always
executes at least two iterations.  LoopPeel then unconditionally
executes both the remaining loop's initial iteration and the peeled
final iteration.  But that increases the latter's frequency above its
frequency in the original loop.  To maintain the total frequency, this
patch compensates by decreasing the remaininng loop's latch
probability.

The is another step in issue #135812 and was discussed at
<https://github.com/llvm/llvm-project/pull/166858#discussion_r2528968542>.
DeltaFile
+87-0llvm/test/Transforms/LoopUnroll/branch-weights-freq/peel-last-iteration-no-guard.ll
+27-2llvm/lib/Transforms/Utils/LoopPeel.cpp
+3-6llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
+5-0llvm/lib/Support/BranchProbability.cpp
+3-0llvm/include/llvm/Support/BranchProbability.h
+125-85 files

LLVM/project 5ed26adllvm/utils/gn/secondary/llvm/lib/Target/AArch64 BUILD.gn, llvm/utils/gn/secondary/llvm/lib/Target/AArch64/Utils BUILD.gn

[gn build] Port 17408f70d1bf
DeltaFile
+1-4llvm/utils/gn/secondary/llvm/lib/Target/AArch64/Utils/BUILD.gn
+1-0llvm/utils/gn/secondary/llvm/lib/Target/AArch64/BUILD.gn
+2-42 files

LLVM/project 17408f7llvm/lib/Target/AArch64 AArch64SMEAttributes.h AArch64SMEAttributes.cpp, llvm/lib/Target/AArch64/GISel AArch64CallLowering.cpp

[AArch64] Move AArch64SMEAttributes out of Utils library to fix layering. NFC (#168236)

The AArch64 MCTargetDesc library links the Utils library. The
AArch64SMEAttributes.cpp/h requires the Core library and includes files
from AArch64's CodeGen library. These are layering violations.

The MCTargetDesc doesn't need anything from AArch64SMEAttributes.cpp/h
so the easiest fix is to move them to the CodeGen library.

We should probably merge the remaining files in Utils into MCTargetDesc.
DeltaFile
+0-221llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.h
+221-0llvm/lib/Target/AArch64/AArch64SMEAttributes.h
+0-145llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.cpp
+145-0llvm/lib/Target/AArch64/AArch64SMEAttributes.cpp
+1-1llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+1-1llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
+368-3689 files not shown
+376-37715 files

LLVM/project 62e590dpolly/lib/Support RegisterPasses.cpp

Silence unused warning
DeltaFile
+0-16polly/lib/Support/RegisterPasses.cpp
+0-161 files

LLVM/project edbf9e4mlir/lib/Dialect/Bufferization/Transforms OneShotAnalysis.cpp

[mlir] Remove a redundant cast (NFC) (#168241)

llvm::all_of already returns bool.

Identified with readability-redundant-casting.
DeltaFile
+1-1mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp
+1-11 files

LLVM/project 019e90fllvm/include/llvm/ADT DenseMap.h

[ADT] Group public functions in DenseMap.h (NFC) (#168239)

This patch groups public functions, including the constructors, the
destructor, and the copy/move assignment operators.
DeltaFile
+21-25llvm/include/llvm/ADT/DenseMap.h
+21-251 files

LLVM/project 324e92bpolly/include/polly ScopPass.h, polly/lib/Analysis ScopPass.cpp

[Polly] Remove ScopPass infrastructure
DeltaFile
+0-264polly/include/polly/ScopPass.h
+0-134polly/lib/Analysis/ScopPass.cpp
+3-113polly/lib/Support/RegisterPasses.cpp
+0-66polly/unittests/ScopPassManager/PassManagerTest.cpp
+0-44polly/lib/Support/PollyPasses.def
+0-43polly/lib/Transform/DeLICM.cpp
+3-66437 files not shown
+53-1,16143 files

LLVM/project 6cedafbllvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 vselect.ll

X86: Handle poison in buildFromShuffleMostly (#168218)

DeltaFile
+3-3llvm/test/CodeGen/X86/vselect.ll
+2-2llvm/lib/Target/X86/X86ISelLowering.cpp
+5-52 files

LLVM/project e009de2llvm/lib/Transforms/Vectorize LoopVectorize.cpp VPlanPatternMatch.h

[LV] Use VPlan pattern matching in adjustRecipesForReductions (NFC)

Replace the assert checking if CurrentLinkI is a CmpInst with a pattern
matching check in the if condition. This uses VPlan-level pattern matching
instead of inspecting the underlying instruction type.
DeltaFile
+1-4llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+4-0llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h
+5-42 files

LLVM/project d831f8dllvm/lib/CodeGen/SelectionDAG LegalizeVectorTypes.cpp LegalizeVectorOps.cpp, llvm/test/CodeGen/AArch64 loop-dependence-mask-ccmp.ll alias_mask.ll

[SelectionDAG] Fix AArch64 machine verifier bug when expanding LOOP_DEPENDENCE_MASK (#168221)

TargetConstant nodes don't match TableGen ImmLeaf patterns during
instruction selection. When this zero constant flows into the AArch64
CCMP formation code, the machine verifier hits an assertion in expensive
checks.

Fixes: #168227
DeltaFile
+45-0llvm/test/CodeGen/AArch64/loop-dependence-mask-ccmp.ll
+4-6llvm/test/CodeGen/AArch64/alias_mask.ll
+1-1llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+1-1llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
+51-84 files

LLVM/project f5b7376mlir/include/mlir/Dialect/MemRef/IR MemRefBase.td, mlir/lib/Dialect/MemRef/IR MemRefMemorySlot.cpp CMakeLists.txt

[mlir][MemRef] Add UB as a dependent dialect and use `ub.poison` for Mem2Reg (#168066)

This patch adds `ub` as a dependent dialect to `memref`, and uses
`ub.poison` as the default value in `AllocaOp::getDefaultValue` for the
mem2reg pass.

This aligns the behavior of `mem2reg` with LLVM, where loading a value
before having a value should be poison.

---------

Signed-off-by: Fabian Mora <fabian.mora-cordero at amd.com>
DeltaFile
+2-17mlir/lib/Dialect/MemRef/IR/MemRefMemorySlot.cpp
+8-1mlir/include/mlir/Dialect/MemRef/IR/MemRefBase.td
+1-1mlir/test/Dialect/MemRef/mem2reg.mlir
+1-0mlir/lib/Dialect/MemRef/IR/CMakeLists.txt
+1-0mlir/lib/Dialect/MemRef/IR/MemRefDialect.cpp
+13-195 files

LLVM/project f210fc1clang/lib/Sema SemaChecking.cpp, clang/test/AST/ByteCode builtin-functions.cpp

[Clang] Add __builtin_bswapg (#162433)

Add a new builtin function __builtin_bswapg. It works on any integral
types that has a multiple of 16 bits as well as a single byte.

Closes #160266
DeltaFile
+230-0clang/test/SemaCXX/builtin-bswapg.cpp
+56-0clang/test/CodeGenCXX/builtins.cpp
+41-1clang/test/CodeGen/builtins.c
+37-0clang/lib/Sema/SemaChecking.cpp
+33-0clang/test/AST/ByteCode/builtin-functions.cpp
+22-0clang/test/Sema/constant-builtins-2.c
+419-17 files not shown
+457-713 files

LLVM/project 95c93f4llvm/include/llvm/CodeGen/GlobalISel GIMatchTableExecutorImpl.h, llvm/lib/Target/AArch64 AArch64MacroFusion.h AArch64.h

Cleanups in AArch64 (#168025)

Forward declare a couple of classes for simplicity, remove some unused
headers, clean up a comment.

Tested with check-all.
DeltaFile
+0-3llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h
+1-1llvm/lib/Target/AArch64/AArch64MacroFusion.h
+2-0llvm/lib/Target/AArch64/AArch64.h
+0-1llvm/lib/Target/X86/X86Subtarget.cpp
+0-1llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
+0-1llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
+3-76 files

LLVM/project 1fd9c02mlir/lib/CAPI/Dialect LLVM.cpp, mlir/lib/Dialect/Tensor/IR TensorOps.cpp

[mlir] Adopt cast function objects. NFC. (#168228)

These were added in https://github.com/llvm/llvm-project/pull/165803.
DeltaFile
+7-8mlir/lib/CAPI/Dialect/LLVM.cpp
+1-3mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
+1-2mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp
+1-2mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp
+1-2mlir/lib/IR/TypeUtilities.cpp
+11-175 files

LLVM/project 6b4fef0llvm/docs CIBestPractices.rst

[CI] Fix typo in CI Best Practices for the release branch names push filter (#168226)

The CIBestPractices.rst document uses `releases/*` as the branch name
filter for push events. The actual release branch names match the
pattern `release/*`.
DeltaFile
+1-1llvm/docs/CIBestPractices.rst
+1-11 files

LLVM/project 700aa5ellvm/lib/CodeGen GlobalMerge.cpp, llvm/test/CodeGen/ARM force-global-merge.ll

[revert][CodeGen] add a command to force global merge (#168230)

sorry, this was my mistake
DeltaFile
+0-23llvm/test/CodeGen/ARM/force-global-merge.ll
+1-7llvm/lib/CodeGen/GlobalMerge.cpp
+1-302 files

LLVM/project 3705921llvm/lib/CodeGen GlobalMerge.cpp, llvm/test/CodeGen/ARM force-global-merge.ll

[CodeGen] add a command to force global merge

I found that in some performance scenarios, such as under O2, this pr can be helpful for a series of loading global variables.
DeltaFile
+23-0llvm/test/CodeGen/ARM/force-global-merge.ll
+7-1llvm/lib/CodeGen/GlobalMerge.cpp
+30-12 files

LLVM/project d343913clang/lib/Analysis BodyFarm.cpp

[Analysis] Remove a redundant cast. (#168214)

callOperatorDecl is already of type FunctionDecl *.

Identified with readability-redundant-casting.
DeltaFile
+8-9clang/lib/Analysis/BodyFarm.cpp
+8-91 files

LLVM/project ff8ed4dmlir/lib/Analysis/Presburger IntegerRelation.cpp, mlir/lib/CAPI/IR BuiltinTypes.cpp

[mlir] Use llvm::copy (NFC) (#168213)

Identified with llvm-use-ranges.
DeltaFile
+2-2mlir/lib/Analysis/Presburger/IntegerRelation.cpp
+1-2mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp
+1-1mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp
+1-1mlir/lib/CAPI/IR/BuiltinTypes.cpp
+1-1mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorIterator.h
+1-1mlir/lib/Dialect/XeGPU/Utils/XeGPUUtils.cpp
+7-81 files not shown
+8-97 files

LLVM/project b1b0be2llvm/include/llvm/ADT DenseMap.h

[ADT] Make DenseMapBase::moveFrom safer (NFC) (#168180)

Without this patch, DenseMapBase::moveFrom() moves buckets and leaves
the moved-from object in a zombie state.  This patch teaches
moveFrom() to call kill() so that the move-from object is in a known
good state.  This brings moveFrom()'s behavior in line with standard
C++ move semantics.

kill() is implemented so that it takes the fast path in the destructor
-- both destroyAll() and deallocateBuckets().
DeltaFile
+23-6llvm/include/llvm/ADT/DenseMap.h
+23-61 files

LLVM/project 2e4ac2flld/ELF InputFiles.cpp, lld/test/ELF dso-undef-extract-lazy.s

add more test

Created using spr 1.3.5-bogner
DeltaFile
+41-0lld/test/ELF/dso-undef-extract-lazy.s
+3-2lld/ELF/InputFiles.cpp
+44-22 files

LLVM/project eb9d56cmlir/python/mlir/dialects/transform __init__.py, mlir/test/python/dialects transform_interpreter.py

[MLIR][Transform][Python] Expose applying named_sequences as a method (#168223)

Makes it so that a NamedSequenceOp can be directly applied to a Module,
via a method `apply(...)`.
DeltaFile
+20-0mlir/python/mlir/dialects/transform/__init__.py
+14-0mlir/test/python/dialects/transform_interpreter.py
+34-02 files

LLVM/project 82214ffclang-tools-extra/clang-doc JSONGenerator.cpp, clang-tools-extra/clang-doc/assets comment-template.mustache

[clang-doc] add throws comments to comment template (#150649)

Serialize throw Doxygen comments for exceptions. Accepts both \throw and
\throws.
DeltaFile
+8-0clang-tools-extra/clang-doc/assets/comment-template.mustache
+7-0clang-tools-extra/clang-doc/JSONGenerator.cpp
+4-1clang-tools-extra/test/clang-doc/basic-project.mustache.test
+19-13 files

LLVM/project 358e9a5llvm/lib/Transforms/Utils LoopPeel.cpp, llvm/test lit.cfg.py

[LP] Assign weights when peeling last iteration. (#166858)

DeltaFile
+66-0llvm/test/Transforms/LoopUnroll/branch-weights-freq/peel-last-iteration.ll
+36-15llvm/test/Transforms/LoopUnroll/peel-last-iteration-expansion-cost.ll
+22-1llvm/lib/Transforms/Utils/LoopPeel.cpp
+1-2llvm/test/lit.cfg.py
+125-184 files

LLVM/project e8222f8llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp

DAG: Preserve poison in combineConcatVectorOfScalars
DeltaFile
+2-2llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+2-21 files

LLVM/project 3c300b4llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 vselect.ll

X86: Handle poison in buildFromShuffleMostly
DeltaFile
+3-3llvm/test/CodeGen/X86/vselect.ll
+2-2llvm/lib/Target/X86/X86ISelLowering.cpp
+5-52 files

LLVM/project 350fb51llvm/lib/Target/AArch64 AArch64ISelLowering.cpp

AArch64: Use isUndef instead of checking opcode is UNDEF

This is to avoid regressions by poison introduction
DeltaFile
+4-6llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+4-61 files

LLVM/project 4ff4cc1llvm/lib/Transforms/IPO LowerTypeTests.cpp, llvm/test/Other new-pm-O0-defaults.ll

[LTT][profcheck] Set branch weights for complex llvm.type.test lowering
DeltaFile
+38-11llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+21-2llvm/test/Transforms/LowerTypeTests/section.ll
+1-0llvm/test/Other/new-pm-O0-defaults.ll
+60-133 files

LLVM/project bb75b3dllvm/lib/Transforms/Utils LoopPeel.cpp, llvm/test lit.cfg.py

[LP] Assign weights when peeling last iteration.
DeltaFile
+66-0llvm/test/Transforms/LoopUnroll/branch-weights-freq/peel-last-iteration.ll
+36-15llvm/test/Transforms/LoopUnroll/peel-last-iteration-expansion-cost.ll
+22-1llvm/lib/Transforms/Utils/LoopPeel.cpp
+1-2llvm/test/lit.cfg.py
+125-184 files

LLVM/project aca5e76llvm/lib/Transforms/IPO LowerTypeTests.cpp, llvm/test/Transforms/LowerTypeTests function-weak.ll

[LTT] Mark as unkown weak function tests.
DeltaFile
+3-2llvm/test/Transforms/LowerTypeTests/function-weak.ll
+3-0llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+6-22 files