platform/upstream/llvm.git
3 years ago[ValueTypes] Add missing enum names for MVTs
Fraser Cormack [Tue, 8 Jun 2021 10:21:31 +0000 (11:21 +0100)]
[ValueTypes] Add missing enum names for MVTs

These types are (presumably) never used in the generated TableGen files.
The `default` switch case silences any compiler warnings for these
missing types so it's easy to miss.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D103883

3 years ago[LoopBoundSplit] Ignore phi node which is not scevable
Jingu Kang [Tue, 8 Jun 2021 17:24:38 +0000 (18:24 +0100)]
[LoopBoundSplit] Ignore phi node which is not scevable

There was a bug in LoopBoundSplit. The pass should ignore phi node which is not
scevable.

Differential Revision: https://reviews.llvm.org/D103913

3 years agoRevert "[lldb] Set return status to failed when adding a command error"
David Spickett [Wed, 9 Jun 2021 08:41:59 +0000 (09:41 +0100)]
Revert "[lldb] Set return status to failed when adding a command error"

This reverts commit e05b03cf4f45ac5ee63c59a3464e7d484884645c.

While I investigate a register test failure:
http://green.lab.llvm.org/green/blue/organizations/jenkins/lldb-cmake/detail/lldb-cmake/32693/pipeline/

3 years agoRevert "[llvm] Sync DebugInfo.h with DebugInfoFlags.def"
Jan Kratochvil [Wed, 9 Jun 2021 08:39:42 +0000 (10:39 +0200)]
Revert "[llvm] Sync DebugInfo.h with DebugInfoFlags.def"

This reverts commit 093750dd0be6b0729f8e817766c3d5849545e10c.

It broke buildbots, goint to investigate it more.

3 years ago[flang] Define the API for CPU_TIME
Diana Picus [Mon, 7 Jun 2021 11:48:32 +0000 (11:48 +0000)]
[flang] Define the API for CPU_TIME

CPU_TIME takes a single real scalar INTENT(OUT) argument. We can
therefore return a double and let lowering handle casting that to the
precision used for the default real kind.

Differential Revision: https://reviews.llvm.org/D103805

3 years ago[ScalarEvolution] Add test for preserving add overflow flags.
Florian Hahn [Wed, 9 Jun 2021 08:01:33 +0000 (09:01 +0100)]
[ScalarEvolution] Add test for preserving add overflow flags.

3 years ago[RISCV] Support CONCAT_VECTORS on scalable masks
Fraser Cormack [Tue, 8 Jun 2021 13:55:31 +0000 (14:55 +0100)]
[RISCV] Support CONCAT_VECTORS on scalable masks

This patch is a simple fix which registers CONCAT_VECTORS as
custom-lowered for scalable mask vectors. This follows the pattern of
all other scalable-vector types, as the default expansion of
CONCAT_VECTORS cannot handle scalable types, and even if it did it'd go
through the stack and generate worse code.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D103896

3 years ago[llvm] Sync DebugInfo.h with DebugInfoFlags.def
Jan Kratochvil [Wed, 9 Jun 2021 08:11:23 +0000 (10:11 +0200)]
[llvm] Sync DebugInfo.h with DebugInfoFlags.def

Command to see the differences:
  diff -u <(sed -n 's#^HANDLE_DI_FLAG *([^,]*, *\([^()]*\)) *\(//.*\)\?$#\1#p' <llvm/include/llvm/IR/DebugInfoFlags.def | grep -vw Largest) <(sed -n 's#^ *LLVMDIFlag\([^ ]*\) *= (\?[0-9].*$#\1#p' <llvm/include/llvm-c/DebugInfo.h)

OCaml binding is more seriously out of sync but I have not tried to sync it.

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D103910

3 years ago[MLIR] Make DictionaryAttr::getAs take name as && reference
Fabian Schuiki [Wed, 9 Jun 2021 08:03:18 +0000 (10:03 +0200)]
[MLIR] Make DictionaryAttr::getAs take name as && reference

As a follow-up to the discussion in https://reviews.llvm.org/D103822,
make the templated `DictionaryAttr::getAs` take the name by `&&`
reference and properly forward the argument to the underlying `get`.

3 years agoPrevent generation of dependency on _cxa_guard for static initialization
serge-sans-paille [Fri, 14 May 2021 09:45:10 +0000 (11:45 +0200)]
Prevent generation of dependency on _cxa_guard for static initialization

This fixes an issue introduced by https://reviews.llvm.org/D70662

Function-scope static initialization are guarded in C++, so we should probably
not use it because it introduces a dependency on __cxa_guard* symbols.
In the context of clang, libasan is linked statically, and it currently needs to
the odd situation where compiling C code with clang and asan requires -lstdc++

Differential Revision: https://reviews.llvm.org/D102475

3 years ago Fix the 4203-Buildbot failure in LLVM Buildbot on llvm-clang-win-x-aarch64
Esme-Yi [Wed, 9 Jun 2021 07:23:51 +0000 (07:23 +0000)]
Fix the 4203-Buildbot failure in LLVM Buildbot on llvm-clang-win-x-aarch64

    Failure in llvm/test/tools/llvm-objdump/XCOFF/section-headers.test:

    SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes
                 in position 24-25: truncated \xXX escape

3 years ago[NFC] Reformat MachineValueType
Guillaume Chatelet [Tue, 8 Jun 2021 12:50:34 +0000 (12:50 +0000)]
[NFC] Reformat MachineValueType

This is a follow up patch based on https://reviews.llvm.org/D103251#2804016.

Differential Revision: https://reviews.llvm.org/D103893

3 years ago[Docs] Fix incorrect return type for example code
Jim Lin [Wed, 9 Jun 2021 07:19:43 +0000 (15:19 +0800)]
[Docs] Fix incorrect return type for example code

3 years ago[mlir][linalg] Prepare fusion on tensors for scalar operands.
Tobias Gysi [Wed, 9 Jun 2021 06:31:53 +0000 (06:31 +0000)]
[mlir][linalg] Prepare fusion on tensors for scalar operands.

Adapt fusion on tensors to support structured ops taking scalar operands.

Differential Revision: https://reviews.llvm.org/D103889

3 years ago[CMake] Don't use libc++ by default on Windows yet
Petr Hosek [Wed, 9 Jun 2021 05:44:53 +0000 (22:44 -0700)]
[CMake] Don't use libc++ by default on Windows yet

libc++ has issues when used with -fno-exceptions and vcruntime,
don't use it on Windows by default until we address those issues.

Differential Revision: https://reviews.llvm.org/D103941

3 years ago[PowerPC] Make sure the first probe is full size or is the last probe when stack...
Kai Luo [Wed, 9 Jun 2021 06:24:14 +0000 (06:24 +0000)]
[PowerPC] Make sure the first probe is full size or is the last probe when stack is realigned

When `-fstack-clash-protection` is enabled and stack has to be realigned, some parts of redzone is written prior the probe, so probe might overwrite content already written in redzone. To avoid it, we have to make sure the first probe is at full probe size or is the last probe so that we can skip redzone.

It also fixes violation of ABI under PPC where `r1` isn't updated atomically.

This fixes https://bugs.llvm.org/show_bug.cgi?id=49903.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D100290

3 years ago[mlir] Fix body-less async.execute printing
Christian Sigg [Fri, 4 Jun 2021 11:52:34 +0000 (13:52 +0200)]
[mlir] Fix body-less async.execute printing

Reviewed By: ezhulenev

Differential Revision: https://reviews.llvm.org/D103686

3 years agoRemove white space in llvm-objdump/XCOFF/section-headers.test
Esme-Yi [Wed, 9 Jun 2021 05:35:52 +0000 (05:35 +0000)]
Remove white space in llvm-objdump/XCOFF/section-headers.test

3 years agoFix LIT test failure encountered on AIX
Chris Bowler [Tue, 8 Jun 2021 21:46:47 +0000 (17:46 -0400)]
Fix LIT test failure encountered on AIX

```
fatal error: error in backend: getLangStandardForKind() on unspecified kind
```

Clang :: Modules/preprocess-module.cpp
Clang :: Modules/no-module-map.cpp
Clang :: Modules/preprocess-build-diamond.m
Clang :: Modules/preprocess-decluse.cpp
Clang :: Modules/string_names.cpp

Fix to prior commit f38eff777e46f42884d82815d0b39766520ac2bf, D103707

3 years agoAdd Twine support for std::string_view.
Sterling Augustine [Tue, 8 Jun 2021 23:57:26 +0000 (16:57 -0700)]
Add Twine support for std::string_view.

With Twine now ubiquitous after rG92a79dbe91413f685ab19295fc7a6297dbd6c824,
it needs support for string_view when building clang with newer C++ standards.

This is similar to how StringRef is handled.

Differential Revision: https://reviews.llvm.org/D103935

3 years ago[RISCV][NFC] Add a single space after comma for VType
Jim Lin [Tue, 8 Jun 2021 07:40:56 +0000 (15:40 +0800)]
[RISCV][NFC] Add a single space after comma for VType

In most of cases, it has a single space after comma in assembly operands.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D103790

3 years ago[NFC][XCOFF] Use yaml2obj in llvm-objdump/XCOFF/section-headers.test instead of binar...
Esme-Yi [Wed, 9 Jun 2021 03:11:33 +0000 (03:11 +0000)]
[NFC][XCOFF] Use yaml2obj in llvm-objdump/XCOFF/section-headers.test instead of binary files.

Summary: This a minor patch to refactor the test file,
llvm-objdump/XCOFF/section-headers.test, to use yaml2obj
for this testing rather than a canned binary.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D103146

3 years ago[PowerPC][Dwarf] Assign MMA register's dwarf register number to negative value
Kai Luo [Wed, 9 Jun 2021 02:22:48 +0000 (02:22 +0000)]
[PowerPC][Dwarf] Assign MMA register's dwarf register number to negative value

According to ELF V2 ABI, `0` should be the dwarf number of `r0`. Currently MMA's register also uses `0` as its dwarf number, this confuses `RegisterInfoEmitter` and generates wrong dwarf -> llvm mapping.
```
extern const MCRegisterInfo::DwarfLLVMRegPair PPCDwarfFlavour1Dwarf2L[] = {
  { 0U, PPC::VSRp31 },
```
This leads to wrong cfi output in https://reviews.llvm.org/D100290.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D103761

3 years agoReland "[AMDGPU] Add gfx1013 target"
Brendon Cahoon [Tue, 8 Jun 2021 20:54:42 +0000 (16:54 -0400)]
Reland "[AMDGPU] Add gfx1013 target"

This reverts commit 211e584fa2a4c032e4d573e7cdbffd622aad0a8f.

Fixed a use-after-free error that caused the sanitizers to fail.

3 years agoORTRT: Add tests for string_view equality and inequality operators
David Blaikie [Wed, 9 Jun 2021 00:53:24 +0000 (17:53 -0700)]
ORTRT: Add tests for string_view equality and inequality operators

3 years agoAdd a couple of missing includes
David Blaikie [Wed, 9 Jun 2021 00:53:14 +0000 (17:53 -0700)]
Add a couple of missing includes

3 years agoRename compiler-rt/lib/orc/endian.h to endianness.h to avoid conflict with system...
David Blaikie [Wed, 9 Jun 2021 00:52:06 +0000 (17:52 -0700)]
Rename compiler-rt/lib/orc/endian.h to endianness.h to avoid conflict with system headers

3 years agoRevert "Add a static assertions for custom Op<> to not defined data members (NFC)"
Mehdi Amini [Wed, 9 Jun 2021 00:46:02 +0000 (00:46 +0000)]
Revert "Add a static assertions for custom Op<> to not defined data members (NFC)"

This reverts commit c0edcec630eb26e12d66dae2f0e1fbf5258cb6ac.

The windows bot was broken by this change.

3 years agoAdd llvm_unreacheable to silence warning "not all control paths return a value" ...
Mehdi Amini [Wed, 9 Jun 2021 00:42:21 +0000 (00:42 +0000)]
Add llvm_unreacheable to silence warning "not all control paths return a value" (NFC)

3 years ago[OpenMP] Add an information flag for device data transfers
Joseph Huber [Tue, 8 Jun 2021 20:43:59 +0000 (16:43 -0400)]
[OpenMP] Add an information flag for device data transfers

This patch adds an information flag that indicated when data is being copied to
and from the device. This will be helpful for finding redundant or unnecessary
data transfers in applications.

Reviewed By: jdoerfert, grokos

Differential Revision: https://reviews.llvm.org/D103927

3 years ago[JITLink][MachO] Split C-string literal sections on null-terminators.
Lang Hames [Tue, 8 Jun 2021 23:01:35 +0000 (09:01 +1000)]
[JITLink][MachO] Split C-string literal sections on null-terminators.

MachO C-string literal sections should be split on null-terminator boundaries,
rather than the usual symbol boundaries. This patch updates
MachOLinkGraphBuilder to do that.

