Changes

Summary

  1. [lld][WebAssembly] Initial support merging string data (details)
  2. [VecLib] Add support for vector fns from Darwin's libsystem. (details)
  3. [InstCombine] Fold comparison of integers by parts (details)
  4. [mlir][Python] Finish adding RankedTensorType support for encoding. (details)
  5. [mlir] Fix windows build bot break due to use of `alloca` in a test. (details)
  6. [test] Put aix-xcoff-huge-relocs.ll under expensive checks (details)
  7. [libcxx] removes `weak_equality` and `strong_equality` from <compare> (details)
  8. [NFC][X86][MCA] AMD Zen 3: add tests for same-reg MMX PCMPEQ (details)
  9. [X86] AMD Zen 3: same-reg PCMPEQ is an MMX all-ones dep breaking idiom (details)
  10. [NFC][X86][MCA] AMD Zen 3: add tests for same-reg XMM SSE PCMP (details)
  11. [X86] AMD Zen 3: same-reg SSE XMM PCMP is dep breaking one-idiom (details)
  12. [NFC][X86][MCA] AMD Zen 3: add tests for same-re AVX XMM VPCMP (details)
  13. [X86] AMD Zen 3: same-reg AVX XMM VPCMP is dep breaking one-idiom (details)
  14. [NFC][X86][MCA] AMD Zen 3: add tests for same-re AVX YMM VPCMP (details)
  15. [X86] AMD Zen 3: same-reg AVX YMM VPCMP is dep breaking one-idiom (details)
  16. [clang-tidy] Aliasing: Add support for captures. (details)
  17. [clang-tidy] Aliasing: Add more support for captures. (details)
  18. [clang-tidy] Aliasing: Add support for aggregates with references. (details)
  19. [InstCombine] add tests for extract-subvector of insert; NFC (details)
  20. [InstCombine] fold extract subvector of bitcast insertelt (details)
  21. Remove some unnecessary explicit defaulted copy ctors to cleanup -Wdeprecated-copy (details)
  22. Clangd Matchers.h: Fix -Wdeprecated-copy by making the defaulted copy ctor and deleted copy assignment operators explicit (details)
  23. [Hexagon] Handle loads and stores of scalar predicate vectors (details)
  24. Pre-commit test case for D101970 (details)
  25. [AArch64][GlobalISel] Enable memcpy family combines on minsize functions (details)
  26. Revert "[lld][WebAssembly] Initial support merging string data" (details)
Commit 5000a1b4b9edeb9e994f2a5b36da8d48599bea49 by sbc
[lld][WebAssembly] Initial support merging string data

This change adds support for a new WASM_SEG_FLAG_STRINGS flag in
the object format which works in a similar fashion to SHF_STRINGS
in the ELF world.

Unlike the ELF linker this support is currently limited:
- No support for SHF_MERGE (non-string merging)
- Always do full tail merging ("lo" can be merged with "hello")
- Only support single byte strings (p2align 0)

Like the ELF linker merging is only performed at `-O1` and above.

This fixes part of https://bugs.llvm.org/show_bug.cgi?id=48828,
although crucially it doesn't not currently support debug sections
because they are not represented by data segments (they are custom
sections)

