SuccessChanges

Summary

  1. [lld-link] Add /reproduce: support for several flags (details)
  2. [AArch64][GlobalISel] Support lowering <1 x i8> arguments. (details)
  3. [GloblalISel] Support lowering <3 x i8> arguments in multiple parts. (details)
  4. [InstrProfiling] Use ELF section groups for counters, data and values (details)
  5. [clangd] Narrow and document a loophole in blockUntilIdle (details)
  6. [clangd] Shutdown sequence for modules, and doc threading requirements (details)
  7. Modify TypePrinter to differentiate between anonymous struct and unnamed struct (details)
  8. scudo: Support memory tagging in the secondary allocator. (details)
  9. [ValueTracking] Improve ComputeNumSignBits for SRem. (details)
  10. [AArch64][GlobalISel] Match G_SHUFFLE_VECTOR -> insert elt + extract elt (details)
  11. DebugInfo: Emit "LocalToUnit" flag on local member function decls. (details)
  12. [RISCV] Have sexti32 also recognize AssertZExt from types smaller than i32. (details)
  13. [CMake] Don't optimize tests so much under ThinLTO (details)
  14. [AMDGPU] Move RPT::getLiveRegs() check under EXPENSIVE_CHECKS (details)
  15. Add auto-upgrade support for annotation intrinsics (details)
Commit e6d1f261a5a08d4c05b25509a6f4217a8a1c2188 by thakis
[lld-link] Add /reproduce: support for several flags

/reproduce: now works correctly with:
- /call-graph-ordering-file:
- /def:
- /natvis:
- /order:
- /pdbstream:

I went through all instances of MemoryBuffer::getFile() and made sure
everything that didn't already do so called takeBuffer().

For natvis, that wasn't possible since DebugInfo/PDB wants to take
owernship of the natvis buffer. For that case, I'm manually adding the
tar file entry.

/natvis: and /pdbstream: is slightly awkward, since createResponseFile()
always adds these flags to the response file but createPDB() (which
ultimately adds the files referenced by the flags) is only called if
/debug is also passed. So when using /natvis: without /debug with
/reproduce:, lld won't warn, but when linking using the response
file from the archive, it won't find the natvis file since it's not
in the tar. This isn't a new issue though, and after this patch things
at least work with using /natvis: _with_ debug with /reproduce:.
(Same for /pdbstream:)

Differential Revison: https://reviews.llvm.org/D97212
The file was modifiedlld/test/COFF/linkrepro.test
The file was modifiedlld/test/COFF/linkrepro-pdb.test
The file was modifiedlld/COFF/PDB.cpp
The file was modifiedlld/COFF/Driver.h
The file was modifiedlld/COFF/Driver.cpp
The file was modifiedlld/test/COFF/linkrepro-manifest.test
Commit 69ce291bcc1e094478a5751cc52e8c54b9f2a190 by Amara Emerson
[AArch64][GlobalISel] Support lowering <1 x i8> arguments.

We don't yet have working codegen for the resulting unmerges, and if
we did it would probably be horrible.

Differential Revision: https://reviews.llvm.org/D97035
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/vec-s16-param.ll
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/call-lowering-vectors.ll
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/ret-1x-vec.ll
The file was modifiedllvm/lib/CodeGen/GlobalISel/CallLowering.cpp
Commit 212d6a95abe67f038a6d9a26d2226f07c3132d0e by Amara Emerson
[GloblalISel] Support lowering <3 x i8> arguments in multiple parts.

Differential Revision: https://reviews.llvm.org/D97086
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/call-lowering-vectors.ll
The file was modifiedllvm/lib/CodeGen/GlobalISel/CallLowering.cpp
Commit c24b7a16b1001a8978335183d958fd0aa482c1d9 by phosek
[InstrProfiling] Use ELF section groups for counters, data and values

__start_/__stop_ references retain C identifier name sections such as
__llvm_prf_*. Putting these into a section group disables this logic.

The ELF section group semantics ensures that group members are retained
or discarded as a unit. When a function symbol is discarded, this allows
allows linker to discard counters, data and values associated with that
function symbol as well.

Note that `noduplicates` COMDAT is lowered to zero-flag section group in
ELF. We only set this for functions that aren't already in a COMDAT and
for those that don't have available_externally linkage since we already
use regular COMDAT groups for those.