3 years ago[libc][NFC][Obvious] Compare against size_t values in ArrayRef tests.
Siva Chandra Reddy [Wed, 9 Jun 2021 00:14:05 +0000 (00:14 +0000)]
[libc][NFC][Obvious] Compare against size_t values in ArrayRef tests.

Different platforms treat size_t differently so we should compare sizes
of ArrayRef objects with size_t values (instead of the current unsigned
long values.)

3 years ago[libc] Add a macro to include/exclude subprocess tests.
Siva Chandra Reddy [Tue, 8 Jun 2021 23:30:21 +0000 (23:30 +0000)]
[libc] Add a macro to include/exclude subprocess tests.

This is useful when bringing up LLVM libc on a new OS on which we do not
yet have the subprocess related helper functions.

3 years ago[libc][NFC] Use add_library instead of add_llvm_library for a few libraries.
Siva Chandra Reddy [Tue, 8 Jun 2021 23:04:11 +0000 (23:04 +0000)]
[libc][NFC] Use add_library instead of add_llvm_library for a few libraries.

These libraries do not depend on LLVM libraries anymore so they do not
have to be added using add_llvm_library.

3 years ago[mlir][tosa] Temporarily support 2D and 3D tensor types in matmul
Suraj Sudhir [Tue, 8 Jun 2021 22:58:06 +0000 (15:58 -0700)]
[mlir][tosa] Temporarily support 2D and 3D tensor types in matmul

Temporarily support 2D and 3D while the TOSA Matmul op is updated to support batched operations.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D103854

3 years ago[NFC] In the future, all intrinsics defined for compatibility with the XL
Quinn Pham [Tue, 8 Jun 2021 22:55:53 +0000 (17:55 -0500)]
[NFC] In the future, all intrinsics defined for compatibility with the XL
compiler will be placed in this collection.

This patch has no functional changes.

Differential revision: https://reviews.llvm.org/D103921

3 years agoLTO: Export functions referenced by non-canonical CFI jump tables
Sami Tolvanen [Tue, 8 Jun 2021 21:57:32 +0000 (14:57 -0700)]
LTO: Export functions referenced by non-canonical CFI jump tables

LowerTypeTests pass adds functions with a non-canonical jump table
to cfiFunctionDecls instead of cfiFunctionDefs. As the jump table
is in the regular LTO object, these functions will also need to be
exported. This change fixes the non-canonical jump table case and
adds a test similar to the existing one for canonical jump tables.

Reviewed By: pcc

Differential Revision: https://reviews.llvm.org/D103120

3 years agoRevert "Revert "[LoopNest] Fix Wdeprecated-copy warnings""
Whitney Tsang [Tue, 8 Jun 2021 21:47:56 +0000 (21:47 +0000)]
Revert "Revert "[LoopNest] Fix Wdeprecated-copy warnings""

This reverts commit 07ef5805abe5d4576eb5528eab63e75505bfd0bd.

The broke of the sanitizer-windows bot:
https://lab.llvm.org/buildbot/#/builders/127/builds/12064
is not caused by the original commit.

Differential Revision: https://reviews.llvm.org/D103752

3 years ago[Polly][Isl] Removing nullptr constructor from C++ bindings. NFC.
patacca [Tue, 8 Jun 2021 21:45:34 +0000 (23:45 +0200)]
[Polly][Isl] Removing nullptr constructor from C++ bindings. NFC.

[Polly][Isl] Removing nullptr constructor from C++ bindings. NFC.

This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
 - Removed `std::nullptr_t` constructor from all the classes in the isl C++ bindings.
 - `isl-noexceptions.h` has been generated by this https://github.com/patacca/isl/commit/a7e00bea38f251a4bcf5c2c6ce5fa7ee5f661528

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D103751