Differential Revision: https://reviews.llvm.org/D97657
The file was modifiedlld/wasm/Symbols.cpp
The file was modifiedlld/wasm/Writer.cpp
The file was modifiedlld/wasm/OutputSegment.h
The file was modifiedlld/wasm/InputChunks.cpp
The file was modifiedllvm/include/llvm/MC/MCContext.h
The file was addedlld/wasm/OutputSegment.cpp
The file was modifiedllvm/lib/MC/MCSectionWasm.cpp
The file was addedllvm/test/MC/WebAssembly/section-flags-changed.s
The file was modifiedlld/wasm/CMakeLists.txt
The file was modifiedlld/wasm/InputChunks.h
The file was modifiedlld/wasm/SyntheticSections.cpp
The file was modifiedlld/wasm/InputFiles.cpp
The file was modifiedllvm/lib/MC/MCContext.cpp
The file was modifiedllvm/lib/MC/MCParser/WasmAsmParser.cpp
The file was modifiedlld/wasm/Driver.cpp
The file was modifiedllvm/include/llvm/BinaryFormat/Wasm.h
The file was modifiedllvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
The file was modifiedllvm/lib/Object/WasmObjectFile.cpp
The file was modifiedllvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
The file was modifiedllvm/include/llvm/MC/MCSectionWasm.h
The file was addedlld/test/wasm/merge-string.s
The file was modifiedllvm/lib/ObjectYAML/WasmYAML.cpp
The file was modifiedllvm/lib/MC/MCObjectFileInfo.cpp
The file was modifiedllvm/lib/MC/WasmObjectWriter.cpp
The file was modifiedllvm/tools/obj2yaml/wasm2yaml.cpp
Commit 93a9a8a8d90f5b9bb6965ebb1104082692d41833 by flo
[VecLib] Add support for vector fns from Darwin's libsystem.

This patch adds support for Darwin's libsystem math vector functions to
TLI. Darwin's libsystem provides a range of vector functions for libm
functions.

This initial patch only adds the 2 x double and 4 x float versions,
which are available on both X86 and ARM64. On X86, wider vector versions
are supported as well.

Reviewed By: jroelofs

Differential Revision: https://reviews.llvm.org/D101856
The file was addedllvm/test/CodeGen/Generic/replace-intrinsics-with-veclib-darwin-libsystem-m.ll
The file was modifiedllvm/lib/Analysis/TargetLibraryInfo.cpp
The file was modifiedllvm/include/llvm/Analysis/TargetLibraryInfo.h
The file was modifiedllvm/include/llvm/Analysis/VecFuncs.def
The file was addedllvm/test/Transforms/LoopVectorize/AArch64/veclib-calls-libsystem-darwin.ll
Commit 463ea28e96c78f484d9ea44912d9bc70ff084c86 by nikita.ppv
[InstCombine] Fold comparison of integers by parts

Let's say you represent (i32, i32) as an i64 from which the parts
are extracted with lshr/trunc. Then, if you compare two tuples by
parts you get something like A[0] == B[0] && A[1] == B[1], just
that the part extraction happens by lshr/trunc and not a narrow
load or similar.

The fold implemented here reduces such equality comparisons by
converting them into a comparison on a larger part of the integer
(which might be the whole integer). It handles both the "and of eq"
and the conjugated "or of ne" case.

I'm being conservative with one-use for now, though this could be
relaxed if profitable (the base pattern converts 11 instructions
into 5 instructions, but there's quite a few variations on how it
can play out).

Differential Revision: https://reviews.llvm.org/D101232
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
The file was modifiedllvm/test/Transforms/InstCombine/eq-of-parts.ll
Commit a2c8aebd8f8f81ba0af1c50580036faf73e8e2dc by stellaraccident
[mlir][Python] Finish adding RankedTensorType support for encoding.

Differential Revision: https://reviews.llvm.org/D102184
The file was modifiedmlir/lib/CAPI/IR/BuiltinTypes.cpp
The file was modifiedmlir/test/python/dialects/sparse_tensor/dialect.py
The file was modifiedmlir/include/mlir-c/BuiltinTypes.h
The file was modifiedmlir/test/python/ir/builtin_types.py
The file was modifiedmlir/lib/Bindings/Python/IRTypes.cpp
The file was modifiedmlir/test/CAPI/ir.c
Commit 295087644a468c47a1dbfaca2b5ea552204ab35f by stellaraccident
[mlir] Fix windows build bot break due to use of `alloca` in a test.

Differential Revision: https://reviews.llvm.org/D102189
The file was modifiedmlir/test/CAPI/sparse_tensor.c
Commit edfa44b732984541105917934b1d9838fbf368ae by aeubanks
[test] Put aix-xcoff-huge-relocs.ll under expensive checks

