Changes

Summary

  1. [clang-format][docs] mark new clang-format configuration options based on which version they would GA (details)
  2. Fix documentation typos; NFC (details)
  3. [AArch64] Split bitmask immediate of bitwise AND operation (details)
  4. [gn build] Port 864b206796ae (details)
  5. Simplify handling of builtin with inline redefinition (details)
  6. Revert "[clangd] Refactor IncludeStructure: use File (unsigned) for most computations" (details)
  7. [Docs][NFC] Add doxygen comment for AtomicExpandPass in passes.h (details)
  8. [VectorCombine] Discard ScalarizationResult state in early exit. (details)
  9. Add support for `NOLINTBEGIN` ... `NOLINTEND` comments (details)
  10. [Test] Add more tests with cycled phis (details)
  11. Revert "[flang] GET_COMMAND_ARGUMENT(VALUE) runtime implementation" (details)
  12. [lldb] Remove non-stop mode code (details)
  13. [lldb/test] Add ability to specify environment when spawning processes (details)
  14. [CMake] Add detection for the mold linker in AddLLVM.cmake. (details)
  15. Revert "[AArch64] Split bitmask immediate of bitwise AND operation" (details)
  16. Revert "[Test] Add more tests with cycled phis" (details)
  17. Reland "[flang] GET_COMMAND_ARGUMENT runtime implementation" (details)
  18. Recommit "[Test] Add more tests with cycled phis" (details)
  19. [lldb/test] Remove a check from TestLoadAfterAttach (details)
  20. Update the message for template-template param keyword for C++17 (details)
  21. [SLP]No need to schedule/check parent for extract{element/value} instruction. (details)
Commit 23a5090c6ac7a207f49a11bf868a7c3fae2aeea2 by mydeveloperday
[clang-format][docs] mark new clang-format configuration options based on which version they would GA

Sometimes I see people unsure about which options they can use in specific versions of clang-format because
https://clang.llvm.org/docs/ClangFormatStyleOptions.html points to the latest and greatest versions.

The reality is this says its version 13.0, but actually anything we add now, will not be in 13.0 GA but
instead 14.0 GA (as 13.0 has already been branched).

How about we introduce some nomenclature to the Format.h so that we can mark which options in the
documentation were introduced for which version?

Reviewed By: HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D110432
The file was modifiedclang/docs/tools/dump_format_style.py
The file was modifiedclang/docs/ClangFormatStyleOptions.rst
The file was modifiedclang/include/clang/Tooling/Inclusions/IncludeStyle.h
The file was modifiedclang/include/clang/Format/Format.h
Commit 4f01a02d738b033c10bfed5b47014fc197509a4f by aaron
Fix documentation typos; NFC

Fixes bugprone-virtual-near-miss & performance-type-promotion-in-math-fn.
The file was modifiedclang-tools-extra/docs/clang-tidy/checks/bugprone-virtual-near-miss.rst
The file was modifiedclang-tools-extra/docs/clang-tidy/checks/performance-type-promotion-in-math-fn.rst
Commit 864b206796ae8aa7f35f830655337751dbd9176c by jingu.kang
[AArch64] Split bitmask immediate of bitwise AND operation

MOVi32imm + ANDWrr ==> ANDWri + ANDWri
MOVi64imm + ANDXrr ==> ANDXri + ANDXri

The mov pseudo instruction could be expanded to multiple mov instructions later.
In this case, try to split the constant operand of mov instruction into two
bitmask immediates. It makes only two AND instructions intead of multiple
mov + and instructions.

Added a peephole optimization pass on MIR level to implement it.

Differential Revision: https://reviews.llvm.org/D109963
The file was modifiedllvm/test/CodeGen/AArch64/O3-pipeline.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64TargetMachine.cpp
The file was modifiedllvm/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h
The file was addedllvm/test/CodeGen/AArch64/aarch64-split-and-bitmask-immediate.ll
The file was modifiedllvm/test/CodeGen/AArch64/unfold-masked-merge-scalar-constmask-innerouter.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64.h
The file was modifiedllvm/lib/Target/AArch64/CMakeLists.txt
The file was addedllvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp
Commit 5aa4c74c9a2ee3c4e6e87adfa2ef218c5aeed1d6 by llvmgnsyncbot
[gn build] Port 864b206796ae
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Target/AArch64/BUILD.gn
Commit 3d6f49a56995b845c40be5827ded5d1e3f692cec by sguelton
Simplify handling of builtin with inline redefinition

