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
+20-5llvm/test/Transforms/Inline/inline-switch-default.ll
+10-15llvm/lib/Analysis/InlineCost.cpp
+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

LLVM/project d5ca2e4llvm/lib/Target/AMDGPU AMDGPUPostLegalizerCombiner.cpp AMDGPUCombine.td

[AMDGPU] Improve MIR pattern for FMinFMaxLegacy combine. NFC. (#90968)

DeltaFile
+8-10llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp
+3-2llvm/lib/Target/AMDGPU/AMDGPUCombine.td
+11-122 files

LLVM/project 78a28b3llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 cmp-shiftX-maskX.ll vector-shift-by-select-loop.ll

[X86] Support icmp_i64(i64 X, i64 Y) --> icmp_i32(trunc(X), trunc(Y)) for non-constant Y (#91085)

Relax the constraint on the fold to allow any value for X and Y iff all upper 32-bits are known zero

Minor code-size saving by moving to i32 bit instructions
DeltaFile
+5-5llvm/test/CodeGen/X86/cmp-shiftX-maskX.ll
+4-4llvm/test/CodeGen/X86/vector-shift-by-select-loop.ll
+3-3llvm/lib/Target/X86/X86ISelLowering.cpp
+12-123 files

LLVM/project 7d913c5clang/include/clang/Basic Module.h, clang/lib/Basic Module.cpp

[clang][Modules] Make `Module::Requirement` a struct (NFC) (#67900)

`Module::Requirement` was defined as a `std::pair<std::string, bool>`.
This required a comment to explain what the data members mean and makes
the usage harder to understand. Replace this with a struct with two
members, `FeatureName` and `RequiredState`.

---------

Co-authored-by: cor3ntin <corentinjabot at gmail.com>
DeltaFile
+5-5clang/lib/Basic/Module.cpp
+4-3clang/include/clang/Basic/Module.h
+2-2clang/lib/Serialization/ASTWriter.cpp
+2-1clang/lib/Lex/PPDirectives.cpp
+13-114 files

LLVM/project 9154a32clang/docs ClangFormatStyleOptions.rst, clang/include/clang/Format Format.h

[clang-format][doc] Fix typos
DeltaFile
+2-2clang/include/clang/Format/Format.h
+2-2clang/docs/ClangFormatStyleOptions.rst
+4-42 files

LLVM/project a415b4dllvm/lib/Target/SystemZ SystemZInstrInfo.cpp SystemZInstrInfo.h, llvm/test/CodeGen/SystemZ fold-copy-vector-immediate.mir

Revert "SystemZ: Fold copy of vector immediate to gr128" (#91099)

Fails here:
https://lab.llvm.org/buildbot/#/builders/239/builds/6893
https://lab.llvm.org/buildbot/#/builders/5/builds/43113
https://lab.llvm.org/buildbot/#/builders/168/builds/20228

Reverts llvm/llvm-project#90706
DeltaFile
+0-182llvm/test/CodeGen/SystemZ/fold-copy-vector-immediate.mir
+0-58llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
+0-3llvm/lib/Target/SystemZ/SystemZInstrInfo.h
+0-2433 files

LLVM/project 7c1d9b1clang/test/APINotes namespaces.cpp, clang/test/AST pragma-attribute-cxx-subject-match-rules.cpp pragma-attribute-objc-subject-match-rules.m

[test] %clang_cc1: remove redundant actions
DeltaFile
+14-14clang/test/AST/pragma-attribute-cxx-subject-match-rules.cpp
+12-12clang/test/OpenMP/target_ast_print.cpp
+12-12clang/test/APINotes/namespaces.cpp
+10-10clang/test/Sema/builtin-setjmp.c
+9-9clang/test/AST/pragma-attribute-objc-subject-match-rules.m
+8-8clang/test/OpenMP/simd_ast_print.cpp
+65-65381 files not shown
+854-854387 files

LLVM/project 5d04944llvm/lib/Target/SystemZ SystemZInstrInfo.cpp SystemZInstrInfo.h, llvm/test/CodeGen/SystemZ fold-copy-vector-immediate.mir

Revert "SystemZ: Fold copy of vector immediate to gr128 (#90706)"

This reverts commit 49c5f4d56a89278fcc426cabbeeec33e0915980e.
DeltaFile
+0-182llvm/test/CodeGen/SystemZ/fold-copy-vector-immediate.mir
+0-58llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
+0-3llvm/lib/Target/SystemZ/SystemZInstrInfo.h
+0-2433 files

LLVM/project 02dfbbfllvm/lib/CodeGen/SelectionDAG LegalizeFloatTypes.cpp LegalizeTypes.h, llvm/test/CodeGen/X86 arithmetic_fence2.ll

[SelectionDAG] Make ARITH_FENCE support half and bfloat type (#90836)

DeltaFile
+154-0llvm/test/CodeGen/X86/arithmetic_fence2.ll
+7-0llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+1-0llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
+162-03 files

LLVM/project 7a484d3clang/include/clang/AST ExprCXX.h, clang/include/clang/Serialization ASTBitCodes.h

[clang] Distinguish unresolved templates in UnresolvedLookupExpr (#89019)

This patch revolves around the misuse of UnresolvedLookupExpr in
BuildTemplateIdExpr.
    
Basically, we build up an UnresolvedLookupExpr not only for function
overloads but for "unresolved" templates wherever we need an expression
for template decls. For example, a dependent VarTemplateDecl can be
wrapped with such an expression before template instantiation. (See

https://github.com/llvm/llvm-project/commit/617007240cbfb97c8ccf6d61b0c4ca0bb62d43c9)
    
Also, one important thing is that UnresolvedLookupExpr uses a
"canonical"
QualType to describe the containing unresolved decls: a DependentTy is
for dependent expressions and an OverloadTy otherwise. Therefore, this
modeling for non-dependent templates leaves a problem in that the
expression
is marked and perceived as if describing overload functions. The

    [21 lines not shown]
DeltaFile
+90-0clang/test/SemaTemplate/template-id-expr.cpp
+22-0clang/include/clang/AST/ExprCXX.h
+22-0clang/lib/Sema/SemaExpr.cpp
+11-3clang/lib/Sema/SemaTemplate.cpp
+14-0clang/lib/Parse/ParseExprCXX.cpp
+4-1clang/include/clang/Serialization/ASTBitCodes.h
+163-410 files not shown
+185-616 files