LLVM/project db0ed55clang/lib/Format UnwrappedLineParser.cpp, clang/unittests/Format FormatTest.cpp

[clang-format] Don't remove parentheses of fold expressions (#91045)

Fixes #90966.
DeltaFile
+9-0clang/unittests/Format/FormatTest.cpp
+6-1clang/lib/Format/UnwrappedLineParser.cpp
+15-12 files

LLVM/project c609043clang/lib/Format UnwrappedLineParser.cpp, clang/unittests/Format TokenAnnotatorTest.cpp

[clang-format] Don't allow comma in front of structural enum (#91056)

Assume that a comma in front of `enum` means it is actually a part of an
elaborated type in a template parameter list.

Fixes https://github.com/llvm/llvm-project/issues/47782
DeltaFile
+3-2clang/lib/Format/UnwrappedLineParser.cpp
+4-0clang/unittests/Format/TokenAnnotatorTest.cpp
+7-22 files

LLVM/project 774b7ebllvm/include/llvm/ADT StringRef.h

[ADT] Reimplement operator==(StringRef, StringRef) (NFC) (#91139)

I'm planning to deprecate and eventually remove StringRef::equals in
favor of operator==.  This patch reimplements operator== without using
StringRef::equals.

I'm not sure if there is a good way to make StringRef::compareMemory
available to operator==, which is not a member function.  "friend"
works to some extent but breaks corner cases, which is why I've chosen
to "inline" compareMemory.
DeltaFile
+5-1llvm/include/llvm/ADT/StringRef.h
+5-11 files

LLVM/project f7bfb07llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 pr91005.ll

[X86][FP16] Do not create VBROADCAST_LOAD for f16 without AVX2 (#91125)

AVX doesn't provide 16-bit BROADCAST instruction.

Fixes #91005
DeltaFile
+39-0llvm/test/CodeGen/X86/pr91005.ll
+1-1llvm/lib/Target/X86/X86ISelLowering.cpp
+40-12 files

LLVM/project 3d6cf53mlir/docs/DefiningDialects Operations.md

fix formatting issues with ODS docs around assembly format directives (#91149)

- Some sentences are incorrectly split across list items.
- Some pre-formatted syntax is left in plaintext
- Some lines end in spaces

Co-authored-by: Jeremy Kun <j2kun at users.noreply.github.com>
DeltaFile
+15-14mlir/docs/DefiningDialects/Operations.md
+15-141 files

LLVM/project ddecadaclang/lib/Basic/Targets AArch64.cpp, clang/test/OpenMP distribute_parallel_for_simd_num_threads_codegen.cpp distribute_parallel_for_num_threads_codegen.cpp

[clang backend] In AArch64's DataLayout, specify a minimum function alignment of 4. (#90702)

This addresses an issue where the explicit alignment of 2 (for C++ ABI
reasons) was being propagated to the back end and causing under-aligned
functions (in special sections).

This is an alternate approach suggested by @efriedma-quic in PR #90415.

Fixes #90358
DeltaFile
+15-15clang/test/OpenMP/distribute_parallel_for_simd_num_threads_codegen.cpp
+10-10clang/test/OpenMP/distribute_parallel_for_num_threads_codegen.cpp
+6-6clang/lib/Basic/Targets/AArch64.cpp
+6-3llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
+8-0llvm/lib/IR/AutoUpgrade.cpp
+4-4llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
+49-384 files not shown
+57-4610 files

LLVM/project e123643llvm/lib/Target/AArch64 AArch64ISelLowering.cpp, llvm/test/CodeGen/AArch64 mul_pow2.ll

[AArch64][SelectionDAG] Lower multiplication by a constant to shl+sub+shl+sub (#90199)

Change the costmodel to lower a = b * C where C = 1 - (1 - 2^m) * 2^n to
              sub  w8, w0, w0, lsl #m
              sub  w0, w0, w8, lsl #n
Fix https://github.com/llvm/llvm-project/issues/89430
DeltaFile
+73-2llvm/test/CodeGen/AArch64/mul_pow2.ll
+30-0llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+103-22 files

LLVM/project 2aaec48llvm/lib/Target/X86 X86FixupBWInsts.cpp

X86FixupBWInsts: Remove redundant code. NFC
DeltaFile
+1-3llvm/lib/Target/X86/X86FixupBWInsts.cpp
+1-31 files

LLVM/project 2574cablibcxx/test/libcxx clang_modules_include.gen.py transitive_includes.gen.py

[NFC] Remove BLOCKLIT workaround. (#91001)

Lit already has support for stopping LIT from parsing further test
directives. It is

// END.

After that directive, LIT will stop parsing.

This change removes the BLOCKLIT hack and replaces it with END.
DeltaFile
+19-18libcxx/test/libcxx/clang_modules_include.gen.py
+16-14libcxx/test/libcxx/transitive_includes.gen.py
+7-5libcxx/test/libcxx/clang_tidy.gen.py
+7-5libcxx/test/libcxx/double_include.gen.py
+49-424 files

LLVM/project c18bcd0llvm/lib/Target/AArch64 AArch64MachineFunctionInfo.cpp, llvm/lib/Target/AMDGPU AMDGPUAttributor.cpp

[Target] Use StringRef::operator== instead of StringRef::equals (NFC) (#91072) (#91138)

I'm planning to remove StringRef::equals in favor of
StringRef::operator==.

- StringRef::operator==/!= outnumber StringRef::equals by a factor of
  38 under llvm/ in terms of their usage.

- The elimination of StringRef::equals brings StringRef closer to
  std::string_view, which has operator== but not equals.

- S == "foo" is more readable than S.equals("foo"), especially for
  !Long.Expression.equals("str") vs Long.Expression != "str".
DeltaFile
+9-9llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
+4-3llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+3-3llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
+3-3llvm/lib/Target/ARM/ARMMachineFunctionInfo.cpp
+3-3llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.cpp
+2-2llvm/lib/Target/BPF/BTFDebug.cpp
+24-2310 files not shown
+36-3516 files

LLVM/project 3219c0ellvm/include/llvm/Analysis LoopAccessAnalysis.h VectorUtils.h, llvm/lib/Analysis LoopAccessAnalysis.cpp

[LAA] Directly pass DepChecker to getSource/getDestination (NFC).

Instead of passing LoopAccessInfo only to fetch the MemoryDepChecker,
directly pass MemoryDepChecker. This simplifies the code and also allows
new uses in places where no LAI is available.
DeltaFile
+6-6llvm/include/llvm/Analysis/LoopAccessAnalysis.h
+4-3llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
+4-2llvm/include/llvm/Analysis/VectorUtils.h
+2-2llvm/lib/Analysis/LoopAccessAnalysis.cpp
+16-134 files

LLVM/project c867733clang/include/clang/Basic DiagnosticFrontendKinds.td, clang/lib/Frontend CompilerInvocation.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.5-bogner
DeltaFile
+24-0clang/lib/Frontend/CompilerInvocation.cpp
+7-0clang/test/Frontend/multiple-actions.c
+2-0clang/include/clang/Basic/DiagnosticFrontendKinds.td
+33-03 files

LLVM/project 57f13b5clang/lib/Driver/ToolChains HLSL.cpp, clang/test/Driver dxc_fcgl.hlsl

[HLSL] Remove overridden -S

The cc1 option -S (https://reviews.llvm.org/D124983) is overridden by
the latter -emit-llvm.
DeltaFile
+1-2clang/lib/Driver/ToolChains/HLSL.cpp
+1-1clang/test/Driver/dxc_fcgl.hlsl
+2-32 files

LLVM/project d33937bclang/test/CodeGen thinlto-distributed-cfi-devirt.ll thinlto-distributed-cfi.ll, clang/test/CodeGen/SystemZ align-systemz-02.c

[test] %clang_cc1: remove redundant actions

ParseFrontendArgs takes the last OPT_Action_Group option. The other
actions are overridden.
DeltaFile
+3-3clang/test/Modules/prune-non-affecting-module-map-files-textual.c
+2-2clang/test/CodeGen/thinlto-distributed-cfi-devirt.ll
+2-2clang/test/CodeGen/SystemZ/align-systemz-02.c
+2-2clang/test/PCH/ms-if-exists.cpp
+1-1clang/test/Lexer/raw-string-dlim-invalid.cpp
+1-1clang/test/CodeGen/thinlto-distributed-cfi.ll
+11-112 files not shown
+13-138 files

LLVM/project 248fbfbllvm/include/llvm/LTO/legacy ThinLTOCodeGenerator.h, llvm/include/llvm/Transforms/IPO FunctionImport.h

llvm-lto test coverage
DeltaFile
+6-6llvm/lib/LTO/LTO.cpp
+9-3llvm/include/llvm/Transforms/IPO/FunctionImport.h
+5-2llvm/tools/llvm-lto/llvm-lto.cpp
+5-1llvm/test/ThinLTO/X86/import_callee_declaration.ll
+3-1llvm/lib/LTO/LTOBackend.cpp
+2-1llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
+30-141 files not shown
+31-167 files

LLVM/project 41574f5lldb/source/Plugins/TypeSystem/Clang TypeSystemClang.cpp

Add new BuiltinType introduced in 7a484d3a1f630ba9ce7b22e744818be974971470

I don't think this is one lldb would encounter when building ASTs from
DWARF.
DeltaFile
+3-0lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+3-01 files

LLVM/project 7e59223clang/test/AST arithmetic-fence-builtin.c, clang/test/CodeGen pch-dllexport.cpp thinlto-loop-vectorize-pm.c

[test] %clang_cc1: remove redundant actions

ParseFrontendArgs takes the last OPT_Action_Group option. The other
actions are overridden.
DeltaFile
+8-10clang/test/AST/arithmetic-fence-builtin.c
+7-7clang/test/CodeGen/pch-dllexport.cpp
+6-6clang/test/CodeGen/PowerPC/vector-bool-pixel-altivec-init-no-parentheses.c
+6-6clang/test/CodeGen/thinlto-loop-vectorize-pm.c
+6-6clang/test/CodeGen/PowerPC/builtins-ppc-vec-ins-error.c
+6-6clang/test/CodeGen/PowerPC/vector-bool-pixel-altivec-init.c
+39-4130 files not shown
+100-10236 files

LLVM/project 624c9fcmlir/include/mlir/Dialect/Polynomial/IR Polynomial.td, mlir/lib/Dialect/Polynomial/IR PolynomialOps.cpp PolynomialAttributes.cpp

Upstream polynomial.ntt and polynomial.intt (#90992)

These two ops represent a number-theoretic transform of a polynomial to
a tensor of evaluations of the polynomial at a list of powers of
primitive roots of the polynomial.

To support this, a new optional attribute is added to the ring attribute
to specify the primitive root of unity used for the NTT. A verifier for
the op is added to ensure the chosen root is a primitive nth root of
unity.

---------

Co-authored-by: Jeremy Kun <j2kun at users.noreply.github.com>
Co-authored-by: Oleksandr "Alex" Zinenko <ftynse at gmail.com>
DeltaFile
+87-0mlir/test/Dialect/Polynomial/ops_errors.mlir
+79-0mlir/lib/Dialect/Polynomial/IR/PolynomialOps.cpp
+53-3mlir/include/mlir/Dialect/Polynomial/IR/Polynomial.td
+17-1mlir/lib/Dialect/Polynomial/IR/PolynomialAttributes.cpp
+15-1mlir/test/Dialect/Polynomial/ops.mlir
+251-55 files

LLVM/project 716eab7clang-tools-extra/docs/clang-tidy/checks/modernize use-std-print.rst

[clang-tidy][docs] Fix modernize-use-std-print docs (#91069)

The set of functions for the PrintfLikeFunctions and
FprintfLikeFunctions options replaces the default, so remove the word
"extra" from the description which implies that they are in addition to
the default.
DeltaFile
+2-2clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-print.rst
+2-21 files

LLVM/project 9aad38bclang-tools-extra/clang-tidy/bugprone ReturnConstRefFromParameterCheck.cpp, clang-tools-extra/test/clang-tidy/checkers/bugprone return-const-ref-from-parameter.cpp

[clang-tidy] fix false-positives for templates in `bugprone-return-const-ref-from-parameter` (#90273)

In the AST for function templates, the return will be a DeclRefExpr,
even if the return type differs from that of the returned variable.
Protect against false-positives by constraining the canonical return
type to be that of the parameter.
Also streams the source range of the returned expression into the
diagnostic.
DeltaFile
+115-1clang-tools-extra/test/clang-tidy/checkers/bugprone/return-const-ref-from-parameter.cpp
+7-3clang-tools-extra/clang-tidy/bugprone/ReturnConstRefFromParameterCheck.cpp
+122-42 files

LLVM/project 77d8c38llvm/test/CodeGen/X86 2008-08-31-EH_RETURN32.ll

[X86] 2008-08-31-EH_RETURN32.ll - regenerate with update_llc_test_checks.py
DeltaFile
+41-19llvm/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll
+41-191 files

LLVM/project 7e4d16dclang-tools-extra/clang-tidy/modernize UseStdPrintCheck.cpp

[clang-tidy] Improve modernize-use-std-print diagnostic (#91071)

Include the source range of the printf function in the diagnostic so it
gets underlined in the output.
DeltaFile
+2-1clang-tools-extra/clang-tidy/modernize/UseStdPrintCheck.cpp
+2-11 files

LLVM/project 176be3ellvm/test/CodeGen/X86 bypass-slow-division-64.ll

[X86] bypass-slow-division-64.ll - add udiv+urem test coverage
DeltaFile
+198-21llvm/test/CodeGen/X86/bypass-slow-division-64.ll
+198-211 files

LLVM/project c6e4f63llvm/lib/Analysis InlineCost.cpp, llvm/test/Transforms/Inline inline-cost-switch-default.ll inline-switch-default.ll

Revert "[InlineCost] Correct the default branch cost for the switch statement (#85160)"

This reverts commit 882814edd33cab853859f07b1dd4c4fa1393e0ea.
DeltaFile
+0-130llvm/test/Transforms/Inline/inline-cost-switch-default.ll
+10-15llvm/lib/Analysis/InlineCost.cpp
+20-5llvm/test/Transforms/Inline/inline-switch-default.ll
+19-2llvm/test/Transforms/Inline/inline-switch-default-2.ll
+49-1524 files

LLVM/project 882814ellvm/lib/Analysis InlineCost.cpp, llvm/test/Transforms/Inline inline-cost-switch-default.ll inline-switch-default.ll

[InlineCost] Correct the default branch cost for the switch statement (#85160)

Fixes #81723.

The earliest commit of the related code is:
https://github.com/llvm/llvm-project/commit/919f9e8d65ada6552b8b8a5ec12ea49db91c922a.
I tried to understand the following code with
https://github.com/llvm/llvm-project/pull/77856#issuecomment-1993499085.

https://github.com/llvm/llvm-project/blob/5932fcc47855fdd209784f38820422d2369b84b2/llvm/lib/Analysis/InlineCost.cpp#L709-L720

I think only scenarios where there is a default branch were considered.
DeltaFile
+130-0llvm/test/Transforms/Inline/inline-cost-switch-default.ll
+15-10llvm/lib/Analysis/InlineCost.cpp
+5-20llvm/test/Transforms/Inline/inline-switch-default.ll
+2-19llvm/test/Transforms/Inline/inline-switch-default-2.ll
+152-494 files

LLVM/project de9b386llvm/test/CodeGen/X86 bypass-slow-division-64.ll

[X86] bypass-slow-division-64.ll - add optsize/minsize tests

Make sure we're not expanding div32-div64 codegen when we're focussed on codesize
DeltaFile
+78-4llvm/test/CodeGen/X86/bypass-slow-division-64.ll
+78-41 files

LLVM/project 9833332llvm/test/CodeGen/X86 bypass-slow-division-64.ll

[X86] bypass-slow-division-64.ll - extend cpu test coverage

Ensure we test with/without the idivq-to-divl attribute, and test the x86-64-v* cpu levels and some common Intel/AMD cpus
DeltaFile
+102-56llvm/test/CodeGen/X86/bypass-slow-division-64.ll
+102-561 files

LLVM/project 72eaa0ellvm/lib/Target/AArch64 AArch64ISelLowering.cpp, llvm/test/CodeGen/AArch64 and-mask-removal.ll

[AArch64][SelectionDAG] Mask for SUBS with multiple users cannot be elided (#90911)

In DAGCombiner, the `performCONDCombine` function attempts to remove AND
instructions in front of SUBS (cmp) instructions for which the AND is
transparent. The rules for that are correct, but it fails to take into
account the case where the SUBS instruction has multiple users with
different condition codes for comparison and simply removes the AND for
all of them. This causes a miscompilation in the attached test case.
DeltaFile
+22-0llvm/test/CodeGen/AArch64/and-mask-removal.ll
+2-1llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+24-12 files

LLVM/project 7963d9allvm/lib/Target/X86 X86InstrAVX512.td X86ISelLowering.cpp, llvm/test/CodeGen/X86 pr90844.ll

[X86][EVEX512] Add `HasEVEX512` when `NoVLX` used for 512-bit patterns (#91106)

With KNL/KNC being deprecated, we don't need to care about such no VLX
cases anymore. We may remove such patterns in the future.

Fixes #90844
DeltaFile
+21-21llvm/lib/Target/X86/X86InstrAVX512.td
+19-0llvm/test/CodeGen/X86/pr90844.ll
+3-1llvm/lib/Target/X86/X86ISelLowering.cpp
+43-223 files

LLVM/project d145f40llvm/lib/Transforms/Vectorize VectorCombine.cpp, llvm/test/Transforms/VectorCombine/AArch64 shuffletoidentity.ll

[VectorCombine] shuffleToIdentity - guard against call instructions.

The shuffleToIdentity fold needs to be a bit more careful about the difference
between call instructions and intrinsics. The second can be handled, but the
first should result in bailing out. This patch also adds some extra intrinsic
tests from #91000.

Fixes #91078
DeltaFile
+86-0llvm/test/Transforms/VectorCombine/AArch64/shuffletoidentity.ll
+5-2llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+91-22 files