It is an order of magnitude slower than the second slowest test
according to obj/llvm/test/.lit_test_times.txt.

The two slowest are:
2.870437e+02 CodeGen/PowerPC/aix-xcoff-huge-relocs.ll
2.850697e+01 tools/llvm-readobj/ELF/file-header-machine-types.test

Reviewed By: hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D102190
The file was modifiedllvm/test/CodeGen/PowerPC/aix-xcoff-huge-relocs.ll
Commit 4ff2fe1df0cea28e3ef2963116385c86bf3b5055 by cjdb
[libcxx] removes `weak_equality` and `strong_equality` from <compare>

`weak_equality` and `strong_equality` were removed before being
standardised, and need to be removed.

Also adjusts `common_comparison_category` since its test needed
adjusting due to the equality deletions.

Differential Revision: https://reviews.llvm.org/D100283
The file was modifiedlibcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp
The file was modifiedlibcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp
The file was modifiedlibcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp
The file was modifiedlibcxx/include/compare
The file was modifiedlibcxx/test/std/language.support/cmp/cmp.common/common_comparison_category.pass.cpp
The file was removedlibcxx/test/std/language.support/cmp/cmp.strongeq/cmp.strongeq.pass.cpp
The file was removedlibcxx/test/std/language.support/cmp/cmp.weakeq/cmp.weakeq.pass.cpp
Commit ba225ce961b4ec5e4d64b393b042bbaae5e9b41b by lebedev.ri
[NFC][X86][MCA] AMD Zen 3: add tests for same-reg MMX PCMPEQ
The file was addedllvm/test/tools/llvm-mca/X86/Znver3/one-idioms-mmx.s
Commit b24edfff4fb16549b3e5ec434ca79dd86fdb4e43 by lebedev.ri
[X86] AMD Zen 3: same-reg PCMPEQ is an MMX all-ones dep breaking idiom

They are, however, not zero-cycle, and do actually execute.

As measured by exegesis, and confirmed by ref docs.
The file was modifiedllvm/test/tools/llvm-mca/X86/Znver3/one-idioms-mmx.s
The file was modifiedllvm/lib/Target/X86/X86ScheduleZnver3.td
Commit 0e538f937a02eb5a1a999319ef023932be64e130 by lebedev.ri
[NFC][X86][MCA] AMD Zen 3: add tests for same-reg XMM SSE PCMP
The file was addedllvm/test/tools/llvm-mca/X86/Znver3/one-idioms-sse-xmm.s
Commit 0f3bcb97efa8ac6c3277390c3fa2085ee72b074e by lebedev.ri
[X86] AMD Zen 3: same-reg SSE XMM PCMP is dep breaking one-idiom

As measured by exegesis, and confirmed by ref docs.
Much like with MMX PCMP, it does actually have to execute, though.
The file was modifiedllvm/lib/Target/X86/X86ScheduleZnver3.td
The file was modifiedllvm/test/tools/llvm-mca/X86/Znver3/one-idioms-sse-xmm.s
Commit f59db6c4f84590aeeaf7753b8957a58cad12867b by lebedev.ri
[NFC][X86][MCA] AMD Zen 3: add tests for same-re AVX XMM VPCMP
The file was addedllvm/test/tools/llvm-mca/X86/Znver3/one-idioms-avx-xmm.s
Commit 29532453370044a4c2ddeea130a3db1648b42aa9 by lebedev.ri
[X86] AMD Zen 3: same-reg AVX XMM VPCMP is dep breaking one-idiom