Differential Revision: https://reviews.llvm.org/D96757
The file was modifiedllvm/test/Instrumentation/InstrProfiling/platform.ll
The file was modifiedcompiler-rt/test/CMakeLists.txt
The file was modifiedllvm/test/Transforms/PGOProfile/counter_promo.ll
The file was addedcompiler-rt/test/profile/instrprof-gc-sections.c
The file was modifiedllvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
The file was modifiedllvm/test/Transforms/PGOProfile/counter_promo_mexits.ll
The file was modifiedllvm/test/Instrumentation/InstrProfiling/linkage.ll
The file was modifiedllvm/test/Instrumentation/InstrProfiling/icall.ll
The file was modifiedcompiler-rt/test/profile/CMakeLists.txt
Commit 2d9cfcfef029952511462ee45c49c1bf223b9495 by sam.mccall
[clangd] Narrow and document a loophole in blockUntilIdle

blockUntilIdle of a parent can't always be correctly implemented as
  return ChildA.blockUntilIdle() && ChildB.blockUntilIdle()
The problem is that B can schedule work on A while we're waiting on it.

I believe this is theoretically possible today between CDB and background index.
Modules open more possibilities and it's hard to reason about all of them.

I don't have a perfect fix, and the abstraction is too good to lose. this patch:
- calls out why we block on workscheduler first, and asserts correctness
- documents the issue
- reduces the practical possibility of spuriously returning true significantly

This function is ultimately only for testing, so we're driving down flake rate.

Differential Revision: https://reviews.llvm.org/D96856
The file was modifiedclang-tools-extra/clangd/ClangdServer.cpp
The file was modifiedclang-tools-extra/clangd/ClangdServer.h
Commit f0e69272c62f2b7a39687748db60d21445010ac5 by sam.mccall
[clangd] Shutdown sequence for modules, and doc threading requirements

This allows modules to do work on non-TUScheduler background threads.

Differential Revision: https://reviews.llvm.org/D96755
The file was modifiedclang-tools-extra/clangd/ClangdServer.h
The file was modifiedclang-tools-extra/clangd/Module.h
The file was modifiedclang-tools-extra/clangd/ClangdServer.cpp
The file was modifiedclang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp
Commit 50542d504dd869fe1241a9cc987b72ead5a56073 by Shafik Yaghmour
Modify TypePrinter to differentiate between anonymous struct and unnamed struct

Currently TypePrinter lumps anonymous classes and unnamed classes in one group "anonymous" this is not correct and can be confusing in some contexts.

