SuccessChanges

Summary

  1. [ARM] Additional test for Min loop. NFC (details)
  2. [clang-format] [NFC] Fix spelling and grammatical errors in IncludeBlocks text (details)
  3. [clang-format] PR42434 Remove preprocessor and pragma lines from ObjectiveC guess (details)
  4. [clang-format] Add IndentPragma style to eliminate common clang-format off scenario (details)
  5. [clang-format] NFC Add release note for IndentPragmas (details)
  6. [lldb] Allow LLDB to automatically retry a failed expression with an imported std C++ module (details)
  7. [clang-tidy][NFC] Use moves instead of copies when constructing OptionsProviders. (details)
  8. [AMDGPU] Resolve issues when picking between ds_read/write and ds_read2/write2 (details)
  9. [dsymutil][DWARFLinker][NFC] Make interface of AddressMap more general. (details)
  10. [llvm-rc] Handle driveless absolute windows paths when loading external files (details)
  11. [ARM][RegAlloc] Add t2LoopEndDec (details)
  12. [clangd] NFC: Use SmallVector<T> where possible (details)
  13. [lldb] Fix that symbols.clang-modules-cache-path is never initialized (details)
Commit 5abbf20f0fe5a1fed0d455bc682ca20d0eb651f7 by david.green
[ARM] Additional test for Min loop. NFC
The file was addedllvm/test/CodeGen/Thumb2/LowOverheadLoops/minloop.ll
Commit 254677e9ed4e705c1138166dc8053edad8ee7ed3 by mydeveloperday
[clang-format] [NFC] Fix spelling and grammatical errors in IncludeBlocks text

Fix spelling mistake
Leave space after `.` and before beginning of next sentence
Reword it slightly to try and make it more readable.
Ensure RST is updated correctly (it generated a change)

Reviewed By: HazardyKnusperkeks, curdeius

Differential Revision: https://reviews.llvm.org/D92822
The file was modifiedclang/docs/ClangFormatStyleOptions.rst
The file was modifiedclang/include/clang/Tooling/Inclusions/IncludeStyle.h
Commit 7b2d62fd7f7befda2ce327d25075b0aac9bc6780 by mydeveloperday
[clang-format] PR42434 Remove preprocessor and pragma lines from ObjectiveC guess

clang-format see the `disable:` in   __pragma(warning(disable:)) as ObjectiveC method call

Remove any line starting with `#` or __pragma line from being part of the ObjectiveC guess

https://bugs.llvm.org/show_bug.cgi?id=42434

Reviewed By: curdeius, krasimir

Differential Revision: https://reviews.llvm.org/D92922
The file was modifiedclang/unittests/Format/FormatTest.cpp
The file was modifiedclang/lib/Format/Format.cpp
Commit e9e6e3b34a8e0857a274df51aac27e88c1de402b by mydeveloperday
[clang-format] Add IndentPragma style to eliminate common clang-format off scenario

A quick search of github.com, shows one common scenario for excessive use of //clang-format off/on is the indentation of #pragma's, especially around the areas of loop optimization or OpenMP

This revision aims to help that by introducing an `IndentPragmas` style, the aim of which is to keep the pragma at the current level of scope

```
    for (int i = 0; i < 5; i++) {
// clang-format off
        #pragma HLS UNROLL
        // clang-format on
        for (int j = 0; j < 5; j++) {
// clang-format off
            #pragma HLS UNROLL
            // clang-format on
     ....
```

can become

```
    for (int i = 0; i < 5; i++) {
        #pragma HLS UNROLL
        for (int j = 0; j < 5; j++) {
            #pragma HLS UNROLL
        ....
```

This revision also support working alongside the `IndentPPDirective` of `BeforeHash` and `AfterHash` (see unit tests for examples)

Reviewed By: curdeius