As measured by exegesis, and confirmed by ref docs.
Again, it's not zero-cycle.
The file was modifiedllvm/lib/Target/X86/X86ScheduleZnver3.td
The file was modifiedllvm/test/tools/llvm-mca/X86/Znver3/one-idioms-avx-xmm.s
Commit 5864e7b86b919651e63ede7ba77ddca48385ea4d by lebedev.ri
[NFC][X86][MCA] AMD Zen 3: add tests for same-re AVX YMM VPCMP
The file was addedllvm/test/tools/llvm-mca/X86/Znver3/one-idioms-avx-ymm.s
Commit 6a64c462eb82f5f37e4ce512f4c25c474ddfcc4c by lebedev.ri
[X86] AMD Zen 3: same-reg AVX YMM VPCMP is dep breaking one-idiom

As measured by exegesis, and confirmed by ref docs.
Still not zero-cycle :)
The file was modifiedllvm/test/tools/llvm-mca/X86/Znver3/one-idioms-avx-ymm.s
The file was modifiedllvm/lib/Target/X86/X86ScheduleZnver3.td
Commit 43f4331edfb595979f6854351d24f9a9219595fa by Artem Dergachev
[clang-tidy] Aliasing: Add support for captures.

The utility function clang::tidy::utils::hasPtrOrReferenceInFunc() scans the
function for pointer/reference aliases to a given variable. It currently scans
for operator & over that variable and for declarations of references to that
variable.

This patch makes it also scan for C++ lambda captures by reference
and for Objective-C block captures.

Differential Revision: https://reviews.llvm.org/D96215
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/bugprone-redundant-branch-condition.cpp
The file was modifiedclang-tools-extra/clang-tidy/utils/Aliasing.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/bugprone-infinite-loop.cpp
Commit 9b292e0edcd4e889dbcf4bbaad6c1cc80fffcfd1 by Artem Dergachev
[clang-tidy] Aliasing: Add more support for captures.

D96215 takes care of the situation where the variable is captured into
a nearby lambda. This patch takes care of the situation where
the current function is the lambda and the variable is one of its captures
from an enclosing scope.

The analogous problem for ^{blocks} is already handled automagically
by D96215.

Differential Revision: https://reviews.llvm.org/D101787
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/bugprone-infinite-loop.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/bugprone-redundant-branch-condition.cpp
The file was modifiedclang-tools-extra/clang-tidy/utils/Aliasing.cpp
Commit 91ca3269a1b544db1303b496101fd9d6fe953277 by Artem Dergachev
[clang-tidy] Aliasing: Add support for aggregates with references.

When a variable is used in an initializer of an aggregate
for its reference-type field this counts as aliasing.

Differential Revision: https://reviews.llvm.org/D101791
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/bugprone-infinite-loop.cpp
The file was modifiedclang-tools-extra/clang-tidy/utils/Aliasing.cpp
Commit 8a74cc139d1fbafcf1dd0482490633924a46599a by spatel
[InstCombine] add tests for extract-subvector of insert; NFC
The file was modifiedllvm/test/Transforms/InstCombine/shufflevec-bitcast.ll
Commit 5577e866912e86147206ffc586e4f080c59ae4bf by spatel
[InstCombine] fold extract subvector of bitcast insertelt