It is a common practice in glibc header to provide an inline redefinition of an
existing function. It is especially the case for fortified function.

Clang currently has an imperfect approach to the problem, using a combination of
trivially recursive function detection and noinline attribute.

Simplify the logic by suffixing these functions by `.inline` during codegen, so
that they are not recognized as builtin by llvm.

After that patch, clang passes all tests from https://github.com/serge-sans-paille/fortify-test-suite

Differential Revision: https://reviews.llvm.org/D109967
The file was addedclang/test/CodeGen/memcpy-inline-builtin.c
The file was modifiedclang/test/CodeGen/memcpy-nobuiltin.c
The file was modifiedclang/test/CodeGen/pr9614.c
The file was removedclang/test/CodeGen/memcpy-no-nobuiltin-if-not-emitted.c
The file was modifiedclang/lib/CodeGen/CodeGenModule.cpp
The file was modifiedclang/lib/CodeGen/CodeGenFunction.cpp
Commit e7a5347b55e6050106bb61fa9a54920720806e07 by kbobyrev
Revert "[clangd] Refactor IncludeStructure: use File (unsigned) for most computations"

This reverts

- d1c6e54930f200c40820868c086e114cee1ec693
- 7394d3ba276adeb1527428b2355a920129a2b9b1
- e50771181b7e0d96b30ee33049dc05172125b927
- 1bcd6b51a98263d440ff7549070060f7e7b0326a
The file was modifiedclang-tools-extra/clangd/Headers.h
The file was modifiedclang-tools-extra/clangd/CodeComplete.cpp
The file was modifiedclang-tools-extra/clangd/unittests/ParsedASTTests.cpp
The file was modifiedclang-tools-extra/clangd/Headers.cpp
The file was modifiedclang-tools-extra/clangd/unittests/HeadersTests.cpp
Commit 1aa7b8388581d9b4a52a8d4c5d4f13d4bf6c0013 by shivam98.tkg
[Docs][NFC] Add doxygen comment for AtomicExpandPass in passes.h
The file was modifiedllvm/include/llvm/CodeGen/Passes.h
Commit e2f6290e06be63149af770197b772248369ac038 by flo
[VectorCombine] Discard ScalarizationResult state in early exit.

ScalarizationResult's destructor makes sure ToFreeze is not ignored if
set. Currently, scalarizeLoadExtract has an early exit if the index is
not safe directly. But when it is SafeWithFreeze, we need to discard the
state first, otherwise we hit the assert in the destructor.

Fixes PR51992.
The file was modifiedllvm/lib/Transforms/Vectorize/VectorCombine.cpp
The file was modifiedllvm/test/Transforms/VectorCombine/AArch64/load-extractelement-scalarization.ll
Commit c0687e1984a82925918c874b7bb68ad34c32aed0 by aaron
Add support for `NOLINTBEGIN` ... `NOLINTEND` comments

Add support for NOLINTBEGIN ... NOLINTEND comments to suppress
clang-tidy warnings over multiple lines. All lines between the "begin"
and "end" markers are suppressed.

Example:

// NOLINTBEGIN(some-check)
<Code with warnings to be suppressed, line 1>
<Code with warnings to be suppressed, line 2>
<Code with warnings to be suppressed, line 3>
// NOLINTEND(some-check)
Follows similar syntax as the NOLINT and NOLINTNEXTLINE comments
that are already implemented, i.e. allows multiple checks to be provided
in parentheses; suppresses all checks if the parentheses are omitted,
etc.

If the comments are misused, e.g. using a NOLINTBEGIN but not
terminating it with a NOLINTEND, a clang-tidy-nolint diagnostic
message pointing to the misuse is generated.

As part of implementing this feature, the following bugs were fixed in
existing code:

IsNOLINTFound(): IsNOLINTFound("NOLINT", Str) returns true when Str is
"NOLINTNEXTLINE". This is because the textual search finds NOLINT as
the stem of NOLINTNEXTLINE.