Differential Revision: https://reviews.llvm.org/D96807
The file was modifiedclang-tools-extra/clangd/unittests/FindSymbolsTests.cpp
The file was modifiedclang/test/AST/ast-dump-openmp-target-teams-distribute-parallel-for-simd.c
The file was modifiedclang/test/AST/ast-dump-openmp-teams-distribute-parallel-for.c
The file was modifiedclang/test/AST/ast-dump-openmp-target-teams.c
The file was modifiedclang/test/AST/ast-dump-openmp-simd.c
The file was modifiedclang/test/AST/ast-dump-openmp-target-teams-distribute.c
The file was modifiedclang/test/AST/ast-dump-openmp-task.c
The file was modifiedclang/test/AST/ast-dump-enum-json.cpp
The file was modifiedclang/test/AST/ast-dump-openmp-taskloop-simd.c
The file was modifiedclang/test/AST/ast-dump-openmp-target-teams-distribute-parallel-for.c
The file was modifiedclang/test/AST/ast-dump-openmp-target-parallel-for-simd.c
The file was modifiedclang/test/AST/ast-dump-openmp-parallel-for.c
The file was modifiedclang/test/AST/ast-dump-openmp-distribute-simd.c
The file was modifiedclang/test/SemaCXX/warn-sign-conversion.cpp
The file was modifiedclang/test/AST/ast-dump-openmp-taskgroup.c
The file was modifiedclang/test/AST/ast-dump-openmp-for.c
The file was modifiedclang/test/AST/ast-dump-openmp-section.c
The file was modifiedclang/test/AST/ast-dump-openmp-target-data.c
The file was modifiedclang/test/AST/ast-dump-openmp-target.c
The file was modifiedclang/test/AST/ast-dump-openmp-teams-distribute-parallel-for-simd.c
The file was modifiedclang/test/AST/ast-dump-openmp-distribute-parallel-for-simd.c
The file was modifiedclang/test/SemaCXX/condition.cpp
The file was modifiedclang/test/AST/ast-dump-openmp-target-parallel.c
The file was modifiedclang/test/Index/print-type.c
The file was modifiedlldb/test/Shell/SymbolFile/DWARF/clang-ast-from-dwarf-unamed-and-anon-structs.cpp
The file was modifiedclang/test/AST/ast-dump-openmp-taskloop.c
The file was modifiedclang/test/AST/ast-dump-openmp-target-simd.c
The file was modifiedclang/test/AST/ast-dump-openmp-teams-distribute.c
The file was modifiedclang/test/AST/ast-dump-records.c
The file was modifiedclang/test/AST/ast-dump-decl-json.c
The file was modifiedlldb/test/Shell/SymbolFile/DWARF/debug-types-missing-signature.test
The file was modifiedclang/test/AST/ast-dump-openmp-teams-distribute-simd.c
The file was modifiedclang/test/AST/ast-dump-openmp-cancellation-point.c
The file was modifiedclang/test/AST/ast-dump-stmt-json.m
The file was modifiedclang/test/AST/ast-dump-openmp-target-teams-distribute-simd.c
The file was modifiedclang/test/ASTMerge/struct/test.c
The file was modifiedclang/test/AST/ast-dump-openmp-distribute-parallel-for.c
The file was modifiedclang/test/AST/ast-dump-openmp-parallel.c
The file was modifiedclang/test/AST/ast-dump-openmp-for-simd.c
The file was modifiedclang/test/Sema/switch.c
The file was modifiedclang/test/AST/ast-dump-openmp-ordered.c
The file was modifiedclang/test/AST/ast-dump-openmp-target-parallel-for.c
The file was modifiedclang/test/AST/ast-dump-openmp-parallel-sections.c
The file was modifiedclang/test/Index/print-type.cpp
The file was modifiedclang/test/AST/ast-dump-openmp-distribute.c
The file was modifiedclang/test/Layout/ms-x86-alias-avoidance-padding.cpp
The file was modifiedclang/test/AST/ast-dump-openmp-target-exit-data.c
The file was modifiedclang/test/AST/ast-dump-openmp-teams.c
The file was modifiedclang/test/Analysis/padding_c.c
The file was modifiedclang/test/PCH/stmt-openmp_structured_block-bit.cpp
The file was modifiedclang/test/SemaCXX/enum.cpp
The file was modifiedclang-tools-extra/clangd/unittests/HoverTests.cpp
The file was modifiedclang/test/AST/ast-dump-openmp-parallel-for-simd.c
The file was modifiedclang/test/AST/ast-dump-openmp-target-enter-data.c
The file was modifiedclang/test/Sema/assign.c
The file was modifiedclang/test/AST/ast-dump-records-json.cpp
The file was modifiedclang/test/AST/ast-dump-records.cpp
The file was modifiedclang/test/AST/ast-dump-openmp-sections.c
The file was modifiedclang/test/AST/ast-dump-openmp-single.c
The file was modifiedclang/lib/AST/TypePrinter.cpp
The file was modifiedclang/test/Analysis/cfg.cpp
The file was modifiedclang/test/AST/ast-dump-openmp-target-update.c
The file was modifiedclang/test/AST/ast-dump-openmp-cancel.c
Commit 7a0da8894348e55d06403ec3af35fb65f97e31fa by peter
scudo: Support memory tagging in the secondary allocator.

This patch enhances the secondary allocator to be able to detect buffer
overflow, and (on hardware supporting memory tagging) use-after-free
and buffer underflow.

Use-after-free detection is implemented by setting memory page
protection to PROT_NONE on free. Because this must be done immediately
rather than after the memory has been quarantined, we no longer use the
combined allocator quarantine for secondary allocations. Instead, a
quarantine has been added to the secondary allocator cache.

Buffer overflow detection is implemented by aligning the allocation
to the right of the writable pages, so that any overflows will
spill into the guard page to the right of the allocation, which
will have PROT_NONE page protection. Because this would require the
secondary allocator to produce a header at the correct position,
the responsibility for ensuring chunk alignment has been moved to
the secondary allocator.

Buffer underflow detection has been implemented on hardware supporting
memory tagging by tagging the memory region between the start of the
mapping and the start of the allocation with a non-zero tag. Due to
the cost of pre-tagging secondary allocations and the memory bandwidth
cost of tagged accesses, the allocation itself uses a tag of 0 and
only the first four pages have memory tagging enabled.

Differential Revision: https://reviews.llvm.org/D93731
The file was modifiedcompiler-rt/lib/scudo/standalone/combined.h
The file was modifiedcompiler-rt/lib/scudo/standalone/allocator_config.h
The file was modifiedcompiler-rt/lib/scudo/standalone/tsd_shared.h
The file was modifiedcompiler-rt/lib/scudo/standalone/fuchsia.cpp
The file was modifiedcompiler-rt/lib/scudo/standalone/memtag.h
The file was modifiedcompiler-rt/lib/scudo/standalone/tests/combined_test.cpp
The file was modifiedcompiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
The file was modifiedcompiler-rt/lib/scudo/standalone/secondary.h
The file was modifiedcompiler-rt/lib/scudo/standalone/tsd_exclusive.h
The file was modifiedcompiler-rt/lib/scudo/standalone/common.h
The file was modifiedcompiler-rt/lib/scudo/standalone/primary64.h
The file was modifiedcompiler-rt/lib/scudo/standalone/linux.cpp
Commit 89440df64a5bf9981111e5980647e958f132b6a9 by craig.topper
[ValueTracking] Improve ComputeNumSignBits for SRem.