This is visible in the original example from:
https://llvm.org/PR50055
(but this change doesn't solve the bug)

https://alive2.llvm.org/ce/z/vM_Yq-
The file was modifiedllvm/test/Transforms/InstCombine/shufflevec-bitcast.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
Commit 6dc2a6a8c9a0e4f8b46a0ba05430b77229789b8e by dblaikie
Remove some unnecessary explicit defaulted copy ctors to cleanup -Wdeprecated-copy

These types also wanted to be/were copy assignable, and using the
implicit copy ctor is deprecated in the presence of an explicit copy
ctor.

Removing the explicit copy ctor provides the desired behavior - both
ctor and assignment operator are available implicitly.

Also while I was nearby there were some missing std::moves on shared
pointer parameters.
The file was modifiedlldb/include/lldb/Utility/Timeout.h
The file was modifiedlldb/include/lldb/DataFormatters/DumpValueObjectOptions.h
The file was modifiedlldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
The file was modifiedlldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
The file was modifiedlldb/include/lldb/Symbol/UnwindPlan.h
Commit 174606877df46f3e8ce0c60a4c744687d3ee3271 by dblaikie
Clangd Matchers.h: Fix -Wdeprecated-copy by making the defaulted copy ctor and deleted copy assignment operators explicit
The file was modifiedclang-tools-extra/clangd/unittests/Matchers.h
Commit 8b9c15c2819bc4736e2c8315c6e0e71e8b7483bf by kparzysz
[Hexagon] Handle loads and stores of scalar predicate vectors

Handle v2i1, v4i1, and v8i1.
The file was modifiedllvm/lib/Target/Hexagon/HexagonISelLowering.cpp
The file was addedllvm/test/CodeGen/Hexagon/isel-memory-vNi1.ll
Commit a0fed635fe1701470062495a6ffee1c608f3f1bc by carrot
Pre-commit test case for D101970

This is a test case for D101970, which shows the optimization opportunity for

    lea (reg1, reg2), reg3
    sub reg3, reg4

to

    sub reg1, reg4
    sub reg2, reg4

Differential Revision: https://reviews.llvm.org/D102010
The file was addedllvm/test/CodeGen/X86/lea-opt2.ll
Commit 6d8b070d96197df6b5bf9fc2c53a78171ba64c6c by Jessica Paquette
[AArch64][GlobalISel] Enable memcpy family combines on minsize functions

The combines in `tryCombineMemCpyFamily` have heuristics (e.g.
`TLI.getMaxStoresPerMemset`) which consider size. So, theoretically, enabling
these combines on minsize functions shouldn't be harmful.

With this enabled we save 0.9% geomean on CTMark at -Oz, and 5.1% on Bullet.
There are no code size regressions.

Differential Revision: https://reviews.llvm.org/D102198
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/inline-memset.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
Commit 061e071d8c9b98526f35cad55a918a4f1615afd4 by thakis
Revert "[lld][WebAssembly] Initial support merging string data"

This reverts commit 5000a1b4b9edeb9e994f2a5b36da8d48599bea49.
Breaks tests, see https://reviews.llvm.org/D97657#2749151

Easily repros locally with `ninja check-llvm-mc-webassembly`.
The file was modifiedlld/wasm/Driver.cpp
The file was modifiedllvm/lib/Object/WasmObjectFile.cpp
The file was modifiedllvm/include/llvm/MC/MCSectionWasm.h
The file was modifiedllvm/include/llvm/MC/MCContext.h
The file was modifiedllvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
The file was modifiedlld/wasm/SyntheticSections.cpp
The file was modifiedllvm/lib/MC/MCObjectFileInfo.cpp
The file was modifiedlld/wasm/Symbols.cpp
The file was removedlld/test/wasm/merge-string.s
The file was removedlld/wasm/OutputSegment.cpp
The file was modifiedlld/wasm/CMakeLists.txt
The file was modifiedlld/wasm/OutputSegment.h
The file was modifiedllvm/lib/MC/MCContext.cpp
The file was modifiedllvm/lib/MC/MCParser/WasmAsmParser.cpp
The file was modifiedlld/wasm/InputChunks.h
The file was modifiedllvm/lib/ObjectYAML/WasmYAML.cpp
The file was modifiedlld/wasm/InputChunks.cpp
The file was removedllvm/test/MC/WebAssembly/section-flags-changed.s
The file was modifiedllvm/include/llvm/BinaryFormat/Wasm.h
The file was modifiedlld/wasm/Writer.cpp
The file was modifiedllvm/lib/MC/MCSectionWasm.cpp
The file was modifiedlld/wasm/InputFiles.cpp
The file was modifiedllvm/lib/MC/WasmObjectWriter.cpp
The file was modifiedllvm/tools/obj2yaml/wasm2yaml.cpp
The file was modifiedllvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp