platform/upstream/llvm.git
3 years ago[lld-macho] implement options -(un)exported_symbol(s_list)
Greg McGary [Wed, 3 Mar 2021 20:15:09 +0000 (12:15 -0800)]
[lld-macho] implement options -(un)exported_symbol(s_list)

Implement command-line options to alter a dylib's exported-symbols list:
* `-exported_symbol*` options override the default export list. The export list is compiled according to the command-line option(s) only.
* `-unexported_symbol*` options hide otherwise public symbols.
* `-*exported_symbol PATTERN` options specify a single literal or glob pattern.
* `-*exported_symbols_list FILE` options specify a file containing a series of lines containing symbol literals or glob patterns. Whitespace and `#`-prefix comments are stripped.

Note: This is a simple implementation of the primary use case. ld64 has much more complexity surrounding interactions with other options, many of which are obscure and undocumented. We will start simple and complexity as necessary.

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

3 years ago[Android] Default to --rtlib=compiler-rt
Ryan Prichard [Tue, 9 Mar 2021 22:20:45 +0000 (14:20 -0800)]
[Android] Default to --rtlib=compiler-rt

By default, the driver uses the compiler-rt builtins and links with
-l:libunwind.a.

Restore the previous behavior by passing --rtlib=libgcc.

Reviewed By: danalbert

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

3 years ago[coro async] Transfer the original function's attributes to the clone
Arnold Schwaighofer [Fri, 5 Mar 2021 15:17:55 +0000 (07:17 -0800)]
[coro async] Transfer the original function's attributes to the clone

rdar://75052917

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

3 years agoLog in SetPrivateState when unwind logging enabled
Jason Molenda [Wed, 10 Mar 2021 00:22:46 +0000 (16:22 -0800)]
Log in SetPrivateState when unwind logging enabled

It is easier to read the unwind logging when you can see
when the inferior resumes / stops and we're doing new unwinds.

3 years agoRemove unused variable (rolling it into an assert)
David Blaikie [Tue, 9 Mar 2021 23:50:25 +0000 (15:50 -0800)]
Remove unused variable (rolling it into an assert)

3 years ago[MemoryDependence] Fix invariant group store
William S. Moses [Tue, 9 Mar 2021 16:55:19 +0000 (11:55 -0500)]
[MemoryDependence] Fix invariant group store

Fix bug in MemoryDependence [and thus GVN] for invariant group.

Previously MemDep didn't verify that the store was storing into a
pointer rather than a store simply using a pointer.

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

3 years agoFix MLIR test post 890afad954d
Mehdi Amini [Tue, 9 Mar 2021 23:30:36 +0000 (23:30 +0000)]
Fix MLIR test post 890afad954d

3 years agoFix Flang build after MLIR API changes around `generatedTypeParser`
Mehdi Amini [Tue, 9 Mar 2021 23:13:38 +0000 (23:13 +0000)]
Fix Flang build after MLIR API changes around `generatedTypeParser`

3 years ago[llvm] Change DSOLocalEquivalent type if the underlying global value type changes
Leonard Chan [Sat, 6 Mar 2021 00:11:01 +0000 (16:11 -0800)]
[llvm] Change DSOLocalEquivalent type if the underlying global value type changes

We encountered an issue where LTO running on IR that used the DSOLocalEquivalent
constant would result in bad codegen. The underlying issue was ValueMapper wasn't
properly handling DSOLocalEquivalent, so this just adds the machinery for handling
it. This code path is triggered by a fix to DSOLocalEquivalent::handleOperandChangeImpl
where DSOLocalEquivalent could potentially not have the same type as its underlying GV.

This updates DSOLocalEquivalent::handleOperandChangeImpl to change the type if
the GV type changes and handles this constant in ValueMapper.

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

3 years ago[mlir][IR] Add an Operation::eraseOperands that supports batch erasure
River Riddle [Tue, 9 Mar 2021 23:02:03 +0000 (15:02 -0800)]
[mlir][IR] Add an Operation::eraseOperands that supports batch erasure

This method allows for removing multiple disjoint operands at once, reducing the need to erase operands individually (which results in shifting the operand list).

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

3 years ago[mlir][IR] Add a new SymbolUserMap class
River Riddle [Tue, 9 Mar 2021 23:01:54 +0000 (15:01 -0800)]
[mlir][IR] Add a new SymbolUserMap class

This class provides efficient implementations of symbol queries related to uses, such as collecting the users of a symbol, replacing all uses, etc. This provides similar benefits to use related queries, as SymbolTableCollection did for lookup queries.

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

3 years agoPR49465: Disallow constant evaluation of a call to operator delete(nullptr).
Richard Smith [Tue, 9 Mar 2021 23:04:51 +0000 (15:04 -0800)]
PR49465: Disallow constant evaluation of a call to operator delete(nullptr).

The only time we would consider allowing this is inside a call to
std::allocator<T>::deallocate, whose contract does not permit deletion
of null pointers.

3 years ago[clang][driver] Support Darwin SDK names with an optional prefix in their name
Alex Lorenz [Tue, 9 Mar 2021 22:42:07 +0000 (14:42 -0800)]
[clang][driver] Support Darwin SDK names with an optional prefix in their name

rdar://74017977

3 years agoRevert "[llvm-cov] reset executation count to 0 after wrapped segment"
Zequan Wu [Fri, 5 Mar 2021 21:38:12 +0000 (13:38 -0800)]
Revert "[llvm-cov] reset executation count to 0 after wrapped segment"

This reverts D85036

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

3 years ago[SLP] remove dead null check; NFC
Sanjay Patel [Tue, 9 Mar 2021 21:56:43 +0000 (16:56 -0500)]
[SLP] remove dead null check; NFC

We cast<> to Instruction (not dyn_cast<>), so we already
required/assumed that Cmp is not null.

3 years ago[dfsan] Tracking origins at memory transfer
Jianzhou Zhao [Sat, 6 Mar 2021 00:58:00 +0000 (00:58 +0000)]
[dfsan] Tracking origins at memory transfer

This is a part of https://reviews.llvm.org/D95835.

Reviewed By: morehouse

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

3 years agoFix LLVM Dialect LoopOptionsAttr round-tripping: the keywords were missing in the...
Mehdi Amini [Tue, 9 Mar 2021 21:59:35 +0000 (21:59 +0000)]
Fix LLVM Dialect LoopOptionsAttr round-tripping: the keywords were missing in the output

This indicated some missing test coverage, which are now added to the
roundtrip test.

3 years ago[ARM] Test for predicated scalar memops. NFC
David Green [Tue, 9 Mar 2021 21:57:18 +0000 (21:57 +0000)]
[ARM] Test for predicated scalar memops. NFC

This test shows a case where we can potentially scalarize the store in a
predicated loop, creating a lot of instructions that would be much
slower than scalar.

3 years ago[tests] add tests to show effects of D98122
Philip Reames [Tue, 9 Mar 2021 21:48:45 +0000 (13:48 -0800)]
[tests] add tests to show effects of D98122

3 years ago[cmake] Enable -Werror=return-type
Dave Lee [Mon, 8 Mar 2021 21:11:08 +0000 (13:11 -0800)]
[cmake] Enable -Werror=return-type

Turn `-Wreturn-type` into an error.

This is currently used by libcxx, libcxxabi, and libunwind, and would be a good default
for all of llvm. I'm not aware of any cases where this shouldn't be an error. This
ensures different build configs, merges, and downstream branches catch issues sooner.

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

3 years ago[clangd][NFC] Use std::string::replace in SourceCode:applyChange.
Nathan James [Tue, 9 Mar 2021 21:39:19 +0000 (21:39 +0000)]
[clangd][NFC] Use std::string::replace in SourceCode:applyChange.

Just looks nicer and easier to read.

Reviewed By: kadircet

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

3 years ago[clang][ObjC] allow the use of NSAttributedString * return type with format_arg attribute
Alex Lorenz [Tue, 9 Mar 2021 21:18:19 +0000 (13:18 -0800)]
[clang][ObjC] allow the use of NSAttributedString * return type with format_arg attribute

This is useful for APIs that want to produce an attributed NSString as a result of
some formatting API call.

3 years agoAdd default LoopOptionsAttrBuilder constructor and method to check if empty() (NFC)
Mehdi Amini [Tue, 9 Mar 2021 21:03:20 +0000 (21:03 +0000)]
Add default LoopOptionsAttrBuilder constructor and method to check if empty() (NFC)

Also move setters out-of-line to make sure the templated helper is
actually instantiated.

3 years ago[P10] [Power PC] Exploiting new load rightmost vector element instructions.
Albion Fung [Tue, 9 Mar 2021 21:07:31 +0000 (16:07 -0500)]
[P10] [Power PC] Exploiting new load rightmost vector element instructions.

This pull request implements patterns to exploit the load rightmost vector
element instructions for loading element 0 on little endian PowerPC subtargets
into v8i16 and v16i8 vector registers for i16 and i8 data types.

Differential Revision: https://reviews.llvm.org/D94816#inline-921403

3 years agoRevert "[InstCombine] Add simplification of two logical and/ors"
Juneyoung Lee [Tue, 9 Mar 2021 20:48:02 +0000 (05:48 +0900)]
Revert "[InstCombine] Add simplification of two logical and/ors"

This reverts commit 07c3b97e184d5bd828b8a680cdce46e73f3db9fc due to a reported failure in two-stage build.

3 years ago[profile] Fix InstrProfGetRangeRepValue to use UINT64_C
Fangrui Song [Tue, 9 Mar 2021 20:46:13 +0000 (12:46 -0800)]
[profile] Fix InstrProfGetRangeRepValue to use UINT64_C

This is a minor issue because the TargetValue parameter of `__llvm_profile_instrument_memop`
is usually small and cannot exceed 2**31 at all.

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

3 years ago[test] precommit tests from D98222
Philip Reames [Tue, 9 Mar 2021 20:39:47 +0000 (12:39 -0800)]
[test] precommit tests from D98222

3 years ago[SCEV] Infer known bits from known sign bits
Philip Reames [Tue, 9 Mar 2021 20:35:16 +0000 (12:35 -0800)]
[SCEV] Infer known bits from known sign bits

This was suggested by lebedev.ri over on D96534.  You'll note lack of tests.  During review, we weren't actually able to find a case which exercises it, but both I and lebedev.ri feel it's a reasonable change, straight forward, and near free.

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

3 years ago[flang] Sort symbols by creation order
Peter Steinfeld [Tue, 9 Mar 2021 01:17:14 +0000 (17:17 -0800)]
[flang] Sort symbols by creation order

We have a "<" operator defined on the type semantics::Symbol that's based on
the symbols' locations in the cooked character stream.  This is potentially
problematic when comparing symbols from .mod files when the cooked character
streams themselves might be allocated to varying memory locations.

This change fixes that by using the order in which symbols are created as the
basis for the "<" operator.  Thanks to Tim and Peter for consultation on the
necessity of doing this and the idea for what to use as the basis of the sort.

This change in the "<" operator changed the expected results for three of the
tests.  I manually inspected the new results, and they look OK to me.  The
differences in data05.f90 and typeinfo01.f90 are entirely the order, offsets,
and sizes of the derived type components.  The changes in resolve102.f90 are
due to the new, different "<" operator used for sorting.

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

3 years ago[DSE] Add test cases with memory intrinsics and varying size values.
Florian Hahn [Tue, 9 Mar 2021 13:10:47 +0000 (13:10 +0000)]
[DSE] Add test cases with memory intrinsics and varying size values.

This patch adds a few tests for memset/memcyp with non-constant size
values. Some of the tests will be optimized in further patches.

3 years agoAdd requirement for aarch64-registered-target to test change added in 42e3f97a9dd3a43...
Douglas Yung [Tue, 9 Mar 2021 20:24:32 +0000 (12:24 -0800)]
Add requirement for aarch64-registered-target to test change added in 42e3f97a9dd3a439f63a733c4ee909cba6b77e49.

3 years ago[dfsan] Update store.ll test
George Balatsouras [Tue, 9 Mar 2021 02:05:52 +0000 (18:05 -0800)]
[dfsan] Update store.ll test

This removes hard-coded shadow width references and adds more RUN
lines to increase test coverage under different options (fast16 labels
mode).

Also, shortens the test by unifying common lines under both combine- and no-combine-ptr-label options.

Reviewed By: stephan.yichao.zhao

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

3 years agoRevert D97743 "Define __GCC_HAVE_DWARF2_CFI_ASM if applicable"
Fangrui Song [Tue, 9 Mar 2021 20:14:12 +0000 (12:14 -0800)]
Revert D97743 "Define __GCC_HAVE_DWARF2_CFI_ASM if applicable"

This reverts commit c11ff4bbada3b5127a1f010e0a97a1e6e46fb61a & df67d3526962ae51446b1390e7c40e045e580ec2.

Trying to make the change to the driver to avoid round-trip issues.

3 years ago[test] Fix debug-info-macro.c
Fangrui Song [Tue, 9 Mar 2021 20:04:51 +0000 (12:04 -0800)]
[test] Fix debug-info-macro.c

3 years ago[mlir] Default for gpu-binary-annotation option.
Christian Sigg [Tue, 9 Mar 2021 19:19:32 +0000 (20:19 +0100)]
[mlir] Default for gpu-binary-annotation option.

Provide default for gpuBinaryAnnotation so that we don't need to specify it in tests.

The annotation likely only needs to be target specific if we want to lower to e.g. both CUDA and ROCDL.

Reviewed By: herhut, bondhugula

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

3 years agoMove some attribute diagnostic helper functions; NFC.
Aaron Ballman [Tue, 9 Mar 2021 19:52:59 +0000 (14:52 -0500)]
Move some attribute diagnostic helper functions; NFC.

These functions were local to SemaDeclAttr.cpp, but these functions are
useful in general (for instance, for statement or type attribute
processing). This refactoring is in advance of beginning to tablegen
diagnostic checks for statement attributes the way we already do for
declaration attributes.

There is one functional change in here as a drive-by. The
external_source_symbol attribute had one of its diagnostic checks
inside of an assert, which was corrected.

3 years ago[cgp] improve robustness of uadd/usub transforms
Philip Reames [Tue, 9 Mar 2021 19:44:43 +0000 (11:44 -0800)]
[cgp] improve robustness of uadd/usub transforms

LSR prefers to schedule iv increments just before the latch.  The recent 80511565 broadened this to moving increments in the original IR.  This pointed out a robustness problem with the CGP transform.

When we have a use of an induction increment outside of the loop (we canonicalize away from this form, but it happens e.g. unanalyzeable loops) we'd avoid performing the uadd/usub transform.  Interestingly, all of these involve moving the increment closer to it's operands, so there's no concern about dominating all uses.  We can handle that case cheaply, resulting in a more robust transform.

3 years ago[tests] precommit test for an upcoming change
Philip Reames [Tue, 9 Mar 2021 19:39:10 +0000 (11:39 -0800)]
[tests] precommit test for an upcoming change

3 years agoSwitch generatedTypeParser/generatedAttributeParser to return an OptionalParseResult
Mehdi Amini [Mon, 8 Mar 2021 06:06:37 +0000 (06:06 +0000)]
Switch generatedTypeParser/generatedAttributeParser to return an OptionalParseResult

This allows the caller to distinguish between a parse error or an
unmatched keyword. It fixes the redundant error that was emitted by the
caller when the generated parser would fail.

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

3 years agoRework LLVM Dialect LoopOptions attribute
Mehdi Amini [Sat, 6 Mar 2021 05:24:55 +0000 (05:24 +0000)]
Rework LLVM Dialect LoopOptions attribute

Instead of storing an array of LoopOpt attributes, which were just
wrapping std::pair<enum, int> anyway, we can have an attribute storing
a sorted ArrayRef<std::pair<enum, int>> as a single unit. This improves
here the textual format and the general API. Note that we're limiting
the options to fit into an int64_t by design, but this isn't a new
constraint.

Building the LoopOptions attribute is likely worth a specific builder
for efficient reason, that'll be the subject of a future patch.

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

3 years agoscudo: Add support for tracking stack traces of secondary allocations.
Peter Collingbourne [Wed, 6 Jan 2021 03:03:03 +0000 (19:03 -0800)]
scudo: Add support for tracking stack traces of secondary allocations.

There is no centralized store of information related to secondary
allocations. Moreover the allocations themselves become inaccessible
when the allocation is freed in order to implement UAF detection,
so we can't store information there to be used in case of UAF
anyway.

Therefore our storage location for tracking stack traces of secondary
allocations is a ring buffer. The ring buffer is copied to the process
creating the crash dump when a fault occurs.

The ring buffer is also used to store stack traces for primary
deallocations. Stack traces for primary allocations continue to be
stored inline.

In order to support the scenario where an access to the ring buffer
is interrupted by a concurrently occurring crash, the ring buffer is
accessed in a lock-free manner.

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

3 years ago[AArch64][GlobalISel] Form G_DUPLANE32 for <2 x s32> shufflevectors in lowering.
Amara Emerson [Fri, 5 Mar 2021 18:10:42 +0000 (10:10 -0800)]
[AArch64][GlobalISel] Form G_DUPLANE32 for <2 x s32> shufflevectors in lowering.

For <2 x s32>, we can use G_DUPLANE32, but with a <4 x s32> source. To make it
work, we can just widen the original source with a concat_vectors.

Doing this allows <2 x float> indexed fmul instruction selection patterns to
fire, which gives a nice 0.3% code size saving on Bullet with -Os.

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

3 years ago[GlobalISel] Fold away G_BUILD_VECTOR with all elements extracted.
Amara Emerson [Wed, 3 Mar 2021 22:55:03 +0000 (14:55 -0800)]
[GlobalISel] Fold away G_BUILD_VECTOR with all elements extracted.

If every element is extracted from a G_BUILD_VECTOR, pass through the source
registers. This is different to the extract(build_vector) combine because this
one tolerates multiple users as long as they're exhaustive.

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

3 years ago[cgp] group related code together [nfc]
Philip Reames [Tue, 9 Mar 2021 19:23:07 +0000 (11:23 -0800)]
[cgp] group related code together [nfc]

3 years ago[AArch64][GlobalISel] Add combine for extract_vector_elt(build_vector, cst)
Amara Emerson [Wed, 3 Mar 2021 07:48:55 +0000 (23:48 -0800)]
[AArch64][GlobalISel] Add combine for extract_vector_elt(build_vector, cst)

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

3 years ago[AMDGPU] Refactor AMDGPUTargetStreamer::EmitCodeEnd
Jay Foad [Tue, 9 Mar 2021 16:22:50 +0000 (16:22 +0000)]
[AMDGPU] Refactor AMDGPUTargetStreamer::EmitCodeEnd

Refactor and add comments to explain where the magic numbers come from
in terms of the instruction cache line size. NFC.

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

3 years ago[DebugInfo] Process DBG_VALUE_LIST in LiveDebugValues
gbtozers [Fri, 11 Sep 2020 15:19:51 +0000 (16:19 +0100)]
[DebugInfo] Process DBG_VALUE_LIST in LiveDebugValues

This patch implements DBG_VALUE_LIST handling to the LiveDebugValues pass. This
is a substantial change, and makes a few fundamental changes to the existing
logic.

We still use the basic model of a VarLocMap that is indexed by a LocIndex, with
a VarLocSet (a CoalescingBitVector underneath) giving us efficient lookups of
existing variable locations for a given location type. The main change is that
the VarLocMap may contain a given VarLoc multiple times (once for each unique
location operand), so that a VarLoc can be looked up from any of the registers
that it uses. This means that each VarLoc has multiple corresponding LocIndexes;
to allow us to iterate through the set of VarLocs (previously we would iterate
through the VarLocSet), we now also maintain a single entry in the VarLocMap
that contains every VarLoc exactly once.

The VarLoc class itself is also changed; this change is much simpler,
refactoring out location-specific members into a MachineLocation class and
adding a vector of these locations.

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

3 years ago[lldb][gui] Fix uninitialized variable in SourceFileWindowDelegate.
Jordan Rupprecht [Tue, 9 Mar 2021 18:51:06 +0000 (10:51 -0800)]
[lldb][gui] Fix uninitialized variable in SourceFileWindowDelegate.

After 5419b671375c46299ff1da6c929859040e7beaf5 (which is `[SimplifyCFG] Update FoldTwoEntryPHINode to handle and/or of select and binop equally`), this uninitialized value is detected by msan.

3 years ago[Support][test] Unconditionally use setenv macro when compiling on Windows
Markus Böck [Tue, 9 Mar 2021 18:52:24 +0000 (19:52 +0100)]
[Support][test] Unconditionally use setenv macro when compiling on Windows

This test currently fails to compile when using a MinGW toolchain as setenv is not defined. This function is a POSIX function Windows does not implement.

This patch enables the setenv macro used in the unit test for all of Windows, making the test compile and run successfully.

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

3 years agoDefine __GCC_HAVE_DWARF2_CFI_ASM if applicable
Fangrui Song [Tue, 9 Mar 2021 18:52:26 +0000 (10:52 -0800)]
Define __GCC_HAVE_DWARF2_CFI_ASM if applicable

In -fno-exceptions -fno-asynchronous-unwind-tables -g0 mode,
GCC does not emit `.cfi_*` directives.

```
% diff <(gcc -fno-asynchronous-unwind-tables -dM -E a.c) <(gcc -dM -E a.c)
130a131
> #define __GCC_HAVE_DWARF2_CFI_ASM 1
```

This macro is useful because code can decide whether inline asm should include `.cfi_*` directives.
`.cfi_*` directives without `.cfi_startproc` can cause assembler errors
(integrated assembler: `this directive must appear between .cfi_startproc and .cfi_endproc directives`).

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

3 years ago[lldb] Update crashlog script for JSON changes
Jonas Devlieghere [Tue, 9 Mar 2021 17:52:59 +0000 (09:52 -0800)]
[lldb] Update crashlog script for JSON changes

Update the crashlog script for changes to the JSON schema.

rdar://75122914

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

3 years ago[lldb] Propagate XDG_CACHE_HOME environment variable to tests
Jonas Devlieghere [Tue, 9 Mar 2021 17:49:33 +0000 (09:49 -0800)]
[lldb] Propagate XDG_CACHE_HOME environment variable to tests

This variable is used to reducing the likelihood of hitting module cache
issues in CI where different branches can potentially run on the same
machine.

3 years ago[lldb] Use lit.with_system_environment to propagate env variables
Jonas Devlieghere [Tue, 9 Mar 2021 17:44:32 +0000 (09:44 -0800)]
[lldb] Use lit.with_system_environment to propagate env variables

Use lit's with_system_environment function to propagate environment
variables to the tests. Include the usual suspects, as well as the
variables already explicitly forwarded.

3 years ago[cmake] Link socket/nsl on SunOS in llvm-jitlink
Nikita Popov [Sun, 28 Feb 2021 15:04:56 +0000 (16:04 +0100)]
[cmake] Link socket/nsl on SunOS in llvm-jitlink

llvm-jitlink and llvm-jitlink-executor make use of APIs that are
part of the socket and nsl libraries on SunOS systems (Solaris and
Illumos). Make sure they get linked.

Ran into this in Rust CI when cross-compiling LLVM 12 to these
targets.

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

3 years ago[NFC] Use llvm::SmallVector to workaround XL compiler problem on AIX
Xiangling Liao [Tue, 9 Mar 2021 18:01:03 +0000 (13:01 -0500)]
[NFC] Use llvm::SmallVector to workaround XL compiler problem on AIX

LLVM is recommending to use SmallVector (that is, omitting the N), in the
absence of a well-motivated choice for the number of inlined elements N.

However, this doesn't work well with XL compiler on AIX since some header(s)
aren't properly picked up with it. We need to take a further look into the real
issue underneath and fix it in a later patch.

But currently we'd like to use this patch to unblock the build compiler issue
first.

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

3 years ago[RISCV] Add support for VECTOR_REVERSE for scalable vector types.
Craig Topper [Tue, 9 Mar 2021 17:43:08 +0000 (09:43 -0800)]
[RISCV] Add support for VECTOR_REVERSE for scalable vector types.

I've left mask registers to a future patch as we'll need
to convert them to full vectors, shuffle, and then truncate.

Reviewed By: frasercrmck

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

3 years ago[AArch64][GlobalISel] Lower scalar G_{SMIN, SMAX, UMIN, UMAX}.
Amara Emerson [Tue, 9 Mar 2021 17:54:27 +0000 (09:54 -0800)]
[AArch64][GlobalISel] Lower scalar G_{SMIN, SMAX, UMIN, UMAX}.

3 years ago[MC] Change ELFOSABI_NONE to ELFOSABI_GNU for SHF_GNU_RETAIN
Fangrui Song [Tue, 9 Mar 2021 17:59:47 +0000 (09:59 -0800)]
[MC] Change ELFOSABI_NONE to ELFOSABI_GNU for SHF_GNU_RETAIN