Differential Revision: https://reviews.llvm.org/D92753
The file was modifiedclang/lib/Format/UnwrappedLineParser.cpp
The file was modifiedclang/docs/ClangFormatStyleOptions.rst
The file was modifiedclang/lib/Format/Format.cpp
The file was modifiedclang/include/clang/Format/Format.h
The file was modifiedclang/lib/Format/ContinuationIndenter.cpp
The file was modifiedclang/lib/Format/UnwrappedLineFormatter.cpp
The file was modifiedclang/unittests/Format/FormatTest.cpp
The file was modifiedclang/lib/Format/UnwrappedLineParser.h
Commit 95616a033c16146b55352c5fb93af82e00422920 by mydeveloperday
[clang-format] NFC Add release note for IndentPragmas

Add additional release note to announce new clang-format option added during {D92753}
The file was modifiedclang/docs/ReleaseNotes.rst
Commit 958608285eb4d04c6e3dc7071fa429b43597585b by Raphael Isemann
[lldb] Allow LLDB to automatically retry a failed expression with an imported std C++ module

By now LLDB can import the 'std' C++ module to improve expression evaluation,
but there are still a few problems to solve before we can do this by default.
One is that importing the C++ module is slightly slower than normal expression
evaluation (mostly because the disk access and loading the initial lookup data
is quite slow in comparison to the barebone Clang setup the rest of the LLDB
expression evaluator is usually doing). Another problem is that some complicated
types in the standard library aren't fully supported yet by the ASTImporter, so
we end up types that fail to import (which usually appears to the user as if the
type is empty or there is just no result variable).

To still allow people to adopt this mode in their daily debugging, this patch
adds a setting that allows LLDB to automatically retry failed expression with a
loaded C++ module. All success expressions will behave exactly as they would do
before this patch. Failed expressions get a another parse attempt if we find a
usable C++ module in the current execution context. This way we shouldn't have
any performance/parsing regressions in normal debugging workflows, while the
debugging workflows involving STL containers benefit from the C++ module type
info.

This setting is off by default for now with the intention to enable it by
default on macOS soon-ish.

The implementation is mostly just extracting the existing parse logic into its
own function and then calling the parse function again if the first evaluation
failed and we have a C++ module to retry the parsing with.

Reviewed By: shafik, JDevlieghere, aprantl

Differential Revision: https://reviews.llvm.org/D92784
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
The file was addedlldb/test/API/commands/expression/import-std-module/retry-with-std-module/main.cpp
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
The file was modifiedlldb/source/Target/TargetProperties.td
The file was modifiedlldb/source/Target/Target.cpp
The file was addedlldb/test/API/commands/expression/import-std-module/retry-with-std-module/TestRetryWithStdModule.py
The file was modifiedlldb/include/lldb/Target/Target.h
The file was addedlldb/test/API/commands/expression/import-std-module/retry-with-std-module/Makefile
Commit bedf3a0f507113bb09acaa317c533d85fe52518a by n.james93
[clang-tidy][NFC] Use moves instead of copies when constructing OptionsProviders.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D92267
The file was modifiedclang-tools-extra/clang-tidy/ClangTidyOptions.cpp
The file was modifiedclang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
The file was modifiedclang-tools-extra/clang-tidy/ClangTidyOptions.h
Commit 0c7cce54eba3249489530040f41103dd8e0049f7 by Mirko.Brkusanin
[AMDGPU] Resolve issues when picking between ds_read/write and ds_read2/write2

Both ds_read_b128 and ds_read2_b64 are valid for 128bit 16-byte aligned
loads but the one that will be selected is determined either by the order in
tablegen or by the AddedComplexity attribute. Currently ds_read_b128 has
priority.

While ds_read2_b64 has lower alignment requirements, we cannot always
restrict ds_read_b128 to 16-byte alignment because of unaligned-access-mode
option. This was causing ds_read_b128 to be selected for 8-byte aligned
loads regardles of chosen access mode.

To resolve this we use two patterns for selecting ds_read_b128. One
requires alignment of 16-byte and the other requires
unaligned-access-mode option.

Same goes for ds_write2_b64 and ds_write_b128.