3 years agoUpdate and improve compiler-rt tests for -mllvm -asan_use_after_return=(never|[runtim...
Kevin Athey [Tue, 8 Jun 2021 19:45:48 +0000 (12:45 -0700)]
Update and improve compiler-rt tests for -mllvm -asan_use_after_return=(never|[runtime]|always).

In addition:
  - optionally add global flag to capture compile intent for UAR:
    __asan_detect_use_after_return_always.
    The global is a SANITIZER_WEAK_ATTRIBUTE.

for issue: https://github.com/google/sanitizers/issues/1394

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D103304

3 years ago[SystemZ] Return true from convertSetCCLogicToBitwiseLogic for scalar integer.
Jonas Paulsson [Tue, 1 Jun 2021 16:38:00 +0000 (11:38 -0500)]
[SystemZ] Return true from convertSetCCLogicToBitwiseLogic for scalar integer.

Review: Ulrich Weigand

3 years ago[LLDB][NFC] Remove parameter names from forward declarations from hand written expres...
Shafik Yaghmour [Tue, 8 Jun 2021 21:02:55 +0000 (14:02 -0700)]
[LLDB][NFC] Remove parameter names from forward declarations from hand written expressions used in heap.py

heap.py has a lot of large hand written expressions and each name in the
expression will be looked up by clang during expression parsing. For
function parameters this will be in Sema::ActOnParamDeclarator(...) in order to
catch redeclarations of parameters. The names are not needed and we have seen
some rare cases where since we don't have symbols we end up in
SymbolContext::FindBestGlobalDataSymbol(...) which may conflict with other global
symbols.

There may be a way to make this lookup smarter to avoid these cases but it is
not clear how well tested this path is and how much work it would be to fix it.
So we will go with this fix while we investigate more.

Ref: rdar://78265641

3 years ago[InstCombine] fix nsz (fast-math) propagation from fneg-of-select
Sanjay Patel [Tue, 8 Jun 2021 20:45:29 +0000 (16:45 -0400)]
[InstCombine] fix nsz (fast-math) propagation from fneg-of-select

As discussed in the post-commit comments for:
3cdd05e519dd

It seems to be safe to propagate all flags from the final fneg
except for 'nsz' to the new select:
https://alive2.llvm.org/ce/z/J_APDc

nsz has unique FMF semantics: it is not poison, it is only
"insignificant" in the calculation according to the LangRef.

3 years ago[InstCombine] add FMF tests for fneg-of-select; NFC
Sanjay Patel [Tue, 8 Jun 2021 20:06:10 +0000 (16:06 -0400)]
[InstCombine] add FMF tests for fneg-of-select; NFC

As noted in the post-commit comments for 3cdd05e519d,
we need to be more careful about FMF propagation.

3 years ago[scudo] Add Scudo support for Trusty OS
Daniel Michael [Mon, 7 Jun 2021 16:10:46 +0000 (09:10 -0700)]
[scudo] Add Scudo support for Trusty OS

trusty.cpp and trusty.h define Trusty implementations of map and other
platform-specific functions. In addition to adding Trusty configurations
in allocator_config.h and size_class_map.h, MapSizeIncrement and
PrimaryEnableRandomOffset are added as configurable options in
allocator_config.h.
Background on Trusty: https://source.android.com/security/trusty

Differential Revision: https://reviews.llvm.org/D103578

3 years ago[lldb] Don't print script output twice in HandleCommand
Jonas Devlieghere [Tue, 8 Jun 2021 17:46:43 +0000 (10:46 -0700)]
[lldb] Don't print script output twice in HandleCommand

When executing a script command in HandleCommand(s) we currently print
its output twice
You can see this issue in action when adding a breakpoint command:

(lldb) b main
Breakpoint 1: where = main.out`main + 13 at main.cpp:2:3, address = 0x0000000100003fad
(lldb) break command add 1 -o "script print(\"Hey!\")"
(lldb) r
Process 76041 launched: '/tmp/main.out' (x86_64)
Hey!
(lldb)  script print("Hey!")
Hey!
Process 76041 stopped

The issue is caused by HandleCommands using a temporary
CommandReturnObject and one of the commands (`script` in this case)
setting an immediate output stream. This causes the result to be printed
twice: once directly to the immediate output stream and once when
printing the result of HandleCommands.

This patch fixes the issue by introducing a new option to suppress
immediate output for temporary CommandReturnObjects.

Differential revision: https://reviews.llvm.org/D103349

3 years ago[DSE] Add another multiblock loop DSE test. NFC
David Green [Tue, 8 Jun 2021 20:54:59 +0000 (21:54 +0100)]
[DSE] Add another multiblock loop DSE test. NFC

As reported in D100464, the stores in these loops should not be removed.

3 years ago[libc++] NFC: Rewrite the documentation for the debug mode
Louis Dionne [Tue, 8 Jun 2021 20:32:53 +0000 (16:32 -0400)]
[libc++] NFC: Rewrite the documentation for the debug mode

3 years agoRevert "[LoopNest] Fix Wdeprecated-copy warnings"
Whitney Tsang [Tue, 8 Jun 2021 20:44:57 +0000 (20:44 +0000)]
Revert "[LoopNest] Fix Wdeprecated-copy warnings"

This reverts commit dee1f0cb348b0a56375d9b563fb4d6918c431ed1.

It appears that this change broke the sanitizer-windows bot:
https://lab.llvm.org/buildbot/#/builders/127/builds/12064

Differential Revision: https://reviews.llvm.org/D103752

3 years ago[CMake][Fuchsia] Disable vcruntime for first stage as well
Petr Hosek [Tue, 8 Jun 2021 20:40:30 +0000 (13:40 -0700)]
[CMake][Fuchsia] Disable vcruntime for first stage as well

Using vcruntime is breaking libc++ headers so don't use it.

Differential Revision: https://reviews.llvm.org/D103926

3 years ago[SystemZ] Return true from isMaskAndCmp0FoldingBeneficial().
Jonas Paulsson [Fri, 28 May 2021 22:08:51 +0000 (00:08 +0200)]
[SystemZ] Return true from isMaskAndCmp0FoldingBeneficial().

Return true if the mask is a constant uint of 2 bytes, in which case TMLL is
available.

Review: Ulrich Weigand

3 years agoRevert "[AMDGPU] Add gfx1013 target"
Brendon Cahoon [Tue, 8 Jun 2021 20:27:49 +0000 (16:27 -0400)]
Revert "[AMDGPU] Add gfx1013 target"

This reverts commit ea10a86984ea73fcec3b12d22404a15f2f59b219.

A sanitizer buildbot reports an error.

3 years agoRevert "[DSE] Remove stores in the same loop iteration"
David Green [Tue, 8 Jun 2021 20:23:08 +0000 (21:23 +0100)]
Revert "[DSE] Remove stores in the same loop iteration"

Apparently non-dead stores are being removed, as noted in D100464.

This reverts commit 222aeb4d51a46c5a81c9e4ccb16d1d19dd21ec95.

3 years agoPartially revert the Fuchsia changes to avoid the use of PIC
Petr Hosek [Tue, 8 Jun 2021 19:51:32 +0000 (12:51 -0700)]
Partially revert the Fuchsia changes to avoid the use of PIC

This reverts commit:
2a5afb466553ae4e185d7fa50c9b8df9fe62ecda
de98da2eced72eee791a93b076b70a7b22175abc
1dba2a026956b0f3918dcf8bb1d3f3483db2de8c

3 years ago[ARM] Generate VDUP(Const) from constant buildvectors
David Green [Tue, 8 Jun 2021 19:51:33 +0000 (20:51 +0100)]
[ARM] Generate VDUP(Const) from constant buildvectors

If we cannot otherwise use a VMOVimm/VMOVFPimm/VMVNimm, fall back to
producing a VDUP(const) as opposed to a constant pool load. This will at
least be smaller codesize and can allow the VDUP to be folded into other
instructions.

Differential Revision: https://reviews.llvm.org/D103808

3 years ago[ms] [llvm-ml] Disambiguate size directives and variable declarations
Eric Astor [Tue, 8 Jun 2021 19:30:11 +0000 (15:30 -0400)]
[ms] [llvm-ml] Disambiguate size directives and variable declarations

MASM allows statements of the form:
<VAR> DWORD 5
to declare a variable with name <VAR>, while:
call dword ptr [<value>]
is a valid instruction. To disambiguate, we recognize size directives by the trailing "ptr" token.

As discussed in https://lists.llvm.org/pipermail/llvm-dev/2021-May/150774.html

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D103257

3 years ago[amdgpu] Add `-enable-ocl-mangling-mismatch-workaround`.
Michael Liao [Tue, 8 Jun 2021 18:35:36 +0000 (14:35 -0400)]
[amdgpu] Add `-enable-ocl-mangling-mismatch-workaround`.

- Add `-enable-ocl-mangling-mismatch-workaround` to work around the
  mismatch on OCL name mangling so far.

Reviewed By: yaxunl, rampitec

Differential Revision: https://reviews.llvm.org/D103920

3 years agoFix for failing test mentioned in https://reviews.llvm.org/D103564.
Leonard Chan [Tue, 8 Jun 2021 19:37:04 +0000 (12:37 -0700)]
Fix for failing test mentioned in https://reviews.llvm.org/D103564.

This updates the path shown in the stack trace.

3 years ago[lldb][NFC] Refactor name to index maps in Symtab
Alex Langford [Thu, 3 Jun 2021 19:14:20 +0000 (12:14 -0700)]
[lldb][NFC] Refactor name to index maps in Symtab

The various maps in Symtab lead to some repetative code. This should
improve the situation somewhat.

Differential Revision: https://reviews.llvm.org/D103652

3 years ago[CodeGen] remove instcombine from codegen tests; NFC
Sanjay Patel [Tue, 8 Jun 2021 19:12:41 +0000 (15:12 -0400)]
[CodeGen] remove instcombine from codegen tests; NFC

The FileCheck lines in these files are auto-generated and complete,
so there's very little upside (less CHECK lines) from running
-instcombine on them and violating the expected test layering
(optimizer developers shouldn't have to be aware of clang tests).

Running opt passes like this makes it harder to make changes such as:
D93817

3 years ago[CMake][Fuchsia] Use PIC for Fuchsia runtimes
Petr Hosek [Tue, 8 Jun 2021 18:38:40 +0000 (11:38 -0700)]
[CMake][Fuchsia] Use PIC for Fuchsia runtimes

Disabling PIC globally also disabled PIC for runtimes which was
undesirable, manually override it.

Differential Revision: https://reviews.llvm.org/D103919

3 years ago[gn build] (semi-manually) port 944b3c53aec5
Nico Weber [Tue, 8 Jun 2021 19:21:03 +0000 (15:21 -0400)]
[gn build] (semi-manually) port 944b3c53aec5

3 years ago[NFC][compiler-rt][hwasan] Move allocation functions into their own file
Leonard Chan [Mon, 7 Jun 2021 22:35:28 +0000 (15:35 -0700)]
[NFC][compiler-rt][hwasan] Move allocation functions into their own file

This removes the `__sanitizer_*` allocation function definitions from
`hwasan_interceptors.cpp` and moves them into their own file. This way
implementations that do not use interceptors at all can just ignore
(almost) everything in `hwasan_interceptors.cpp`.

Also remove some unused headers in `hwasan_interceptors.cpp` after the move.

Differential Revision: https://reviews.llvm.org/D103564

3 years ago[SystemZ][z/OS] Pass OpenFlags when creating tmp files
Abhina Sreeskantharajan [Tue, 8 Jun 2021 18:44:45 +0000 (14:44 -0400)]
[SystemZ][z/OS] Pass OpenFlags when creating tmp files

This patch https://reviews.llvm.org/D102876 caused some lit regressions on z/OS because tmp files were no longer being opened based on binary/text mode. This patch passes OpenFlags when creating tmp files so we can open files in different modes.

Reviewed By: amccarth

Differential Revision: https://reviews.llvm.org/D103806

3 years agoGlobalISel: Avoid use of G_INSERT in insertParts
Matt Arsenault [Mon, 7 Jun 2021 22:57:03 +0000 (18:57 -0400)]
GlobalISel: Avoid use of G_INSERT in insertParts

G_INSERT legalization is incomplete and doesn't work very
well. Instead try to use sequences of G_MERGE_VALUES/G_UNMERGE_VALUES
padding with undef values (although this can get pretty large).

For the case of load/store narrowing, this is still performing the
load/stores in irregularly sized pieces. It might be cleaner to split
this down into equal sized pieces, and rely on load/store merging to
optimize it.

3 years agoGlobalISel: Hide virtual register creation in MIRBuilder
Matt Arsenault [Mon, 7 Jun 2021 21:01:03 +0000 (17:01 -0400)]
GlobalISel: Hide virtual register creation in MIRBuilder

3 years ago[ARM] A couple of extra VMOVimm tests, useful for showing BE codegen. NFC
David Green [Tue, 8 Jun 2021 18:39:45 +0000 (19:39 +0100)]
[ARM] A couple of extra VMOVimm tests, useful for showing BE codegen. NFC

3 years agoAdd a static assertions for custom Op<> to not defined data members (NFC)
Mehdi Amini [Tue, 8 Jun 2021 18:28:39 +0000 (18:28 +0000)]
Add a static assertions for custom Op<> to not defined data members (NFC)

A common mistake for newcomers to MLIR is to try to store extra member
on the Op class. However these are intended to be thing wrapper around
an Operation*, all the storage is meant to be encoded in attribute on
the underlying Operation. This can be confusing to debug, so better
catch it at build time.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D103869

3 years agoAdd an option to hide "cold" blocks from CFG graph
Artur Pilipenko [Tue, 8 Jun 2021 18:26:27 +0000 (11:26 -0700)]
Add an option to hide "cold" blocks from CFG graph

Introduce a new cl::opt to hide "cold" blocks from CFG DOT graphs.
Use BFI to get block relative frequency. Hide the block if the
frequency is below the threshold set by the command line option value.

Reviewed By: davidxl, hoy
Differential Revision: https://reviews.llvm.org/D103640

3 years ago[CMake][Fuchsia] Include llvm-otool in Fuchsia toolchain
Petr Hosek [Tue, 8 Jun 2021 18:01:58 +0000 (11:01 -0700)]
[CMake][Fuchsia] Include llvm-otool in Fuchsia toolchain

We want to use llvm-otool in our build.

Differential Revision: https://reviews.llvm.org/D103918

3 years ago[RISCV] Remove dead code from fixed-vectors-abs.ll test cases. NFC
Craig Topper [Tue, 8 Jun 2021 18:13:18 +0000 (11:13 -0700)]
[RISCV] Remove dead code from fixed-vectors-abs.ll test cases. NFC

We had two pointer arguments and a dead load presumably copied
from a binary operation test and modified into unary abs.

3 years ago[FuzzMutate] Fix getWeight of InstDeleterIRStrategy
Justin Bogner [Tue, 8 Jun 2021 18:14:33 +0000 (11:14 -0700)]
[FuzzMutate] Fix getWeight of InstDeleterIRStrategy

The comment states the following, for calculating the Line variable:

> Draw a line starting from when we only have 1k left and increasing
> linearly to double the current weight.

However, the value was not calculated as described. Instead, it would
result in a negative value, which resulted in the function always
returning 0 afterwards.

```
// Invariant: CurrentSize <= MaxSize - 200
// Invariant: CurrentWeight >= 0
int Line = (-2 * CurrentWeight) * (MaxSize - CurrentSize + 1000);
// {Line <= 0}
```

This commit fixes the issue and linearly interpolates as described.

Patch by Loris Reiff. Thanks!

Differential Revision: https://reviews.llvm.org/D96207

3 years ago[clang] p1099 using enum part 2
Nathan Sidwell [Wed, 5 May 2021 15:55:02 +0000 (08:55 -0700)]
[clang] p1099 using enum part 2

This implements the 'using enum maybe-qualified-enum-tag ;' part of
1099. It introduces a new 'UsingEnumDecl', subclassed from
'BaseUsingDecl'. Much of the diff is the boilerplate needed to get the
new class set up.

There is one case where we accept ill-formed, but I believe this is
merely an extended case of an existing bug, so consider it
orthogonal. AFAICT in class-scope the c++20 rule is that no 2 using
decls can bring in the same target decl ([namespace.udecl]/8). But we
already accept:

struct A { enum { a }; };
struct B : A { using A::a; };
struct C : B { using A::a;
using B::a; }; // same enumerator

this patch permits mixtures of 'using enum Bob;' and 'using Bob::member;' in the same way.

Differential Revision: https://reviews.llvm.org/D102241

3 years ago[CMake] Only include LTO on Apple targets
Petr Hosek [Tue, 8 Jun 2021 17:47:23 +0000 (10:47 -0700)]
[CMake] Only include LTO on Apple targets

We only need libLTO when using ld64.

Differential Revision: https://reviews.llvm.org/D103916

3 years agoreland [IR] make -stack-alignment= into a module attr
Nick Desaulniers [Tue, 8 Jun 2021 15:57:12 +0000 (08:57 -0700)]
reland [IR] make -stack-alignment= into a module attr

Relands commit 433c8d950cb3a1fa0977355ce0367e8c763a3f13 with fixes for
MIPS.

Similar to D102742, specifying the stack alignment via CodegenOpts means
that this flag gets dropped during LTO, unless the command line is
re-specified as a plugin opt. Instead, encode this information as a
module level attribute so that we don't have to expose this llvm
internal flag when linking the Linux kernel with LTO.

Looks like external dependencies might need a fix:
* https://github.com/llvm-hs/llvm-hs/issues/345
* https://github.com/halide/Halide/issues/6079

Link: https://github.com/ClangBuiltLinux/linux/issues/1377
Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D103048

3 years ago[libcxx] Remove VLA from libcxx locale header
Daniel McIntosh [Tue, 8 Jun 2021 17:59:11 +0000 (13:59 -0400)]
[libcxx] Remove VLA from libcxx locale header

The buffer size (`__nbuf`) in `num_put::do_put` is currently not an
integral/core constant expression. As a result, `__nar` is a Variable Length
Array (VLA). VLAs are a GNU extension and not part of the base C++ standard, so
unless there is good reason to do so they probably shouldn't be used in any of
the standard library headers. The call to `__iob.flags()` is the only thing
keeping `__nbuf` from being a compile time constant, so the solution here is to
simply err on the side of caution and always allocate a buffer large enough to
fit the base prefix.

Note that, while the base prefix for hex (`0x`) is slightly longer than the
base prefix for octal (`0`), this isn't a concern. The difference in the space
needed for the value portion of the string is enough to make up for this.
(Unless we're working with small, oddly sized types such as a hypothetical
`uint9_t`, the space needed for the value portion in octal is at least 1 more
than the space needed for the value portion in hex).

This PR also adds `constexpr` to `__nbuf` to enforce compile time const-ness
going forward.

Reviewed By: Mordante, #libc, Quuxplusone, ldionne

Differential Revision: https://reviews.llvm.org/D103558

3 years ago[libc++] Add a CI configuration for the modular build
Louis Dionne [Wed, 2 Jun 2021 21:07:57 +0000 (17:07 -0400)]
[libc++] Add a CI configuration for the modular build

Differential Revision: https://reviews.llvm.org/D103559

3 years ago[GlobalISel] Handle non-multiples of the base type in narrowScalarAddSub
Justin Bogner [Tue, 2 Mar 2021 22:46:03 +0000 (14:46 -0800)]
[GlobalISel] Handle non-multiples of the base type in narrowScalarAddSub

When narrowing G_ADD and G_SUB, handle types that aren't a multiple of
the type we're narrowing to. This allows us to handle types like s96
on 64 bit targets.

Note that the test here has a couple of dead instructions because of
the way the setup legalizes. I wasn't able to come up with a way to
write this test that avoids that easily.

Differential Revision: https://reviews.llvm.org/D97811

3 years ago[GlobalISel] Handle non-multiples of the base type in narrowScalarInsert
Justin Bogner [Tue, 2 Mar 2021 17:49:15 +0000 (09:49 -0800)]
[GlobalISel] Handle non-multiples of the base type in narrowScalarInsert

When narrowing G_INSERT, handle types that aren't a multiple of the
type we're narrowing to. This comes up if we're narrowing something
like an s96 to fit in 64 bit registers and also for non-byte multiple
packed types if they come up.

This implementation handles these cases by extending the extra bits to
the narrow size and truncating the result back to the destination
size.

Differential Revision: https://reviews.llvm.org/D97791

3 years agoAdd missing header <atomic> in lib/IR/Verifier.cpp (NFC)
Mehdi Amini [Tue, 8 Jun 2021 17:08:30 +0000 (17:08 +0000)]
Add missing header <atomic> in lib/IR/Verifier.cpp (NFC)

Fix the build on some platform.

3 years ago[Fuchsia] Update some of the Fuchsia toolchain flags
Petr Hosek [Tue, 8 Jun 2021 08:03:26 +0000 (01:03 -0700)]
[Fuchsia] Update some of the Fuchsia toolchain flags

This should make the build more self-contained.

Differential Revision: https://reviews.llvm.org/D103875

3 years agoRevert "[llvm] Make Sequence reverse-iterable"
Mehdi Amini [Tue, 8 Jun 2021 17:01:05 +0000 (17:01 +0000)]
Revert "[llvm] Make Sequence reverse-iterable"

This reverts commit e772216e708937988c039420d2c559568f91ae27
(and fixup 7f6c878a2c035eb6325ab228d9bc2d257509d959).

The build is broken with gcc5 host compiler:

In file included from
                 from mlir/lib/Dialect/Utils/StructuredOpsUtils.cpp:9:
tools/mlir/include/mlir/IR/BuiltinAttributes.h.inc:424:57: error: type/value mismatch at argument 1 in template parameter list for 'template<class ItTy, class FuncTy, class FuncReturnTy> class llvm::mapped_iterator'
                               std::function<T(ptrdiff_t)>>;
                                                         ^
tools/mlir/include/mlir/IR/BuiltinAttributes.h.inc:424:57: note:   expected a type, got 'decltype (seq<ptrdiff_t>(0, 0))::const_iterator'

3 years agoUse llvm_unreachable for unsupported integer types.
Simon Pilgrim [Tue, 8 Jun 2021 16:33:59 +0000 (17:33 +0100)]
Use llvm_unreachable for unsupported integer types.

As suggested on rG937c4cffd024, use llvm_unreachable for unhandled integer types (which shouldn't be possible) instead of breaking and dropping down to the existing fatal error handler.

Helps silence static analyzer warnings.

3 years agoPPCISelLowering.cpp - don't dereference a dyn_cast<>.
Simon Pilgrim [Tue, 8 Jun 2021 16:08:14 +0000 (17:08 +0100)]
PPCISelLowering.cpp - don't dereference a dyn_cast<>.

dyn_cast<> can return nullptr which we would then dereference - use cast<> which will assert that the type is correct.

3 years agoInstrEmitter.cpp - don't dereference a dyn_cast<>.
Simon Pilgrim [Tue, 8 Jun 2021 15:42:28 +0000 (16:42 +0100)]
InstrEmitter.cpp - don't dereference a dyn_cast<>.

dyn_cast<> can return nullptr which we would then dereference - use cast<> which will assert that the type is correct.

3 years ago[AMDGPU] Add gfx1013 target
Brendon Cahoon [Tue, 1 Jun 2021 20:38:42 +0000 (16:38 -0400)]
[AMDGPU] Add gfx1013 target

Differential Revision: https://reviews.llvm.org/D103663

3 years ago[Core] Add Twine support for StringAttr and Identifier. NFC.
Chris Lattner [Sat, 5 Jun 2021 18:38:31 +0000 (11:38 -0700)]
[Core] Add Twine support for StringAttr and Identifier. NFC.

This is both more efficient and more ergonomic than going
through an std::string, e.g. when using llvm::utostr and
in string concat cases.

Unfortunately we can't just overload ::get().  This causes an
ambiguity because both twine and stringref implicitly convert
from std::string.

Differential Revision: https://reviews.llvm.org/D103754

3 years ago[Verifier] Speed up and parallelize dominance checking. NFC
Chris Lattner [Sun, 30 May 2021 00:08:33 +0000 (17:08 -0700)]
[Verifier] Speed up and parallelize dominance checking.  NFC

One of the key algorithms used in the "mlir::verify(op)" method is the
dominance checker, which ensures that operand values properly dominate
the operations that use them.

The MLIR dominance implementation has a number of algorithmic problems,
and is not really set up in general to answer dense queries: it's constant
factors are really slow with multiple map lookups and scans, even in the
easy cases.  Furthermore, when calling mlir::verify(module) or some other
high level operation, it makes sense to parallelize the dominator
verification of all the functions within the module.

This patch has a few changes to enact this:
 1) It splits dominance checking into "IsolatedFromAbove" units.  Instead
    of building a monolithic DominanceInfo for everything in a module,
    for example, it checks dominance for the module to all the functions
    within it (noop, since there are no operands at this level) then each
    function gets their own DominanceInfo for each of their scope.
 2) It adds the ability for mlir::DominanceInfo (and post dom) to be
    constrained to an IsolatedFromAbove region.  There is no reason to
    recurse into IsolatedFromAbove regions since use/def relationships
    can't span this region anyway.  This is already checked by the time
    the verifier gets here.
 3) It avoids querying DominanceInfo for trivial checks (e.g. intra Block
    references) to eliminate constant factor issues).
 4) It switches to lazily constructing DominanceInfo because the trivial
    check case handles the vast majority of the cases and avoids
    constructing DominanceInfo entirely in some cases (e.g. at the module
    level or for many Regions's that contain a single Block).
 5) It parallelizes analysis of collections IsolatedFromAbove operations,
    e.g. each of the functions within a Module.

All together this is more than a 10% speedup on `firtool` in circt on a
large design when run in -verify-each mode (our default) since the verifier
is invoked after each pass.

Still todo is to parallelize the main verifier pass.  I decided to split
this out to its own thing since this patch is already large-ish.

Differential Revision: https://reviews.llvm.org/D103373

3 years agoFurther improve register allocation for vwadd(u).wv, vwsub(u).wv, vfwadd.wv, and...
Craig Topper [Tue, 8 Jun 2021 16:31:30 +0000 (09:31 -0700)]
Further improve register allocation for vwadd(u).wv, vwsub(u).wv, vfwadd.wv, and vfwsub.wv.

The first source has the same EEW as the destination, but we're
using earlyclobber which prevents them from ever being the same
register. This patch attempts to work around this.

-For unmasked .wv, add a special TIED pseudo that pretends like
 the first operand and the destination must be the same register. This
 disables the earlyclobber for that source. Mark the instruction
 as convertible to 3 address form which will switch it to the
 original untied pseudo when the TwoAddressInstructionPass decides
 that keeping them tied would require an extra copy. This uses
 code in RISCVInstrInfo.cpp to do the conversion to the untied
 opcode.

The untie test case show that we can generate the untied version.
Not sure it was profitable to do it in this case, but they have
really simple IR.

Reviewed By: arcbbb

Differential Revision: https://reviews.llvm.org/D103552

3 years agoFix a typo in the internals manual
Jake Vossen [Tue, 8 Jun 2021 16:32:05 +0000 (12:32 -0400)]
Fix a typo in the internals manual

3 years ago[RISCV] Remove ForceTailAgnostic flag from vmv.s.x, vfmv.s.f and reductions.
Craig Topper [Tue, 8 Jun 2021 16:14:26 +0000 (09:14 -0700)]
[RISCV] Remove ForceTailAgnostic flag from vmv.s.x, vfmv.s.f and reductions.

In 0.9 these were defined to leave elements other than 0 in the
destination unmodified. They were changed to use the tail policy
in 0.10. I missed that update.

I assume no one has noticed because in order cores treat tail
agnostic the same as tail undisturbed. I believe Spike and QEMU do
the same.

Reviewed By: arcbbb, frasercrmck

Differential Revision: https://reviews.llvm.org/D103736

3 years ago[ELF] Add a GRP_COMDAT test with a local signature symbol
Fangrui Song [Tue, 8 Jun 2021 16:22:30 +0000 (09:22 -0700)]
[ELF] Add a GRP_COMDAT test with a local signature symbol

See https://groups.google.com/g/generic-abi/c/2X6mR-s2zoc

Test that a local signature symbol does not suppress COMDAT deduplication.

3 years ago[MLIR] Remove LLVM_AnyInteger type constraint
Kiran Chandramohan [Tue, 8 Jun 2021 15:48:57 +0000 (16:48 +0100)]
[MLIR] Remove LLVM_AnyInteger type constraint

LLVM Dialect uses builtin-integer types. The existing LLVM_AnyInteger
type constraint is a dupe of AnyInteger. This patch removes LLVM_AnyInteger
and replaces all usage with AnyInteger.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D103839

3 years ago[libc++] NFC: Add regression tests for some <tuple> PRs that have been fixed
Louis Dionne [Tue, 8 Jun 2021 16:12:04 +0000 (12:12 -0400)]
[libc++] NFC: Add regression tests for some <tuple> PRs that have been fixed

3 years ago[clang-cl] Parse the /external: flags (PR36003)
Hans Wennborg [Tue, 8 Jun 2021 15:51:05 +0000 (17:51 +0200)]
[clang-cl] Parse the /external: flags (PR36003)

They are still unsupported, but at least this makes clang-cl not mistake
them for being filenames.

As pointed out in the bug, VS 16.10 now uses these flags in new projects
by default.

3 years agoRevert "[IR] make -stack-alignment= into a module attr"
Nick Desaulniers [Tue, 8 Jun 2021 15:55:50 +0000 (08:55 -0700)]
Revert "[IR] make -stack-alignment= into a module attr"

This reverts commit 433c8d950cb3a1fa0977355ce0367e8c763a3f13.

Breaks the MIPS build.

3 years ago[MLIR][MemRef] Only allow fold of cast for the pointer operand, not the value
William S. Moses [Mon, 7 Jun 2021 17:44:07 +0000 (13:44 -0400)]
[MLIR][MemRef] Only allow fold of cast for the pointer operand, not the value

Currently canonicalizations of a store and a cast try to fold all casts into the store.

In the case where the operand being stored is itself a cast, this is illegal as the type of the value being stored
will change. This PR fixes this by not checking the value for folding with a cast.

Depends on https://reviews.llvm.org/D103828

Differential Revision: https://reviews.llvm.org/D103829

3 years ago.clang-tidy: Disable misc-no-recursion in general/across the monorepo
David Blaikie [Tue, 8 Jun 2021 15:30:48 +0000 (08:30 -0700)]
.clang-tidy: Disable misc-no-recursion in general/across the monorepo

3 years ago[IR] make -stack-alignment= into a module attr
Nick Desaulniers [Tue, 8 Jun 2021 15:22:48 +0000 (08:22 -0700)]
[IR] make -stack-alignment= into a module attr

Similar to D102742, specifying the stack alignment via CodegenOpts means
that this flag gets dropped during LTO, unless the command line is
re-specified as a plugin opt. Instead, encode this information as a
module level attribute so that we don't have to expose this llvm
internal flag when linking the Linux kernel with LTO.

Looks like external dependencies might need a fix:
* https://github.com/llvm-hs/llvm-hs/issues/345
* https://github.com/halide/Halide/issues/6079

Link: https://github.com/ClangBuiltLinux/linux/issues/1377
Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D103048

3 years agoNFC: .clang-tidy: Inherit configs from parents to improve maintainability
David Blaikie [Mon, 7 Jun 2021 20:56:02 +0000 (13:56 -0700)]
NFC: .clang-tidy: Inherit configs from parents to improve maintainability

In the interests of disabling misc-no-recursion across LLVM (this seems
like a stylistic choice that is not consistent with LLVM's
style/development approach) this NFC preliminary change adjusts all the
.clang-tidy files to inherit from their parents as much as possible.

This change specifically preserves all the quirks of the current configs
in order to make it easier to review as NFC.

I validatad the change is NFC as follows:

for X in `cat ../files.txt`;
do
  mkdir -p ../tmp/$(dirname $X)
  touch $(dirname $X)/blaikie.cpp
  clang-tidy -dump-config $(dirname $X)/blaikie.cpp > ../tmp/$(dirname $X)/after
  rm $(dirname $X)/blaikie.cpp
done

(similarly for the "before" state, without this patch applied)

for X in `cat ../files.txt`;
do
  echo $X
  diff \
    ../tmp/$(dirname $X)/before \
    <(cat ../tmp/$(dirname $X)/after \
      | sed -e "s/,readability-identifier-naming\(.*\),-readability-identifier-naming/\1/" \
      | sed -e "s/,-llvm-include-order\(.*\),llvm-include-order/\1/" \
      | sed -e "s/,-misc-no-recursion\(.*\),misc-no-recursion/\1/" \
      | sed -e "s/,-clang-diagnostic-\*\(.*\),clang-diagnostic-\*/\1/")
done

(using sed to strip some add/remove pairs to reduce the diff and make it easier to read)

The resulting report is:
  .clang-tidy
  clang/.clang-tidy
  2c2
  < Checks:          'clang-diagnostic-*,clang-analyzer-*,-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-readability-identifier-naming,-misc-no-recursion'
  ---
  > Checks:          'clang-diagnostic-*,clang-analyzer-*,-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-misc-no-recursion'
  compiler-rt/.clang-tidy
  2c2
  < Checks:          'clang-diagnostic-*,clang-analyzer-*,-*,clang-diagnostic-*,llvm-*,-llvm-header-guard,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes'
  ---
  > Checks:          'clang-diagnostic-*,clang-analyzer-*,-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-llvm-header-guard'
  flang/.clang-tidy
  2c2
  < Checks:          'clang-diagnostic-*,clang-analyzer-*,-*,llvm-*,-llvm-include-order,misc-*,-misc-no-recursion,-misc-unused-parameters,-misc-non-private-member-variables-in-classes'
  ---
  > Checks:          'clang-diagnostic-*,clang-analyzer-*,-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-llvm-include-order,-misc-no-recursion'
  flang/include/flang/Lower/.clang-tidy
  flang/include/flang/Optimizer/.clang-tidy
  flang/lib/Lower/.clang-tidy
  flang/lib/Optimizer/.clang-tidy
  lld/.clang-tidy
  lldb/.clang-tidy
  llvm/tools/split-file/.clang-tidy
  mlir/.clang-tidy

The `clang/.clang-tidy` change is a no-op, disabling an option that was never enabled.
The compiler-rt and flang changes are no-op reorderings of the same flags.

(side note, the .clang-tidy file in parallel-libs is broken and crashes
clang-tidy because it uses "lowerCase" as the style instead of "lower_case" -
so I'll deal with that separately)

Differential Revision: https://reviews.llvm.org/D103842