GNU ld does not give SHF_GNU_RETAIN GC root semantics for ELFOSABI_NONE.
(https://sourceware.org/pipermail/binutils/2021-March/115581.html)

This allows GNU ld to interpret SHF_GNU_RETAIN and avoids a gold quirk
https://sourceware.org/bugzilla/show_bug.cgi?id=27490

Because ELFObjectWriter is in an anonymous namespace, I have to place
`markGnuAbi` in the parent MCObjectWriter.

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

3 years ago[AMDGPU] Fix the dead frame indices during custom spill lowering.
Christudasan Devadasan [Fri, 5 Mar 2021 07:59:14 +0000 (13:29 +0530)]
[AMDGPU] Fix the dead frame indices during custom spill lowering.

AMDGPU target tries to handle the SGPR and VGPR spills in a
custom pass before the actual frame lowering pass. Once they
are handled and the respective frames are eliminated in the
custom pass, certain uses of them still remain. For instance,
the DBG_VALUE instructions inserted by the allocator alongside
the spill instruction will use the corresponding frame index.
They become dead later during PEI and causes a crash while trying to
replace the frame indices. We should possibly avoid this custom pass.
For now, replacing such dead references with null register value.

Reviewed By: arsenm, scott.linder

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

3 years ago[FastISel] Don't trivially kill extractvalues (PR49467)
Nikita Popov [Sun, 7 Mar 2021 16:27:22 +0000 (17:27 +0100)]
[FastISel] Don't trivially kill extractvalues (PR49467)

All extractvalues of the same value at the same index will map to
the same register, so even if one specific extractvalue only has
one use, we should not mark it as a trivial kill, as there may be
more extractvalues later.

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

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

3 years ago[DebugInfo] Add replaceArg function to simplify DBG_VALUE_LIST expressions
gbtozers [Fri, 11 Sep 2020 14:52:53 +0000 (15:52 +0100)]
[DebugInfo] Add replaceArg function to simplify DBG_VALUE_LIST expressions

The LiveDebugValues and LiveDebugVariables implementations for handling
DBG_VALUE_LIST instructions can be simplified significantly if they do not have
to deal with any duplicated operands, such as a DBG_VALUE_LIST that uses the
same register multiple times in its expression. This patch adds a function,
replaceArg, that can be used to simplify a DIExpression in the case of
duplicated operands.

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

3 years ago[RISCV] Add support for fixed vector reductions.
Craig Topper [Tue, 9 Mar 2021 17:33:00 +0000 (09:33 -0800)]
[RISCV] Add support for fixed vector reductions.

I've included tests that require type legalization to split the
vector. The i64 version of these scalarizes on RV32 due to type
legalization visiting the result before the vector type. So we
have to abort our custom expansion to avoid creating target
specific nodes with an illegal type. Then type legalization ends
up scalarizing. We might be able to fix this by doing custom
splitting for large vectors in our handler to get down to a legal
type.

Reviewed By: frasercrmck

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

3 years agoRevert "[build][modules] Fix ObjCARCUtil.h modularization"
Dave Lee [Tue, 9 Mar 2021 17:36:13 +0000 (09:36 -0800)]
Revert "[build][modules] Fix ObjCARCUtil.h modularization"

This reverts commit f1b690598eeca0568e39134f28e0a59c1c1f3598.

3 years ago[clang] unbreak Index/preamble-reparse-changed-module.m with LLVM_APPEND_VC_REV=NO...
Nico Weber [Tue, 9 Mar 2021 17:28:48 +0000 (12:28 -0500)]
[clang] unbreak Index/preamble-reparse-changed-module.m with LLVM_APPEND_VC_REV=NO after 46d4d1fea401

See discussion starting at https://reviews.llvm.org/D96816#2572431 .
The same thing is happening with 46d4d1fea401.

3 years ago[RISCV] Don't modify the SEW immediate on the V extension pseudo instructions after...
Craig Topper [Tue, 9 Mar 2021 17:02:17 +0000 (09:02 -0800)]
[RISCV] Don't modify the SEW immediate on the V extension pseudo instructions after inserting VSETVLI.

Previously we set the value to -1, but the SEW information could
be useful for scheduling.

Reviewed By: frasercrmck, rogfer01

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

3 years ago[RISCV] Optimize fixed vector ABS. Fix crash on scalable vector ABS for SEW=64 with...
Craig Topper [Tue, 9 Mar 2021 16:51:01 +0000 (08:51 -0800)]
[RISCV] Optimize fixed vector ABS. Fix crash on scalable vector ABS for SEW=64 with RV32.

The default fixed vector expansion uses sra+xor+add since it can't
see that smax is legal due to our custom handling. So we select
smax(X, sub(0, X)) manually.

Scalable vectors are able to use the smax expansion automatically
for most cases. It crashes in one case because getConstant can't build a
SPLAT_VECTOR for nxvXi64 when i64 scalars aren't legal. So
we manually emit a SPLAT_VECTOR_I64 for that case.

Reviewed By: frasercrmck

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

3 years ago[RISCV] Make the hasStdExtM() check in RISCVInstrInfo::getVLENFactoredAmount emit...
Craig Topper [Tue, 9 Mar 2021 16:38:45 +0000 (08:38 -0800)]
[RISCV] Make the hasStdExtM() check in RISCVInstrInfo::getVLENFactoredAmount emit a diagnostic rather than an assert.

As far as I know we're not enforcing the StdExtM must be enabled
to use the V extension. If we use an assert here and hit this
code in a release build we'll silently emit an invalid instruction.

By using a diagnostic we report the error to the user in release
builds. I think there may still be a later fatal error from
the code emitter though.

Reviewed By: frasercrmck

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

3 years ago[DebugInfo] Handle multiple variable location operands in IR
gbtozers [Wed, 30 Sep 2020 18:07:01 +0000 (19:07 +0100)]
[DebugInfo] Handle multiple variable location operands in IR

This patch updates the various IR passes to correctly handle dbg.values with a
DIArgList location. This patch does not actually allow DIArgLists to be produced
by salvageDebugInfo, and it does not affect any pass after codegen-prepare.
Other than that, it should cover every IR pass.

Most of the changes simply extend code that operated on a single debug value to
operate on the list of debug values in the style of any_of, all_of, for_each,
etc. Instances of setOperand(0, ...) have been replaced with with
replaceVariableLocationOp, which takes the value that is being replaced as an
additional argument. In places where this value isn't readily available, we have
to track the old value through to the point where it gets replaced.

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

3 years ago[InstCombine] canonicalize 'not' op after min/max intrinsic
Sanjay Patel [Tue, 9 Mar 2021 16:23:34 +0000 (11:23 -0500)]
[InstCombine] canonicalize 'not' op after min/max intrinsic

This is another step towards parity between existing select
transforms and min/max intrinsics (D98152)..

The existing 'not' folds around select are complicated, so
it's likely that we will need to enhance this, but this
should be a safe step.

3 years ago[InstCombine] add tests for min/max intrinsics with not+constant; NFC
Sanjay Patel [Tue, 9 Mar 2021 14:29:30 +0000 (09:29 -0500)]
[InstCombine] add tests for min/max intrinsics with not+constant; NFC

3 years ago[clang] Fix crash when creating deduction guide.
Adam Czachorowski [Thu, 4 Mar 2021 17:01:06 +0000 (18:01 +0100)]
[clang] Fix crash when creating deduction guide.

We used to trigger assertion when transforming c-tor with unparsed
default argument. Now we ignore such constructors for this purpose.

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

3 years ago[Sema] Fix diagnostics for one-byte length modifier
Anton Bikineev [Thu, 4 Mar 2021 15:18:35 +0000 (16:18 +0100)]
[Sema] Fix diagnostics for one-byte length modifier

In case a char-literal of type int (C/ObjectiveC) corresponds to a
format specifier with the %hh length modifier, don't treat the literal
as of type char for issuing diagnostics, as otherwise this results in:

printf("%hhd", 'e');
warning: format specifies type 'char' but the argument has type 'char'.

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

3 years ago[AIX] do not emit visibility attribute into IR when there is -mignore-xcoff-visibility
diggerlin [Tue, 9 Mar 2021 15:38:00 +0000 (10:38 -0500)]
[AIX] do not emit visibility attribute into IR when there is -mignore-xcoff-visibility

SUMMARY:

n the patch https://reviews.llvm.org/D87451 "add new option -mignore-xcoff-visibility"
we did as "The option -mignore-xcoff-visibility has no effect on visibility attribute when compile with -emit-llvm option to generated LLVM IR."

in these patch we let -mignore-xcoff-visibility effect on generating IR too. the new feature only work on AIX OS

Reviewer: Jason Liu,

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

3 years ago[OpenMP] libomp: eliminate pause from atomic CAS loops
AndreyChurbanov [Tue, 9 Mar 2021 15:30:08 +0000 (18:30 +0300)]
[OpenMP] libomp: eliminate pause from atomic CAS loops

For clang this change is NFC cleanup, because clang
never calls atomic functions from runtime library.

Basically, pause is good in spin-loops waiting for something.
Atomic CAS loops do not wait for anything,
each CAS failure means some other thread progressed.

Performance experiments show that the pause only causes unnecessary slowdown
on CPUs with slow pause instruction, no difference on CPUs with fast pause
instruction, removal of the pause gives lesser binary size which is good.

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

3 years ago[flang][driver] Refine tests for module search directories
Andrzej Warzynski [Tue, 9 Mar 2021 14:20:43 +0000 (14:20 +0000)]
[flang][driver] Refine tests for module search directories

This patch refactors include-module.f90:
  * rename the test file as use-module.f90 to better highlight which
  driver feature is being tested
  * move tests for diagnostics to use-module-error.f90 (it tests that
  `-J/-module-dir` can only be used once)
  * make sure that `f18` is tested when `FLANG_BUILD_NEW_DRIVER` is
  set to `Off`
  * add tests for when all module files are successfully discovered and
  loaded

With this patch, there should be a clear separation into 3 scenarios in
use-module.f90:
  * Everything is OK
  * One module file wasn't found (missing include path for
  basictestingmoduletwo.mod)
  * Two module files are found, but the test requires
  `basictestingmoduleone.mod` from both `Inputs` and `Inputs/module-dir`.
  Only the latter is found.

Reviewed By: tskeith

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

3 years ago[ARM] Add comment explaining stack frame layout
Oliver Stannard [Tue, 9 Mar 2021 14:41:31 +0000 (14:41 +0000)]
[ARM] Add comment explaining stack frame layout

Add a comment explaining how we lay out stack frames for ARM targets,
based on the existing one for AArch64. Also expand the comment to
explain reserved call frames for both architectures.

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