LineIsMarkedWithNOLINT(): NOLINTNEXTLINEs on the very first line of a
file are ignored. This is due to rsplit('\n\').second returning a blank
string when there are no more newline chars to split on.
The file was modifiedclang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h
The file was addedclang-tools-extra/test/clang-tidy/infrastructure/Inputs/nolintbeginend/error_in_include.inc
The file was addedclang-tools-extra/test/clang-tidy/infrastructure/nolintbeginend-end-at-sof.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/infrastructure/nolintnextline.cpp
The file was addedclang-tools-extra/test/clang-tidy/infrastructure/nolintbeginend-mismatched-delims.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/infrastructure/nolint.cpp
The file was addedclang-tools-extra/test/clang-tidy/infrastructure/nolintbeginend-mismatched-check-names.cpp
The file was addedclang-tools-extra/test/clang-tidy/infrastructure/nolintbeginend-begin-without-end.cpp
The file was modifiedclang-tools-extra/docs/clang-tidy/index.rst
The file was addedclang-tools-extra/test/clang-tidy/infrastructure/nolintbeginend-begin-at-eof.cpp
The file was addedclang-tools-extra/test/clang-tidy/infrastructure/nolintbeginend-begin-global-end-specific.cpp
The file was addedclang-tools-extra/test/clang-tidy/infrastructure/Inputs/nolintbeginend/nolint_in_include.inc
The file was modifiedclang-tools-extra/docs/ReleaseNotes.rst
The file was addedclang-tools-extra/test/clang-tidy/infrastructure/nolintbeginend-end-without-begin.cpp
The file was addedclang-tools-extra/test/clang-tidy/infrastructure/nolintbeginend-typo-in-check-name.cpp
The file was addedclang-tools-extra/test/clang-tidy/infrastructure/nolintbeginend.cpp
The file was modifiedclang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
The file was addedclang-tools-extra/test/clang-tidy/infrastructure/nolintbeginend-begin-specific-end-global.cpp
Commit 7128a545b3baa62c1164843103fb08daeba5cd9d by mkazantsev
[Test] Add more tests with cycled phis
The file was modifiedllvm/test/Analysis/ScalarEvolution/cycled_phis.ll
Commit 6359a4cdbfb83c67a2a776baba4e3f4fb8334853 by diana.picus
Revert "[flang] GET_COMMAND_ARGUMENT(VALUE) runtime implementation"

This reverts commit 0446f1299f6be9fd35bc5f458c78b34dca3105f6 and
df6302311f88d0fbc666b6277d029aa371039945.

There's a warning on flang-aarch64-latest-gcc related to strncpy using
the result of strlen as a bound. I'll recommit with a fix.
The file was modifiedflang/runtime/command.cpp
The file was modifiedflang/include/flang/Runtime/magic-numbers.h
The file was modifiedflang/runtime/stat.h
The file was modifiedflang/runtime/stat.cpp
The file was modifiedflang/unittests/Runtime/CommandTest.cpp
The file was modifiedflang/test/Runtime/no-cpp-dep.c
Commit 156cb4cc64bec2b72aad9848f8181b338ff19ebc by pavel
[lldb] Remove non-stop mode code

We added some support for this mode back in 2015, but the feature was
never productionized. It is completely untested, and there are known
major structural lldb issues that need to be resolved before this
feature can really be supported.

It also complicates making further changes to stop reply packet
handling, which is what I am about to do.

Differential Revision: https://reviews.llvm.org/D110553
The file was modifiedlldb/source/Target/Target.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h
The file was modifiedlldb/source/Target/TargetProperties.td
The file was modifiedlldb/include/lldb/Target/Target.h
The file was modifiedlldb/source/Commands/CommandObjectThread.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
Commit 9413ead7bcbaf5d8876ee484256df65c2846c5c9 by pavel
[lldb/test] Add ability to specify environment when spawning processes

We only had that ability for regular debugger launches. This meant that
it was not possible to use the normal dlopen patterns in attach tests.
This fixes that.
The file was modifiedlldb/test/API/functionalities/load_after_attach/TestLoadAfterAttach.py
The file was modifiedlldb/test/API/functionalities/load_after_attach/main.cpp
The file was modifiedlldb/packages/Python/lldbsuite/test/lldbtest.py
Commit 5b125a49ba9f52cb6b24767f3c98ce623a2d5207 by shivam98.tkg
[CMake] Add detection for the mold linker in AddLLVM.cmake.

mold says it is compatible with GNU ld and gold linkers:

```
$ mold -v
mold 0.9.5 (compatible with GNU ld and GNU gold)
```

And thus it currently gets detected as Gold.

With the following diff, CMake now correctly reports the linker name, and mold keeps being identified as Gold internally for now.

Reviewed By: ldionne, MaskRay

Differential Revision: https://reviews.llvm.org/D110035
The file was modifiedllvm/cmake/modules/AddLLVM.cmake
Commit f85d8a5bed95cc17a452b6b63b9866fbf181d94d by jingu.kang
Revert "[AArch64] Split bitmask immediate of bitwise AND operation"

This reverts commit 864b206796ae8aa7f35f830655337751dbd9176c.

Reverting due to error on buildbots.
The file was modifiedllvm/test/CodeGen/AArch64/O3-pipeline.ll
The file was removedllvm/test/CodeGen/AArch64/aarch64-split-and-bitmask-immediate.ll
The file was removedllvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp
The file was modifiedllvm/test/CodeGen/AArch64/unfold-masked-merge-scalar-constmask-innerouter.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64TargetMachine.cpp
The file was modifiedllvm/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h
The file was modifiedllvm/lib/Target/AArch64/AArch64.h
The file was modifiedllvm/lib/Target/AArch64/CMakeLists.txt
Commit a91145f75af4f00c37d767a9ee408c62655ceb44 by mkazantsev
Revert "[Test] Add more tests with cycled phis"

This reverts commit 7128a545b3baa62c1164843103fb08daeba5cd9d.

Need to regenerate tests after rebase.
The file was modifiedllvm/test/Analysis/ScalarEvolution/cycled_phis.ll
Commit 37089bae29a92b97e16be4795553b68a6b04ff91 by diana.picus
Reland "[flang] GET_COMMAND_ARGUMENT runtime implementation"

Recommit https://reviews.llvm.org/D109813 and
https://reviews.llvm.org/D109814.

This implements the second and final entry point for GET_COMMAND_ARGUMENT,
handling the VALUE, STATUS and ERRMSG parameters.

It has a small fix in that we're now using memcpy instead of strncpy
(which was a bad idea to begin with, since we're not actually interested
in a string copy).
The file was modifiedflang/include/flang/Runtime/magic-numbers.h
The file was modifiedflang/runtime/stat.h
The file was modifiedflang/runtime/stat.cpp
The file was modifiedflang/runtime/command.cpp
The file was modifiedflang/test/Runtime/no-cpp-dep.c
The file was modifiedflang/unittests/Runtime/CommandTest.cpp
Commit 00be84f910dc2816a07925e7e0f4c647c1e2f83d by mkazantsev
Recommit "[Test] Add more tests with cycled phis"
The file was modifiedllvm/test/Analysis/ScalarEvolution/cycled_phis.ll
Commit 7866dbb261240f71c79e70d2ed52351846f795cd by pavel
[lldb/test] Remove a check from TestLoadAfterAttach

The two module retrieval methods (qXfer:libraries-svr4 and manual list
traversal) differ in how the handle the
manually-added-but-not-yet-loaded modules. The svr4 path will remove it,
while the manual one will keep in the list.

It's likely the two paths need ought to be synchronized, but right now,
this distinction is not relevant for the test.
The file was modifiedlldb/test/API/functionalities/load_after_attach/TestLoadAfterAttach.py
Commit 45e75d93821f7e4f04d9f42cb19f729b346e7c0c by erich.keane
Update the message for template-template param keyword for C++17

C++17 permits using 'typename' or 'class' for a template template
parameter, but the error message in the parser only refers to 'class'.
This patch, in C++17 or newer modes, adds "or 'template'" to the
diagnostic.
The file was modifiedclang/include/clang/Basic/DiagnosticParseKinds.td
The file was modifiedclang/lib/Parse/ParseTemplate.cpp
The file was modifiedclang/test/Parser/cxx-template-decl.cpp
The file was modifiedclang/test/Parser/cxx2a-concept-declaration.cpp
Commit 8bacfb9bedf10a2e446db072be2c1cd2cd1d7aab by a.bataev
[SLP]No need to schedule/check parent for extract{element/value} instruction.

The instruction extractelement/extractvalue are not required to
be scheduled since they only depend on the source vector/aggregate (with
constant indices), smae applies to the parent basic block checks.
Improves compile time and saves scheduling budget.

Differential Revision: https://reviews.llvm.org/D108703
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/remark_extract_broadcast.ll