The result will have the same sign as the dividend unless the
result is 0. The magnitude of the result will always be less
than or equal to the dividend. So the result will have at least
as many sign bits as the dividend.

Previously we would do this if the divisor was a positive constant,
but that isn't required.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D97170
The file was modifiedllvm/test/Transforms/InstCombine/with_overflow.ll
The file was modifiedllvm/lib/Analysis/ValueTracking.cpp
Commit 867e379c0e14527eb7aa68485a10324693e35f5d by Jessica Paquette
[AArch64][GlobalISel] Match G_SHUFFLE_VECTOR -> insert elt + extract elt

Match a G_SHUFFLE_VECTOR with a mask that allows it to be represented as a
G_INSERT_VECTOR_ELT and a G_EXTRACT_VECTOR_ELT.

This ports `isINSMask` from AArch64ISelLowering and the portion of
`AArch64TargetLowering::LowerVECTOR_SHUFFLE` which handles the equivalent
transformation.

This provides more opportunities for matching DUP. We don't have all of the
necessary combines to actually make DUP out of these yet, but this is better for
size than the full TBL expansion for G_SHUFFLE_VECTOR.

This is a -0.1% code size improvement on CTMark/Bullet at -Os.

IR example: https://godbolt.org/z/sdcevT

Differential Revision: https://reviews.llvm.org/D97214
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/postlegalizer-lowering-shuf-to-ins.mir
The file was modifiedllvm/lib/Target/AArch64/AArch64Combine.td
Commit fe2dcd89acfd9301a230e38e9030734553baa8dc by jyknight
DebugInfo: Emit "LocalToUnit" flag on local member function decls.

Previously, the definition was so-marked, but the declaration was
not. This resulted in LLVM's dwarf emission treating the function as
being external, and incorrectly emitting DW_AT_external.

Differential Revision: https://reviews.llvm.org/D96044
The file was modifiedclang/lib/CodeGen/CGDebugInfo.cpp
The file was modifiedclang/test/CodeGenCXX/debug-info-class.cpp
Commit 3231607ce95fb34adcddbdd55f8bb00b4a2a2125 by craig.topper
[RISCV] Have sexti32 also recognize AssertZExt from types smaller than i32.

An i64 AssertZExt from a type smaller than i32 has at least 33
leading zeros which mean it has at least 33 sign bits.

Since we have a couple patterns that use two sexti32, I've
switched to a ComplexPattern so tablegen didn't have to generate
9 different permutations.

As noted in the FIXME, maybe we should just call computeNumSignBits,
but we don't have tests that benefit from that yet.

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D97130
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfo.td
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoF.td
The file was modifiedllvm/test/CodeGen/RISCV/rv64m-exhaustive-w-insts.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoM.td
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoD.td
The file was modifiedllvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoZfh.td
Commit e765324d89ef702ec287966f5132527d8de67b22 by aeubanks
[CMake] Don't optimize tests so much under ThinLTO

This drops check-llvm under -DLLVM_ENABLE_LTO=Thin from 13m to 10m20s on Windows and 20m to 15m35s on Linux.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D96618
The file was modifiedllvm/cmake/modules/AddLLVM.cmake
Commit bb16efe28030e26f9e5e0eaecfe729a3f1ff2ca7 by Stanislav.Mekhanoshin
[AMDGPU] Move RPT::getLiveRegs() check under EXPENSIVE_CHECKS

This is too expensive even for debug builds. It doubles
scheduling time if enabled.

Differential Revision: https://reviews.llvm.org/D97232
The file was modifiedllvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
Commit 9a827906cb95e7c3ae94627558da67b47ffde249 by andrew.kaylor
Add auto-upgrade support for annotation intrinsics

The llvm.ptr.annotation and llvm.var.annotation intrinsics were changed
since the 11.0 release to add an additional parameter. This patch
auto-upgrades IR containing the four-parameter versions of these
intrinsics, adding a null pointer as the fifth argument.

Differential Revision: https://reviews.llvm.org/D95993
The file was addedllvm/test/Bitcode/upgrade-ptr-annotation.ll
The file was addedllvm/test/Bitcode/upgrade-var-annotation.ll.bc
The file was modifiedllvm/lib/IR/AutoUpgrade.cpp
The file was addedllvm/test/Bitcode/upgrade-var-annotation.ll
The file was addedllvm/test/Bitcode/upgrade-ptr-annotation.ll.bc