3 years ago[clang][sema][NFC] Remove a superfluous semicolon
Timm Bäder [Tue, 9 Mar 2021 15:11:26 +0000 (16:11 +0100)]
[clang][sema][NFC] Remove a superfluous semicolon

Silences a GCC warning:

clang/lib/Sema/SemaChecking.cpp:4506:2: warning: extra ‘;’ [-Wpedantic]
 };
  ^

3 years ago[libcxx] [test] Adjust separator form in fs.op.absolute for libc++ on windows
Martin Storsjö [Fri, 26 Feb 2021 12:08:11 +0000 (14:08 +0200)]
[libcxx] [test] Adjust separator form in fs.op.absolute for libc++ on windows

This test was previously tweaked in
321f696920630be1b3c93e2a8b965c624ddd646c to match the output of
of MS STL (except that the MS STL fails on the testcase with an
empty path).

libc++ doesn't produce paths with all normalized separators (and the
spec doesn't mandate it to either).

Tweak the test reference to match exactly what libc++ produces. If
testing with a non-libc++ library, do a relaxed comparison that allows
the separators to differ.

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

3 years ago[clangd][NFC] Silence some buildbot warnings after 0250b053
Nathan James [Tue, 9 Mar 2021 14:55:55 +0000 (14:55 +0000)]
[clangd][NFC] Silence some buildbot warnings after 0250b053

https://reviews.llvm.org/D94554 introduced code which wont compile with some build flags due to a field having the same identifier as a type.

clang-tools-extra/clangd/DraftStore.h:55:11: error: declaration of ‘clang::clangd::DraftStore::Draft clang::clangd::DraftStore::DraftAndTime::Draft’ changes meaning of ‘Draft’ [-fpermissive]
   55 |     Draft Draft;
      |           ^~~~~