Differential Revision: https://reviews.llvm.org/D92767
The file was modifiedllvm/test/CodeGen/AMDGPU/load-local.128.ll
The file was modifiedllvm/lib/Target/AMDGPU/DSInstructions.td
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/store-local.128.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPU.td
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-load-local-128.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/lds-misaligned-bug.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/load-local.128.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/store-local.128.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/lds-misaligned-bug.ll
Commit 693da9df7481c48dd1edb93e78c66ec57fddeb60 by a.v.lapshin
[dsymutil][DWARFLinker][NFC] Make interface of AddressMap more general.

Current interface of AddressMap assumes that relocations exist.
That is correct for not-linked object file but is not correct
for linked executable. This patch changes interface in such way
that AddressMap could be used not only with not-linked object files:

hasValidRelocationAt()

replaced with:

hasLiveMemoryLocation()
hasLiveAddressRange()

Differential Revision: https://reviews.llvm.org/D87723
The file was modifiedllvm/include/llvm/DWARFLinker/DWARFLinker.h
The file was modifiedllvm/tools/dsymutil/DwarfLinkerForBinary.h
The file was modifiedllvm/lib/DWARFLinker/DWARFLinker.cpp
The file was modifiedllvm/tools/dsymutil/DwarfLinkerForBinary.cpp
Commit 879c15e890b4d25d28ea904e92497f091f796019 by martin
[llvm-rc] Handle driveless absolute windows paths when loading external files

When llvm-rc loads an external file, it looks for it relative to
a number of include directories and the current working directory.
If the path is considered absolute, llvm-rc tries to open the
filename as such, and doesn't try to open it relative to other
paths.

On Windows, a path name like "\dir\file" isn't considered absolute
as it lacks the drive name, but by appending it on top of the search
dirs, it's not found.

LLVM's sys::path::append just appends such a path (same with a properly
absolute posix path) after the paths it's supposed to be relative to.

This fix doesn't handle the case if the resource script and the
external file are on a different drive than the current working
directory; to fix that, we'd have to make LLVM's sys::path::append
handle appending fully absolute and partially absolute paths (ones
lacking a drive prefix but containing a root directory), or switch
to C++17's std::filesystem.

Differential Revision: https://reviews.llvm.org/D92558
The file was modifiedllvm/test/tools/llvm-rc/absolute.test
The file was modifiedllvm/tools/llvm-rc/ResourceFileWriter.cpp
Commit 0447f3508f0217e06b4acaaec0937091d071100a by david.green
[ARM][RegAlloc] Add t2LoopEndDec

We currently have problems with the way that low overhead loops are
specified, with LR being spilled between the t2LoopDec and the t2LoopEnd
forcing the entire loop to be reverted late in the backend. As they will
eventually become a single instruction, this patch introduces a
t2LoopEndDec which is the combination of the two, combined before
registry allocation to make sure this does not fail.

Unfortunately this instruction is a terminator that produces a value
(and also branches - it only produces the value around the branching
edge). So this needs some adjustment to phi elimination and the register
allocator to make sure that we do not spill this LR def around the loop
(needing to put a spill after the terminator). We treat the loop very
carefully, making sure that there is nothing else like calls that would
break it's ability to use LR. For that, this adds a
isUnspillableTerminator to opt in the new behaviour.

There is a chance that this could cause problems, and so I have added an
escape option incase. But I have not seen any problems in the testing
that I've tried, and not reverting Low overhead loops is important for
our performance. If this does work then we can hopefully do the same for
t2WhileLoopStart and t2DoLoopStart instructions.

This patch also contains the code needed to convert or revert the
t2LoopEndDec in the backend (which just needs a subs; bne) and the code
pre-ra to create them.