clang-tools-extra/clangd/DraftStore.h:30:10: note: ‘Draft’ declared here as ‘struct clang::clangd::DraftStore::Draft’
   30 |   struct Draft {
         |          ^~~~~

3 years ago[clangd] Add a Filesystem that overlays Dirty files.
Nathan James [Tue, 9 Mar 2021 14:35:20 +0000 (14:35 +0000)]
[clangd] Add a Filesystem that overlays Dirty files.

Create a `ThreadsafeFS` in the `DraftStore` that overlays the dirty file contents over another `ThreadsafeFS`.
This provides a nice thread-safe interface for using dirty file contents throughout the codebase, for example cross file refactoring.
Creating a Filesystem view will overlay a snapshot of the current contents, so if the draft store is updated while the view is being used, it will contain stale contents.

Reviewed By: sammccall

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

3 years ago[lldb] Fix a bug in D96779 (shared lib directory logic)
Pavel Labath [Tue, 9 Mar 2021 14:15:45 +0000 (15:15 +0100)]
[lldb] Fix a bug in D96779 (shared lib directory logic)

This function would fail in debug builds, as the two usages of the
LLDB_PYTHON_RELATIVE_LIBDIR macro would expand to two distinct strings.
The path iterator macros don't support that.

Use a temporary variable to ensure everything points to a single string.

3 years ago[X86] canonicalizeShuffleWithBinOps - add binary shuffle handling
Simon Pilgrim [Tue, 9 Mar 2021 12:29:16 +0000 (12:29 +0000)]
[X86] canonicalizeShuffleWithBinOps - add binary shuffle handling

3 years ago[InstCombine] fold min/max intrinsics with not ops
Sanjay Patel [Tue, 9 Mar 2021 13:14:30 +0000 (08:14 -0500)]
[InstCombine] fold min/max intrinsics with not ops

This is a partial translation of the existing select-based
folds. We need to recreate several different transforms to
avoid regressions as noted in D98152.

https://alive2.llvm.org/ce/z/teuZ_J

3 years ago[mlir] Use affine.apply when distributing to processors
Lei Zhang [Tue, 9 Mar 2021 13:36:42 +0000 (08:36 -0500)]
[mlir] Use affine.apply when distributing to processors

This makes it easy to compose the distribution computation with
other affine computations.

Reviewed By: mravishankar

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

3 years ago[X86][NFC] Move instruction selection of the x86_tdpb[s,u]d_internal and x86_tilezero...
Liu, Chen3 [Fri, 5 Mar 2021 00:46:44 +0000 (08:46 +0800)]
[X86][NFC] Move instruction selection of the x86_tdpb[s,u]d_internal and x86_tilezero_internal to X86InstrAMX.td

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

3 years ago[lldb][JITLoaderGDB] Test debug support in JITLink
Stefan Gränitz [Tue, 2 Mar 2021 14:53:58 +0000 (15:53 +0100)]
[lldb][JITLoaderGDB] Test debug support in JITLink

LLVM OrcJIT is shifting from RuntimeDyld to JITLink. Starting with D96627 I am planning to add debug support. It would be great to have test coverage for it in LLDB early on.

Reviewed By: labath

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

3 years ago[ExtVectorType] Support conditional select operator for C++.
Florian Hahn [Tue, 9 Mar 2021 12:22:20 +0000 (12:22 +0000)]
[ExtVectorType] Support conditional select operator for C++.

This patch implements the conditional select operator for
ext_vector_types in C++. It does so by using the same semantics as for
C.

D71463 added support for the conditional select operator for VectorType
in C++. Unfortunately the semantics between ext_vector_type in C are
different to VectorType in C++. Select for ext_vector_type is based on
the MSB of the condition vector, whereas for VectorType it is `!= 0`.

This unfortunately means that the behavior is inconsistent between
ExtVectorType and VectorType, but I think using the C semantics for
ExtVectorType in C++ as well should be less surprising for users.

Reviewed By: erichkeane, aaron.ballman

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

3 years ago[Orc] Always check mapped sections for ELFDebugObject are in bounds of working memory...
Stefan Gränitz [Tue, 9 Mar 2021 11:51:51 +0000 (12:51 +0100)]
[Orc] Always check mapped sections for ELFDebugObject are in bounds of working memory buffer

As stated in the JITLink user guide: Do not assume that the input object is well formed.
https://llvm.org/docs/JITLink.html#tips-for-jitlink-backend-developers

3 years ago[Orc] Test DebugObjectManagerPlugin fills in load-address for .text section of in...
Stefan Gränitz [Tue, 9 Mar 2021 11:49:08 +0000 (12:49 +0100)]
[Orc] Test DebugObjectManagerPlugin fills in load-address for .text section of in-memory ELF debug object

3 years ago[Orc] Fix working memory buffer for section mapping in ELFDebugObject
Stefan Gränitz [Tue, 9 Mar 2021 11:44:21 +0000 (12:44 +0100)]
[Orc] Fix working memory buffer for section mapping in ELFDebugObject

3 years ago[DebugInfo] Add tests for ISel handling of variadic debug values
gbtozers [Tue, 29 Sep 2020 15:04:05 +0000 (16:04 +0100)]
[DebugInfo] Add tests for ISel handling of variadic debug values

This patch adds a set of lit tests for ISel support of DIArgList/DBG_VALUE_LIST.

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

3 years ago[DebugInfo] Emit DBG_VALUE_LIST from ISel
gbtozers [Tue, 29 Sep 2020 14:54:29 +0000 (15:54 +0100)]
[DebugInfo] Emit DBG_VALUE_LIST from ISel

This patch completes ISel support for DIArgList dbg.values by allowing
SDDbgValues with multiple location operands to be emitted as DBG_VALUE_LIST
instructions.

The primary change of this patch is refactoring EmitDbgValue by pulling location
operand emission out to the new function AddDbgValueLocationOps, which is used
for both DIArgList and single value dbg.values. Outside of that, the only
behaviour change is that the scheduler has a lambda added, HasUnknownVReg, to
prevent us from attempting to emit a DBG_VALUE_LIST before all of its used VRegs
have become available.

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

3 years ago[lld][MachO] Add missing test requirements
Alexander Shaposhnikov [Tue, 9 Mar 2021 12:05:08 +0000 (04:05 -0800)]
[lld][MachO] Add missing test requirements

Similarly to the existing tests (e.g. stab.s) function-starts.s
is not supported on Windows.

3 years ago[X86][NFC] Adding one flag to imply whether the instruction should check the predicat...
Liu, Chen3 [Fri, 5 Mar 2021 07:11:20 +0000 (15:11 +0800)]
[X86][NFC] Adding one flag to imply whether the instruction should check the predicate when compress EVEX instructions to VEX encoding.

Some EVEX instructions should check the predicates when compress to VEX
encoding. For example, avx512vnni instructions. This is because avx512vnni
doesn't mean that avxvnni is supported on the target.
This patch moving the manually added check to .inc that generated by tablegen.

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

3 years ago[X86][AMX] Add test case for combining AMX bitcast.
Luo, Yuanke [Tue, 9 Mar 2021 11:46:00 +0000 (19:46 +0800)]
[X86][AMX] Add test case for combining AMX bitcast.

3 years ago[InstCombine] Simplify phis with incoming pointer-casts.
Florian Hahn [Tue, 9 Mar 2021 09:27:25 +0000 (09:27 +0000)]
[InstCombine] Simplify phis with incoming pointer-casts.

If the incoming values of a phi are pointer casts of the same original
value, replace the phi with a single cast. Such redundant phis are
somewhat common after loop-rotate and removing them can avoid some
unnecessary code bloat, e.g. because an iteration of a loop is peeled
off to make the phi invariant. It should also simplify further analysis
on its own.

InstCombine already uses stripPointerCasts in a couple of places and
also simplifies phis based on the incoming values, so the patch should
fit in the existing scope.

The patch causes binary changes in 47 out of 237 benchmarks in
MultiSource/SPEC2000/SPEC2006 with -O3 -flto on X86.

Reviewed By: lebedev.ri

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

3 years ago[OpenCL] Fix builtins that require multiple extensions
Sven van Haastregt [Tue, 9 Mar 2021 11:37:26 +0000 (11:37 +0000)]
[OpenCL] Fix builtins that require multiple extensions

Builtins that require multiple extensions, such as certain
`write_imagef` forms, were not exposed because of the Sema check not
splitting the extension string.

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

3 years agoM68kInstrInfo::AnalyzeBranchImpl - fix MSVC build. NFCI.
Simon Pilgrim [Tue, 9 Mar 2021 11:06:29 +0000 (11:06 +0000)]
M68kInstrInfo::AnalyzeBranchImpl - fix MSVC build. NFCI.

MSVC couldn't resolve the decltype of a capture of a capture - but is happy with an auto.

3 years ago[compiler-rt] FuzzedDataProvider: Add missing include
MarcoFalke [Fri, 5 Mar 2021 18:20:22 +0000 (19:20 +0100)]
[compiler-rt] FuzzedDataProvider: Add missing include

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

3 years ago[clangd] Move logging out of LSPTest base class into a separate one.
Kadir Cetinkaya [Tue, 9 Mar 2021 10:15:40 +0000 (11:15 +0100)]
[clangd] Move logging out of LSPTest base class into a separate one.

This was causing TSan failures due to a race on vptr during destruction,
see
https://lab.llvm.org/buildbot/#/builders/131/builds/6579/steps/6/logs/FAIL__Clangd_Unit_Tests__LSPTest_FeatureModulesThr.

The story is, during the execution of a destructor all the virtual
dispatches should resolve to implementations in the class being
destroyed, not the derived ones. And LSPTests will log some stuff during
destruction (we send shutdown/exit requests, which are logged), which is
a virtual dispatch when LSPTest is derived from clang::clangd::Logger.

It is a benign race in our case, as gtests that derive from LSPTest
doesn't override the `log` method. But still during destruction, we
might try to update vtable ptr (due to being done with destruction of
test and starting destruction of LSPTest) and read from it to dispatch a
log message at the same time.

This patch fixes that race by moving `log` out of the vtable of
`LSPTest`.

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