Differential Revision: https://reviews.llvm.org/D91358
The file was modifiedllvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/mve-float-loops.ll
The file was modifiedllvm/lib/CodeGen/PHIElimination.cpp
The file was modifiedllvm/lib/CodeGen/MachineVerifier.cpp
The file was modifiedllvm/lib/CodeGen/CalcSpillWeights.cpp
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/minloop.ll
The file was modifiedllvm/lib/Target/ARM/ARMBaseInstrInfo.h
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/fast-fp-loops.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-float32regloops.ll
The file was modifiedllvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
The file was modifiedllvm/test/CodeGen/Thumb2/mve-postinc-lsr.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-postinc-dct.ll
The file was modifiedllvm/lib/Target/ARM/MVEVPTOptimisationsPass.cpp
The file was modifiedllvm/test/CodeGen/Thumb2/mve-satmul-loops.ll
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/count_dominates_start.mir
The file was modifiedllvm/lib/Target/ARM/ARMInstrThumb2.td
The file was modifiedllvm/include/llvm/CodeGen/TargetInstrInfo.h
The file was modifiedllvm/test/CodeGen/Thumb2/mve-vldshuffle.ll
Commit ee02e20c0817745c47ea9be8e26e9a49afc9a7fd by kbobyrev
[clangd] NFC: Use SmallVector<T> where possible

SmallVector<T> with default size is now the recommended version (D92522).

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D92788
The file was modifiedclang-tools-extra/clangd/CompileCommands.cpp
The file was modifiedclang-tools-extra/clangd/index/dex/dexp/Dexp.cpp
The file was modifiedclang-tools-extra/clangd/unittests/support/TraceTests.cpp
The file was modifiedclang-tools-extra/clangd/CompileCommands.h
The file was modifiedclang-tools-extra/clangd/Selection.h
The file was modifiedclang-tools-extra/clangd/ConfigCompile.cpp
The file was modifiedclang-tools-extra/clangd/support/Markup.cpp
The file was modifiedclang-tools-extra/clangd/AST.cpp
The file was modifiedclang-tools-extra/clangd/Selection.cpp
The file was modifiedclang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp
The file was modifiedclang-tools-extra/clangd/FindTarget.cpp
The file was modifiedclang-tools-extra/clangd/unittests/CompileCommandsTests.cpp
The file was modifiedclang-tools-extra/clangd/unittests/TestIndex.cpp
The file was modifiedclang-tools-extra/clangd/unittests/TestTU.cpp
The file was modifiedclang-tools-extra/clangd/TidyProvider.cpp
The file was modifiedclang-tools-extra/clangd/SourceCode.cpp
The file was modifiedclang-tools-extra/clangd/Headers.h
The file was modifiedclang-tools-extra/clangd/QueryDriverDatabase.cpp
The file was modifiedclang-tools-extra/clangd/SemanticHighlighting.cpp
The file was modifiedclang-tools-extra/clangd/TUScheduler.cpp
The file was modifiedclang-tools-extra/clangd/FileDistance.cpp
The file was modifiedclang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp
Commit 208e3f5d9b6c172f65dbb9cdbc9354c81c6d8911 by Raphael Isemann
[lldb] Fix that symbols.clang-modules-cache-path is never initialized

LLDB is supposed to ask the Clang Driver what the default module cache path is
and then use that value as the default for the
`symbols.clang-modules-cache-path` setting. However, we use the property type
`String` to change `symbols.clang-modules-cache-path` even though the type of
that setting is `FileSpec`, so the setter will simply do nothing and return
`false`. We also don't check the return value of the setter, so this whole code
ends up not doing anything at all.

This changes the setter to use the correct property type and adds an assert that
we actually successfully set the default path. Also adds a test that checks that
the default value for this setting is never unset/empty path as this would
effectively disable the import-std-module feature from working by default.

Reviewed By: JDevlieghere, shafik

Differential Revision: https://reviews.llvm.org/D92772
The file was addedlldb/test/Shell/Settings/TestDefaultModuleCachePath.test
The file was modifiedlldb/include/lldb/Core/ModuleList.h
The file was modifiedlldb/test/Shell/helper/toolchain.py
The file was modifiedlldb/source/Core/ModuleList.cpp