platform/upstream/llvm.git
3 years agoFix errors in 0b69756110db444282c40ea16929186b2910c3b1
Walter Erquinigo [Wed, 31 Mar 2021 00:53:57 +0000 (17:53 -0700)]
Fix errors in 0b69756110db444282c40ea16929186b2910c3b1

Errors found in
https://lab.llvm.org/buildbot/#/builders/68/builds/9681/steps/6/logs/stdio

3 years ago[JITLink] Add a setProtectionFlags method to jitlink::Section.
Lang Hames [Wed, 31 Mar 2021 00:53:59 +0000 (17:53 -0700)]
[JITLink] Add a setProtectionFlags method to jitlink::Section.

This allows clients to modify the memory protection settings on sections via
jitlink passes. This can be used to, for example, override the default settings
on text pages and make them Read/Write/Executable under the JIT.

3 years agoFix test expectations for %diff documentation.
Richard Smith [Wed, 31 Mar 2021 00:47:47 +0000 (17:47 -0700)]
Fix test expectations for %diff documentation.

3 years ago[StructLayout] Use TrailingObjects to allocate space for MemberOffsets.
Craig Topper [Tue, 30 Mar 2021 23:43:12 +0000 (16:43 -0700)]
[StructLayout] Use TrailingObjects to allocate space for MemberOffsets.

MemberOffsets are stored at the end of StructLayout. The class
contains a single entry array to mark the start of the member
offsets. getStructLayout calculates the additional space needed
for additional elements before allocating memory.

This patch converts this to use TrailingObjects. This simplifies
the size computation in getStructLayout and gets rid of the
single entry array.

This is prep work, but to use TypeSize instead of uint64_t for
D98169. The single entry array doesn't work with TypeSize because
TypeSize doesn't have a default constructor. We thought this
change was an improvement by itself so we've separated it out.

Reviewed By: mehdi_amini

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

3 years agoReland "[gn build] port 48e4b0f (__config_site)"
Nico Weber [Wed, 31 Mar 2021 00:30:36 +0000 (20:30 -0400)]
Reland "[gn build] port 48e4b0f (__config_site)"

This reverts commit 13aff21f0da7007c42d407b4ec5c1f6b24cb6831,
since the CMake part relanded in c06a8f9caa51c7ea7.

The GN part is a bit simpler than last time due to the
prior simplifications in acea470c167fc40.

3 years ago[trace][intel-pt] Implement trace start and trace stop
Walter Erquinigo [Mon, 9 Nov 2020 21:36:26 +0000 (13:36 -0800)]
[trace][intel-pt] Implement trace start and trace stop

This implements the interactive trace start and stop methods.

This diff ended up being much larger than I anticipated because, by doing it, I found that I had implemented in the beginning many things in a non optimal way. In any case, the code is much better now.

There's a lot of boilerplate code due to the gdb-remote protocol, but the main changes are:

- New tracing packets: jLLDBTraceStop, jLLDBTraceStart, jLLDBTraceGetBinaryData. The gdb-remote packet definitions are quite comprehensive.
- Implementation of the "process trace start|stop" and "thread trace start|stop" commands.
- Implementaiton of an API in Trace.h to interact with live traces.
- Created an IntelPTDecoder for live threads, that use the debugger's stop id as checkpoint for its internal cache.
- Added a functionality to stop the process in case "process tracing" is enabled and a new thread can't traced.
- Added tests

I have some ideas to unify the code paths for post mortem and live threads, but I'll do that in another diff.

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

3 years ago[www] List both the regular and expanded form of %diff in the
Richard Smith [Wed, 31 Mar 2021 00:21:31 +0000 (17:21 -0700)]
[www] List both the regular and expanded form of %diff in the
diagnostics reference.

In passing, properly validate and diagnose errors in %diff format
specifiers.

3 years ago[LLDB] Arm64/Linux test case for MTE and Pointer Authentication regset
Muhammad Omair Javaid [Tue, 30 Mar 2021 10:39:38 +0000 (15:39 +0500)]
[LLDB] Arm64/Linux test case for MTE and Pointer Authentication regset

This patch adds a test case to test AArch64 dynamic register sets.
This tests for the availability of certain register sets and query
their registers accordingly.

Reviewed By: labath, DavidSpickett

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

3 years ago[LLDB] Arm64/Linux Add MTE and Pointer Authentication registers
Muhammad Omair Javaid [Tue, 30 Mar 2021 10:39:38 +0000 (15:39 +0500)]
[LLDB] Arm64/Linux Add MTE and Pointer Authentication registers

This patch adds two new dynamic register sets for AArch64 MTE and
Pointer Authentication features. These register sets are dynamic and
will only be available if underlying hardware support either of these
features. LLDB will pull in Aux vector information and create register
infos based on that information.

A follow up patch will add a test case to test these feature registers.

Reviewed By: labath, DavidSpickett

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

3 years ago[LLDB] Add support for Arm64/Linux dynamic register sets
Muhammad Omair Javaid [Tue, 30 Mar 2021 10:39:32 +0000 (15:39 +0500)]
[LLDB] Add support for Arm64/Linux dynamic register sets

This is patch adds support for adding dynamic register sets for
AArch64 dynamic features in LLDB. AArch64 has optional features like
SVE, Pointer Authentication and MTE which means LLDB needs to decide
at run time which registers it needs to pull in for the current
executable based on underlying support for a certain feature.

This patch makes necessary adjustments to make way for dynamic
register infos and dynamic register sets.

Reviewed By: labath

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

3 years ago[WebAssembly] Encode numbers in ULEB128 in event section
Heejin Ahn [Tue, 30 Mar 2021 19:57:20 +0000 (12:57 -0700)]
[WebAssembly] Encode numbers in ULEB128 in event section

The number of events and the type index should be encoded in ULEB128,
but they were incorrctly encoded in LEB128. The smallest number with
which its LEB128 and ULEB128 encodings are different is 64.
There's no way we can generate 64 events in the C++ toolchain
implementation so we can't test that, but the attached test tests when
the type index is 64.

Reviewed By: dschuff

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

3 years agoDelete checked-in generated copy of diagnostic reference.
Richard Smith [Tue, 30 Mar 2021 23:17:32 +0000 (16:17 -0700)]
Delete checked-in generated copy of diagnostic reference.

The documentation build rule will generate an up-to-date version of this
if it's not checked in.

3 years ago[www] Fix build of attribute documentation.
Richard Smith [Tue, 30 Mar 2021 23:17:09 +0000 (16:17 -0700)]
[www] Fix build of attribute documentation.

3 years agoFix pluralization error in diagnostic, and move C++ testcase to proper
Richard Smith [Tue, 30 Mar 2021 23:10:32 +0000 (16:10 -0700)]
Fix pluralization error in diagnostic, and move C++ testcase to proper
directory.

3 years ago[lld-link] Enable addrsig table in COFF lto
Zequan Wu [Tue, 30 Mar 2021 18:02:27 +0000 (11:02 -0700)]
[lld-link] Enable addrsig table in COFF lto

This allow safe-icf mode to work when linking with LTO.

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

3 years ago[www] Color Clang 11 and Clang 12 features as green and not yellow, and
Richard Smith [Tue, 30 Mar 2021 22:20:33 +0000 (15:20 -0700)]
[www] Color Clang 11 and Clang 12 features as green and not yellow, and
Clang 13 features as yellow not green.

3 years agoFix deletion of operations through the rewriter in a pattern matching a consumer...
Mehdi Amini [Tue, 30 Mar 2021 21:11:02 +0000 (21:11 +0000)]
Fix deletion of operations through the rewriter in a pattern matching a consumer operation

This allows for the conversion to match `A(B()) -> C()` with a pattern matching
`A` and marking `B` for deletion.

Also add better assertions when an operation is erased while still having uses.

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

3 years ago[lld-macho][NFC] Drop unnecessary macho:: namespace prefix on unambiguous references...
Greg McGary [Tue, 30 Mar 2021 00:19:29 +0000 (17:19 -0700)]
[lld-macho][NFC] Drop unnecessary macho:: namespace prefix on unambiguous references to Symbol

Within `lld/macho/`, only `InputFiles.cpp` and `Symbols.h` require the `macho::` namespace qualifier to disambiguate references to `class Symbol`.

Add braces to outer `for` of a 5-level single-line `if`/`for` nest.

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

3 years ago[ThinLTO] During module importing, close one source module before open
Wei Mi [Mon, 29 Mar 2021 22:04:28 +0000 (15:04 -0700)]
[ThinLTO] During module importing, close one source module before open
another one for distributed mode.

Currently during module importing, ThinLTO opens all the source modules,
collect functions to be imported and append them to the destination module,
then leave all the modules open through out the lto backend pipeline. This
patch refactors it in the way that one source module will be closed before
another source module is opened. All the source modules will be closed after
importing phase is done. It will save some amount of memory when there are
many source modules to be imported.

Note that this patch only changes the distributed thinlto mode. For in
process thinlto mode, one source module is shared acorss different thinlto
backend threads so it is not changed in this patch.

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

3 years ago[docs] Fix up dead clang-format links after monorepo move. NFC
Jon Roelofs [Tue, 30 Mar 2021 21:29:35 +0000 (14:29 -0700)]
[docs] Fix up dead clang-format links after monorepo move. NFC

3 years ago[OPENMP51]Initial support for the dispatch directive.
Mike Rice [Tue, 23 Mar 2021 01:13:29 +0000 (18:13 -0700)]
[OPENMP51]Initial support for the dispatch directive.

Added basic parsing/sema/serialization support for dispatch directive.

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

3 years ago[libc++] Include <__config_site> from <__config>
Louis Dionne [Fri, 26 Jun 2020 16:08:59 +0000 (12:08 -0400)]
[libc++] Include <__config_site> from <__config>

Prior to this patch, we would generate a fancy <__config> header by
concatenating <__config_site> and <__config>. This complexifies the
build system and also increases the difference between what's tested
and what's actually installed.

This patch removes that complexity and instead simply installs <__config_site>
alongside the libc++ headers. <__config_site> is then included by <__config>,
which is much simpler. Doing this also opens the door to having different
<__config_site> headers depending on the target, which was impossible before.

It does change the workflow for testing header-only changes to libc++.
Previously, we would run `lit` against the headers in libcxx/include.
After this patch, we run it against a fake installation root of the
headers (containing a proper <__config_site> header). This makes use
closer to testing what we actually install, which is good, however it
does mean that we have to update that root before testing header changes.
Thus, we now need to run `ninja check-cxx-deps` before running `lit` by
hand.

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

3 years ago[ARM] Add FeatureHasNoBranchPredictor for Thumb1 cores
David Green [Tue, 30 Mar 2021 20:45:26 +0000 (21:45 +0100)]
[ARM] Add FeatureHasNoBranchPredictor for Thumb1 cores

Mark v6m/v8m-baseline cores as having no branch predictors. This should
not alter very much on its own, but is more correct as the cores do not
have branch predictors and can help in the future.

3 years ago[OPENMP]Fix PR48607: Crash during clang openmp codegen for firstprivate() of `float...
Alexey Bataev [Tue, 30 Mar 2021 19:53:25 +0000 (12:53 -0700)]
[OPENMP]Fix PR48607: Crash during clang openmp codegen for firstprivate() of `float _Complex`.

Need to cast the argument for the debug wrapper function call to the
corresponding parameter type to avoid crash.

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

3 years ago[Sanitizer][RISCV][AArch64][Android] Adjust allocator tests
Luís Marques [Tue, 30 Mar 2021 20:19:05 +0000 (21:19 +0100)]
[Sanitizer][RISCV][AArch64][Android] Adjust allocator tests

On 64-bit systems with small VMAs (e.g. 39-bit) we can't use
SizeClassAllocator64 parameterized with size class maps containing a large
number of classes, as that will make the allocator region size too small
(< 2^32). Several tests were already disabled for Android because of this.

This patch provides the correct allocator configuration for RISC-V
(riscv64), generalizes the gating condition for tests that can't be enabled
for small VMA systems, and tweaks the tests that can be made compatible with
those systems to enable them.

I think the previous gating on Android should instead be AArch64+Android, so
the patch reflects that.

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

3 years agoConditionalize the JIT test dependency
David Blaikie [Tue, 30 Mar 2021 01:04:02 +0000 (18:04 -0700)]
Conditionalize the JIT test dependency

3 years ago[clang] Use decltype((E)) for compound requirement type constraint
Matheus Izvekov [Mon, 8 Mar 2021 00:09:13 +0000 (01:09 +0100)]
[clang] Use decltype((E)) for compound requirement type constraint

See PR45088.

Compound requirement type constraints were using decltype(E) instead of
decltype((E)), as per `[expr.prim.req]p1.3.3`.

Since neither instantiation nor type dependence should matter for
the constraints, this uses an approach where a `decltype` type is not built,
and just the canonical type of the expression after template instantiation
is used on the requirement.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Reviewed By: rsmith

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

3 years ago[GlobalISel] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D99463
Fangrui Song [Tue, 30 Mar 2021 19:52:56 +0000 (12:52 -0700)]
[GlobalISel] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D99463

3 years ago[InstCombine] add fold for demand of low bit of abs()
Sanjay Patel [Tue, 30 Mar 2021 18:33:30 +0000 (14:33 -0400)]
[InstCombine] add fold for demand of low bit of abs()

This is one problem shown in https://llvm.org/PR49763

https://alive2.llvm.org/ce/z/cV6-4K
https://alive2.llvm.org/ce/z/9_3g-L

3 years ago[InstCombine] add test for abs() demanded bits; NFC
Sanjay Patel [Tue, 30 Mar 2021 18:29:19 +0000 (14:29 -0400)]
[InstCombine] add test for abs() demanded bits; NFC

3 years ago[VPlan] Use SetVector for VPExternalDefs to prevent non-determinism.
Huihui Zhang [Tue, 30 Mar 2021 19:10:44 +0000 (12:10 -0700)]
[VPlan] Use SetVector for VPExternalDefs to prevent non-determinism.

Use SetVector instead of SmallPtrSet for external definitions created for VPlan.
Doing this can help avoid non-determinism caused by iterating over unordered containers.

This bug was found with reverse iteration turning on,
 --extra-llvm-cmake-variables="-DLLVM_REVERSE_ITERATION=ON".
Failing LLVM-Unit test VPRecipeTest.dump.

Reviewed By: MaskRay

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

3 years ago[GlobalISel] Implement fewerElements legalization for vector reductions.
Amara Emerson [Sun, 21 Feb 2021 22:17:03 +0000 (14:17 -0800)]
[GlobalISel] Implement fewerElements legalization for vector reductions.

This patch adds 3 methods, one for power-of-2 vectors which use tree
reductions using vector ops, before a final reduction op. For non-pow-2
types it generates multiple narrow reductions and combines the values with
scalar ops.

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

3 years ago[AArch64][GlobalISel] Define some legalization rules for G_ROTR and G_ROTL.
Amara Emerson [Sun, 28 Mar 2021 07:38:39 +0000 (00:38 -0700)]
[AArch64][GlobalISel] Define some legalization rules for G_ROTR and G_ROTL.

For imported pattern purposes, we have a custom rule that promotes the rotate
amount to 64b as well.

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

3 years ago[AArch64][GlobalISel] Combine funnel shifts to rotates.
Amara Emerson [Wed, 24 Mar 2021 06:54:18 +0000 (23:54 -0700)]
[AArch64][GlobalISel] Combine funnel shifts to rotates.

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

3 years ago[DebugInfo] Support for signed constants inside DIExpression
Sourabh Singh Tomar [Wed, 24 Mar 2021 12:24:05 +0000 (17:54 +0530)]
[DebugInfo] Support for signed constants inside DIExpression

Negative numbers are represented using DW_OP_consts along with signed representation
of the number as the argument.

Test case IR is generated using Fortran front-end.

Reviewed By: aprantl

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

3 years ago[mlir] Linalg: add tile interchange flag to test-linalg-codegen-strategy pass
Eugene Zhulenev [Fri, 26 Mar 2021 02:49:27 +0000 (19:49 -0700)]
[mlir] Linalg: add tile interchange flag to test-linalg-codegen-strategy pass

Interchange options was missing in the pass flags.

Reviewed By: nicolasvasilache

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

3 years ago[SamplePGO] Keeping prof metadata for IndirectBrInst
spupyrev [Tue, 30 Mar 2021 17:38:58 +0000 (10:38 -0700)]
[SamplePGO] Keeping prof metadata for IndirectBrInst

Currently prof metadata with branch counts is added only for BranchInst and SwitchInst, but not for IndirectBrInst. As a result, BPI/BFI make incorrect inferences for indirect branches, which can be very hot.
This diff adds metadata for IndirectBrInst, in addition to BranchInst and SwitchInst.

Reviewed By: wmi, wenlei

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

3 years ago[CSSPGO] Top-down processing order based on full profile.
Hongtao Yu [Mon, 29 Mar 2021 17:21:31 +0000 (10:21 -0700)]
[CSSPGO] Top-down processing order based on full profile.

Use profiled call edges to augment the top-down order. There are cases that the top-down order computed based on the static call graph doesn't reflect real execution order. For example:

1. Incomplete static call graph due to unknown indirect call targets. Adjusting the order by considering indirect call edges from the profile can enable the inlining of indirect call targets by allowing the caller processed before them.

2. Mutual call edges in an SCC. The static processing order computed for an SCC may not reflect the call contexts in the context-sensitive profile, thus may cause potential inlining to be overlooked. The function order in one SCC is being adjusted to a top-down order based on the profile to favor more inlining.

3. Transitive indirect call edges due to inlining. When a callee function is inlined into into a caller function in LTO prelink, every call edge originated from the callee will be transferred to the caller. If any of the transferred edges is indirect, the original profiled indirect edge, even if considered, would not enforce a top-down order from the caller to the potential indirect call target in LTO postlink since the inlined callee is gone from the static call graph.

4. #3 can happen even for direct call targets, due to functions defined in header files. Header functions, when included into source files, are defined multiple times but only one definition survives due to ODR. Therefore, the LTO prelink inlining done on those dropped definitions can be useless based on a local file scope. More importantly, the inlinee, once fully inlined to a to-be-dropped inliner, will have no profile to consume when its outlined version is compiled. This can lead to a profile-less prelink compilation for the outlined version of the inlinee function which may be called from external modules. while this isn't easy to fix, we rely on the postlink AutoFDO pipeline to optimize the inlinee. Since the survived copy of the inliner (defined in headers) can be inlined in its local scope in prelink, it may not exist in the merged IR in postlink, and we'll need the profiled call edges to enforce a top-down order for the rest of the functions.

Considering those cases, a profiled call graph completely independent of the static call graph is constructed based on profile data, where function objects are not even needed to handle case #3 and case 4.

I'm seeing an average 0.4% perf win out of SPEC2017. For certain benchmark such as Xalanbmk and GCC, the win is bigger, above 2%.

The change is an enhancement to https://reviews.llvm.org/D95988.

Reviewed By: wmi, wenlei

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

3 years ago[clang][cli] Fix round-trip of OPT_plugin_arg
John Brawn [Tue, 30 Mar 2021 17:33:10 +0000 (18:33 +0100)]
[clang][cli] Fix round-trip of OPT_plugin_arg

The test Frontend/plugin-delayed-template.cpp is failing when asserts
are enabled because it hits an assertion in denormalizeStringImpl when
trying to round-trip OPT_plugin_arg. Fix this by adjusting how the
option is handled, as the first part is joined to -plugin-arg and the
second is separate.

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

3 years ago[GlobalISel][AArch64] Combine G_SEXT_INREG + right shift -> G_SBFX
Jessica Paquette [Tue, 23 Mar 2021 22:33:10 +0000 (15:33 -0700)]
[GlobalISel][AArch64] Combine G_SEXT_INREG + right shift -> G_SBFX

Basically a port of isBitfieldExtractOpFromSExtInReg in AArch64ISelDAGToDAG.

This is only done post-legalization for now. Once the legalizer knows how to
decompose these back into shifts, this requirement can probably be removed.

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

3 years ago[lldb] Remove reproducer from previous test run
Jonas Devlieghere [Tue, 30 Mar 2021 17:09:55 +0000 (10:09 -0700)]
[lldb] Remove reproducer from previous test run

3 years agoAdd a "register_runtime" method to the mlir.execution_engine and show calling back...
Mehdi Amini [Tue, 30 Mar 2021 04:35:36 +0000 (04:35 +0000)]
Add a "register_runtime" method to the mlir.execution_engine and show calling back from MLIR into Python

This exposes the ability to register Python functions with the JIT and
exposes them to the MLIR jitted code. The provided test case illustrates
the mechanism.

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

3 years agoAdd -disable-verify flag to llvm-link.
Nick Lewycky [Thu, 25 Mar 2021 21:40:17 +0000 (14:40 -0700)]
Add -disable-verify flag to llvm-link.

This flag allows the developer to see the result of linking even if it fails the verifier, as a step in debugging cases where the linked module fails the verifier.

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

3 years ago[lldb] [test] Mark more lldb-server tests xfail on Windows
Michał Górny [Tue, 30 Mar 2021 16:48:49 +0000 (18:48 +0200)]
[lldb] [test] Mark more lldb-server tests xfail on Windows

3 years ago[RISCV] Pass 'half' in the lower 16 bits of an f32 value when F extension is enabled...
Craig Topper [Tue, 30 Mar 2021 16:34:56 +0000 (09:34 -0700)]
[RISCV] Pass 'half' in the lower 16 bits of an f32 value when F extension is enabled, but Zfh is not.

Without Zfh the half type isn't legal, but it could still be
used as an argument/return in IR. Clang will not generate this today.

Previously we promoted the half value to float for arguments and
returns if the F extension is enabled but Zfh isn't. Then depending on
which ABI is enabled we would pass it in either an FPR or a GPR in
float format.

If the F extension isn't enabled, it would get passed in the lower
16 bits of a GPR in half format.

With this patch the value will always in half format and will be
in the lower bits of a GPR or FPR. This should be consistent
with where the bits are located when Zfh is enabled.

I've based this implementation off of how this is done on ARM.

I've manually nan-boxed the value to 32 bits using integer ops.
It looks like flw, fsw, fmv.s, fmv.w.x, fmf.x.w won't
canonicalize nans so should leave the value alone. I think those
are the instructions that could get used on this value.

Reviewed By: kito-cheng

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

3 years ago[GlobalISel] Implement lowering for G_ROTR and G_ROTL.
Amara Emerson [Fri, 26 Mar 2021 22:27:15 +0000 (15:27 -0700)]
[GlobalISel] Implement lowering for G_ROTR and G_ROTL.

This is a straightforward port.

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

3 years ago[NFC][CodeGen] Tidy up TargetRegisterInfo stack realignment functions
Tomas Matheson [Mon, 15 Mar 2021 13:01:34 +0000 (13:01 +0000)]
[NFC][CodeGen] Tidy up TargetRegisterInfo stack realignment functions

Currently needsStackRealignment returns false if canRealignStack returns false.
This means that the behavior of needsStackRealignment does not correspond to
it's name and description; a function might need stack realignment, but if it
is not possible then this function returns false. Furthermore,
needsStackRealignment is not virtual and therefore some backends have made use
of canRealignStack to indicate whether a function needs stack realignment.

This patch attempts to clarify the situation by separating them and introducing
new names:

 - shouldRealignStack - true if there is any reason the stack should be
   realigned

 - canRealignStack - true if we are still able to realign the stack (e.g. we
   can still reserve/have reserved a frame pointer)

 - hasStackRealignment = shouldRealignStack && canRealignStack (not target
   customisable)

Targets can now override shouldRealignStack to indicate that stack realignment
is required.

This change will make it easier in a future change to handle the case where we
need to realign the stack but can't do so (for example when the register
allocator creates an aligned spill after the frame pointer has been
eliminated).

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

Change-Id: Ib9a4d21728bf9d08a545b4365418d3ffe1af4d87

3 years agoRemove dead CHECK-ERR line.
Nick Lewycky [Tue, 30 Mar 2021 16:30:40 +0000 (09:30 -0700)]
Remove dead CHECK-ERR line.

3 years ago[RISCV] Don't set the SplatOperand flag on intrinsics that take a shift amount.
Craig Topper [Tue, 30 Mar 2021 16:23:34 +0000 (09:23 -0700)]
[RISCV] Don't set the SplatOperand flag on intrinsics that take a shift amount.

The shift amount should always be a vector or an XLen scalar.
The SplatOperand flag is used to indicate we need to legalize
non-XLen scalars including special handling for i64 on RV32.
This will prevent us from silently adjusting these operands if
the intrinsics are misused.

I'll probably adjust the name of the SplatOperand flag slightly
in a follow up patch.

Reviewed By: khchen, frasercrmck

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

3 years ago[RISCV] Remove floating point condition code legalization from lowerFixedLengthVector...
Craig Topper [Tue, 30 Mar 2021 16:11:54 +0000 (09:11 -0700)]
[RISCV] Remove floating point condition code legalization from lowerFixedLengthVectorSetccToRVV.

After D98939, this is done by LegalizeVectorOps making this code dead.

Reviewed By: frasercrmck

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

3 years ago[lldb] More missing includes in TestGdbRemote_vContThreads
Pavel Labath [Tue, 30 Mar 2021 16:05:31 +0000 (18:05 +0200)]
[lldb] More missing includes in TestGdbRemote_vContThreads

3 years ago[lldb] Add missing include in TestGdbRemote_vContThreads test
Pavel Labath [Tue, 30 Mar 2021 15:36:43 +0000 (17:36 +0200)]
[lldb] Add missing include in TestGdbRemote_vContThreads test

should fix the arm builtbots.

3 years ago[lldb] Fix TestStopOnSharedlibraryEvents.py on linux
Pavel Labath [Tue, 30 Mar 2021 15:34:53 +0000 (17:34 +0200)]
[lldb] Fix TestStopOnSharedlibraryEvents.py on linux

and hopefully other ELF OSes. The problem was a missing "extra_images"
startup argument (which ensures LD_LIBRARY_PATH is set properly).

3 years ago[libc] Fix msan/asan memcpy reentrancy
Guillaume Chatelet [Tue, 30 Mar 2021 15:27:46 +0000 (15:27 +0000)]
[libc] Fix msan/asan memcpy reentrancy

This is needed to prevent asan/msan instrumentation to redirect CopyBlock to `__asan_memcpy` (resp. `__msan_memcpy`).
These functions would then differ operation to `memcpy` which leads to reentrancy issues.

With this patch, `memcpy` is fully instrumented and covered by asan/msan.

If this turns out to be too expensive, instrumentation can be selectively or fully disabled through the use of the `__attribute__((no_sanitize(address, memory)))` annotation.

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

3 years ago[test, ARM] Fix use of var defined in CHECK-NOT
Thomas Preud'homme [Sun, 28 Mar 2021 00:03:37 +0000 (00:03 +0000)]
[test, ARM] Fix use of var defined in CHECK-NOT

tries to check for the
    absence of a sequence of instructions with several CHECK-NOT with
one of
    those directives using a variable defined in another.

LLVM test CodeGenPrepare/ARM/sink-add-mul-shufflevector.ll tries to
check for the absence of a sequence of instructions with several
CHECK-NOT with one of those directives using a variable defined in
another. However, CHECK-NOT are checked independently so that is using
a variable defined in a pattern that should not occur in the input. The
bug was then copied over in
Transforms/CodeGenPrepare/ARM/sink-add-mul-shufflevector-inseltpoison.ll

This commit removes the definition and uses of variable to check each
line independently, making the check stronger than the current one.

Reviewed By: dmgreen

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

3 years ago[Docs] Update googletest docs link.
oToToT [Tue, 30 Mar 2021 03:51:46 +0000 (11:51 +0800)]
[Docs] Update googletest docs link.

The documentation link of Google Test on GitHub have been moved to the
top-level docs directory.
Thus, the original link is invalid now.

Reviewed By: Pavel Labath

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

3 years ago[clang-format] Fix east const pointer alignment of operators
Nico Rieck [Tue, 30 Mar 2021 15:11:07 +0000 (17:11 +0200)]
[clang-format] Fix east const pointer alignment of operators

This patch fixes left pointer alignment after pointer qualifiers of
operators. Currently "operator void const*()" is formatted with a space between
const and pointer despite setting PointerAlignment to Left.

AFAICS this has been broken since clang-format 10.

Reviewed By: MyDeveloperDay, curdeius

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

3 years ago[OpenCL] Fix parsing of opencl-c.h in CL 3.0
Kevin Petit [Fri, 26 Mar 2021 17:19:07 +0000 (17:19 +0000)]
[OpenCL] Fix parsing of opencl-c.h in CL 3.0

Ensure that the cl_khr_3d_image_writes pragma is enabled by making
cl_khr_3d_image_writes an optional core feature in CL 3.0 in addition
to being an available extension in 1.0 onwards and a core feature in
CL 2.0.

https://reviews.llvm.org/D99425

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
3 years ago[lldb/test] Deflake TestGdbRemote_vContThreads even more
Pavel Labath [Tue, 30 Mar 2021 14:50:04 +0000 (16:50 +0200)]
[lldb/test] Deflake TestGdbRemote_vContThreads even more

This patch fixes an issue, where if the thread has a signal blocked when
we try to inject it into the process (via vCont), then instead of
executing straight away, the injected signal will trigger another stop
when the thread unblocks the signal.

As (linux) threads start their life with SIGUSR1 (among others)
disabled, and only enable it during initialization, injecting the signal
during this window did not behave as expected. The fix is to change the
test to ensure the signal gets injected with the signal unblocked.

The simplest way to do this was to write a dedicated inferior for this
test. I also created a new header to factor out the function retrieving
the (os-specific) thread id.

3 years ago[OPENMP]Fix test checks for 32bit targets, NFC.
Alexey Bataev [Tue, 30 Mar 2021 14:45:12 +0000 (07:45 -0700)]
[OPENMP]Fix test checks for 32bit targets, NFC.

3 years ago[test, LoopVectorize] Fix use of var defined in CHECK-NOT
Thomas Preud'homme [Sun, 28 Mar 2021 00:03:37 +0000 (00:03 +0000)]
[test, LoopVectorize] Fix use of var defined in CHECK-NOT

LLVM test Transforms/LoopVectorize/X86/x86-pr39099.ll tries to check for
the absence of a sequence of instructions with several CHECK-NOT with
one of those directives using a variable defined in another. However
CHECK-NOT are checked independently so that is using a variable defined
in a pattern that should not occur in the input.

This commit only checks for the absence of a widened load which rules
out the presence of the whole sequence and does not involve an undefined
variable.

Reviewed By: fhahn

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

3 years agoAdded static verification for Linalg Ops.
Inho Seo [Tue, 30 Mar 2021 14:07:12 +0000 (07:07 -0700)]
Added static verification for Linalg Ops.

This verification is to check if the indices for static shaped operands
on linalgOps access out of bound memory or not. For dynamic shaped
operands, we would be able to check it on runtime stage.

Found several invalid Linalg ops testcases, and fixed them.

Reviewed By: hanchung

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

3 years ago[test, HardwareLoops] Fix use of var defined in CHECK-NOT
Thomas Preud'homme [Sun, 28 Mar 2021 00:03:37 +0000 (00:03 +0000)]
[test, HardwareLoops] Fix use of var defined in CHECK-NOT

LLVM test Transforms/HardwareLoops/ARM/structure.ll tries to check for
the absence of a sequence of instructions with several CHECK-NOT with
one of those directives using a variable defined in another. However
CHECK-NOT are checked independently so that is using a variable defined
in a pattern that should not occur in the input.

This commit only checks for the absence of llvm.loop.decrement.i32 which
rules out the presence of the whole sequence and does not involve an
undefined variable.

Reviewed By: dmgreen

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

3 years ago[lldb] Remove linux/mips debugging support
Pavel Labath [Mon, 29 Mar 2021 12:33:58 +0000 (14:33 +0200)]
[lldb] Remove linux/mips debugging support

As discussed on lldb-dev
<https://lists.llvm.org/pipermail/lldb-dev/2021-March/016777.html> the
mips code is unmaintained and untested. It also carries a lot of
technical debt which is not limited to mips-specific code.

Generic mips support remains (and is going to be used by the upcoming
freebsd code). Resurrecting mips support should be a matter of re-adding
the relevant register context files (while avoiding reintroducing the
debt).

3 years ago[AMDGPU] Remove outdated TODOs. NFC
Sebastian Neubauer [Tue, 30 Mar 2021 07:50:13 +0000 (09:50 +0200)]
[AMDGPU] Remove outdated TODOs. NFC

spillSGPRToVGPR is already respected in these places since D95768.

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

3 years ago[lldb] [server] Support for multiprocess extension
Michał Górny [Tue, 30 Mar 2021 11:25:06 +0000 (13:25 +0200)]
[lldb] [server] Support for multiprocess extension

Add a minimal support for the multiprocess extension in lldb-server.
The server indicates support for it via qSupported, and accepts
thread-ids containing a PID.  However, it still does not support
debugging more than one inferior, so any other PID value results
in an error.

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

3 years ago[analyzer] Fix crash when reasoning about C11 atomics (PR49422)
Valeriy Savchenko [Wed, 24 Mar 2021 15:58:22 +0000 (18:58 +0300)]
[analyzer] Fix crash when reasoning about C11 atomics (PR49422)

rdar://75020762

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

3 years ago[libc++] Add a CI job to test the Runtimes build
Louis Dionne [Tue, 16 Mar 2021 18:57:42 +0000 (11:57 -0700)]
[libc++] Add a CI job to test the Runtimes build

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

3 years ago[analyzer] Support allocClassWithName in OSObjectCStyleCast checker
Valeriy Savchenko [Mon, 29 Mar 2021 12:38:22 +0000 (15:38 +0300)]
[analyzer] Support allocClassWithName in OSObjectCStyleCast checker

`allocClassWithName` allocates an object with the given type.
The type is actually provided as a string argument (type's name).
This creates a possibility for not particularly useful warnings
from the analyzer.

In order to combat with those, this patch checks for casts of the
`allocClassWithName` results to types mentioned directly as its
argument.  All other uses of this method should be reasoned about
as before.

rdar://72165694

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

3 years ago[Analyzer] Track RValue expressions
Gabor Marton [Thu, 25 Mar 2021 14:40:26 +0000 (15:40 +0100)]
[Analyzer] Track RValue expressions

It makes sense to track rvalue expressions in the case of special
concrete integer values. The most notable special value is zero (later
we may find other values). By tracking the origin of 0, we can provide a
better explanation for users e.g. in case of division by 0 warnings.
When the divisor is a product of a multiplication then now we can show
which operand (or both) was (were) zero and why.

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

3 years ago[OPENMP]Fix PR48740: OpenMP declare reduction in C does not require an initializer
Alexey Bataev [Mon, 29 Mar 2021 20:45:05 +0000 (13:45 -0700)]
[OPENMP]Fix PR48740: OpenMP declare reduction in C does not require an initializer

If no initializer-clause is specified, the private variables will be
initialized following the rules for initialization of objects with static
storage duration.

Need to adjust the implementation to the current version of the
standard.

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

3 years agoclang-format: [JS] do not collapse - - to --.
Martin Probst [Mon, 29 Mar 2021 11:12:01 +0000 (13:12 +0200)]
clang-format: [JS] do not collapse - - to --.

In JavaScript, `- -1;` is legal syntax, the language allows unary minus.
However the two tokens must not collapse together: `--1` is prefix
decrement, i.e. different syntax.

Before:

    - -1; ==> --1;

After:

    - -1; ==> - -1;

This change makes no attempt to format this "nicely", given by all
likelihood this represents a programming mistake by the user, or odd
generated code.

The check is not guarded by language: this appears to be a problem in
Java as well, and will also be beneficial when formatting syntactically
incorrect C++ (e.g. during editing).

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

3 years ago[gn build] Port c51e91e04681
LLVM GN Syncbot [Tue, 30 Mar 2021 12:15:19 +0000 (12:15 +0000)]
[gn build] Port c51e91e04681

3 years agoRevert "[Passes] Add relative lookup table converter pass"
Krasimir Georgiev [Tue, 30 Mar 2021 12:13:37 +0000 (14:13 +0200)]
Revert "[Passes] Add relative lookup table converter pass"

This reverts commit 5178ffc7cf92527557ae16e86d0fa90d538c2a19.

Compiling `llvm-profdata` with a compiler build from this produces a
crashing binary.

3 years agoMove test to X86 directory
Oliver Stannard [Tue, 30 Mar 2021 11:57:04 +0000 (12:57 +0100)]
Move test to X86 directory

This test uses the X86 backend, so shouldn't be run if that isn't built.

3 years ago[lldb] [Process/gdb-remote] Fix TID reading to use U64
Michał Górny [Tue, 30 Mar 2021 11:30:12 +0000 (13:30 +0200)]
[lldb] [Process/gdb-remote] Fix TID reading to use U64

Fix multiple instances of reading thread-id to use U64 type instead
of U32.  This is consistent with lldb::tid_t being a 64-bit type.

3 years ago[clang] [PR49736] [C++2b] Correctly reject lambdas with requires clause and no parame...
Marek Kurdej [Tue, 30 Mar 2021 11:50:07 +0000 (13:50 +0200)]
[clang] [PR49736] [C++2b] Correctly reject lambdas with requires clause and no parameter list

This fixes http://llvm.org/PR49736 caused by implementing http://wg21.link/P1102 (https://reviews.llvm.org/rG0620e6f4b76a9725dbd82454d58c5a68a7e47074), by correctly allowing requires-clause only:
1) directly after template-parameter-list
2) after lambda-specifiers iff parameter-declaration-clause is present (2nd kind of lambda-declarator)

Reviewed By: aaron.ballman

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

3 years ago[x86] enhance matching of pmaddwd
Sanjay Patel [Tue, 30 Mar 2021 11:09:33 +0000 (07:09 -0400)]
[x86] enhance matching of pmaddwd

This was crashing with the example from:
https://llvm.org/PR49716
...and that was avoided with a283d7258360 ,
but as we can see from the SSE vs. AVX test code diff,
we can try harder to match the pattern.

This matcher code was adapted from another pmadd pattern
match in D49636, but it needs different ops to deal with
size mismatches.

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

3 years agoFix path in test added in e0577b3130a646b0ee090c04a40400483031c7a9 to work with both...
Douglas Yung [Tue, 30 Mar 2021 11:17:29 +0000 (04:17 -0700)]
Fix path in test added in e0577b3130a646b0ee090c04a40400483031c7a9 to work with both Linux/Windows paths.

Patch by Ying Yi!

3 years ago[LoopUnswitch] Simplify branch condition if it is select with constant operands
Juneyoung Lee [Tue, 30 Mar 2021 11:03:50 +0000 (20:03 +0900)]
[LoopUnswitch] Simplify branch condition if it is select with constant operands

This fixes the miscompilation reported in https://reviews.llvm.org/rG5bb38e84d3d0#986154 .

`select _, true, false` matches both m_LogicalAnd and m_LogicalOr, making later
transformations confused.
Simplify the branch condition to not have the form.

3 years agoNFC: Migrate PartialInlining to work on InstructionCost
Sander de Smalen [Thu, 25 Feb 2021 13:00:46 +0000 (13:00 +0000)]
NFC: Migrate PartialInlining to work on InstructionCost

This patch migrates cost values and arithmetic to work on InstructionCost.
When the interfaces to TargetTransformInfo are changed, any InstructionCost
state will propagate naturally.

See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html

Reviewed By: paulwalker-arm

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

3 years ago[gn build] (semi-manually) port 51fa9e0fd984
Nico Weber [Tue, 30 Mar 2021 10:59:37 +0000 (06:59 -0400)]
[gn build] (semi-manually) port 51fa9e0fd984

3 years agoFix cleanup error in TestVSCode_disconnect.test_launch
Muhammad Omair Javaid [Tue, 30 Mar 2021 09:33:25 +0000 (14:33 +0500)]
Fix cleanup error in TestVSCode_disconnect.test_launch

TestVSCode_disconnect.test_launch fails with clean up error because
disconnect gets called twice once from the test case and once from
the tear down hook.

This patch disables disconnect after its been called from test_launch

Reviewed By: clayborg

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

3 years ago[lli] Leaving two EH frame tests with MCJIT only after PowerPC failure
Stefan Gränitz [Tue, 30 Mar 2021 10:26:52 +0000 (12:26 +0200)]
[lli] Leaving two EH frame tests with MCJIT only after PowerPC failure

Will investigate these in isolation once the rest of D98931 successfully landed.

3 years ago[ARM] Handle Splats in MVE lane interleaving
David Green [Tue, 30 Mar 2021 10:19:16 +0000 (11:19 +0100)]
[ARM] Handle Splats in MVE lane interleaving

As another addition to MVE lane interleaving, this handles Splat shuffle
vectors, as the shuffle of a splat is a splat.

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

3 years ago[RegAlloc] Add a test with use in statepoint expected to be on stack.
Serguei Katkov [Tue, 30 Mar 2021 06:21:03 +0000 (13:21 +0700)]
[RegAlloc] Add a test with use in statepoint expected to be on stack.

The test shows that RA computes the spill weight independent on the
fact that statepoint instruction for var operands is ok to accept
this operand on stack. As a result the corresponding virtual register
evicts the other register which requires register for use.
It causes redundant fill operation.

3 years ago[LoopVectorize] Add support for scalable vectorization of induction variables
David Sherwood [Wed, 10 Mar 2021 17:06:47 +0000 (17:06 +0000)]
[LoopVectorize] Add support for scalable vectorization of induction variables

This patch adds support for the vectorization of induction variables when
using scalable vectors, which required the following changes:

1. Removed assert from InnerLoopVectorizer::getStepVector.
2. Modified InnerLoopVectorizer::createVectorIntOrFpInductionPHI to use
   a runtime determined value for VF and removed an assert.
3. Modified InnerLoopVectorizer::buildScalarSteps to work for scalable
   vectors. I did this by calculating the full vector value for each Part
   of the unroll factor (UF) and caching this in the VP state. This means
   that we are always able to extract an arbitrary element from the vector
   if necessary. In addition to this, I also permitted the caching of the
   individual lane values themselves for the known minimum number of elements
   in the same way we do for fixed width vectors. This is a further
   optimisation that improves the code quality since it avoids unnecessary
   extractelement operations when extracting the first lane.
4. Added an assert to InnerLoopVectorizer::widenPHIInstruction, since while
   testing some code paths I noticed this is currently broken for scalable
   vectors.

Various tests to support different cases have been added here:

  Transforms/LoopVectorize/AArch64/sve-inductions.ll

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

3 years agoRe-apply "[lli] Make -jit-kind=orc the default JIT engine"
Stefan Gränitz [Tue, 30 Mar 2021 09:57:38 +0000 (11:57 +0200)]
Re-apply "[lli] Make -jit-kind=orc the default JIT engine"

MCJIT served well as the default JIT engine in lli for a long time, but the code is getting old and maintenance efforts don't seem to be in sight. In the meantime Orc became mature enough to fill that gap. The newly added greddy mode is very similar to the execution model of MCJIT. It should work as a drop-in replacement for common JIT tasks.

Reviewed By: lhames

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

3 years ago[ASTImporter] Import member specialization/instantiation of enum decls
Gabor Marton [Fri, 26 Mar 2021 16:26:10 +0000 (17:26 +0100)]
[ASTImporter] Import member specialization/instantiation of enum decls

We do the import of the member enum specialization similarly to as we do
with member CXXRecordDecl specialization.

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

3 years agoRevert "[loop-idiom] Hoist loop memcpys to loop preheader"
Krasimir Georgiev [Tue, 30 Mar 2021 09:44:05 +0000 (11:44 +0200)]
Revert "[loop-idiom] Hoist loop memcpys to loop preheader"

This reverts commit 92ddd3c1b6cd8f01f39dfd716cf3e976de126e66.

Causes multistage clang crashes, e.g.:
https://lab.llvm.org/buildbot/#/builders/36/builds/6678

3 years ago[lldb] Change CreateHostNativeRegisterContextLinux argument type
Pavel Labath [Tue, 30 Mar 2021 09:42:19 +0000 (11:42 +0200)]
[lldb] Change CreateHostNativeRegisterContextLinux argument type

to NativeThreadLinux. This avoid casts down the line.

3 years ago[AArch64][SVE] Lower fixed length INSERT_VECTOR_ELT
Joe Ellis [Mon, 29 Mar 2021 10:11:42 +0000 (10:11 +0000)]
[AArch64][SVE] Lower fixed length INSERT_VECTOR_ELT

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

3 years ago[AArch64][SVE] Lower fixed length EXTRACT_VECTOR_ELT
Joe Ellis [Tue, 23 Mar 2021 14:53:19 +0000 (14:53 +0000)]
[AArch64][SVE] Lower fixed length EXTRACT_VECTOR_ELT

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

3 years ago[clangd] Perform merging for stale symbols in MergeIndex
Kadir Cetinkaya [Fri, 12 Mar 2021 18:49:40 +0000 (19:49 +0100)]
[clangd] Perform merging for stale symbols in MergeIndex

Clangd drops symbols from static index whenever the dynamic index is
authoritative for the file. This results in regressions when static and
dynamic index contains different set of information, e.g.
IncludeHeaders.

After this patch, we'll choose to merge symbols from static index with
dynamic one rather than just dropping. This implies correctness problems
when the definition/documentation of the symbol is deleted. But seems
like it is worth having in more cases.

We still drop symbols if dynamic index owns the file and didn't report
the symbol, which means symbol is deleted.

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

3 years ago[lldb] Add a test for Obj-C properties with conflicting names
Raphael Isemann [Tue, 30 Mar 2021 09:08:08 +0000 (11:08 +0200)]
[lldb] Add a test for Obj-C properties with conflicting names

This is apparently allowed in Objective-C so we should test this in LLDB.

Reviewed By: teemperor

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

3 years ago[ObjC][CodeGen] Fix missing debug info in situations where an instance and class...
Raphael Isemann [Tue, 30 Mar 2021 09:07:04 +0000 (11:07 +0200)]
[ObjC][CodeGen] Fix missing debug info in situations where an instance and class property have the same identifier

Since the introduction of class properties in Objective-C it is possible to declare a class and an instance
property with the same identifier in an interface/protocol.

Right now Clang just generates debug information for whatever property comes first in the source file.
The second property is ignored as it's filtered out by the set of already emitted properties (which is just
using the identifier of the property to check for equivalence).  I don't think generating debug info in this case
was never supported as the identifier filter is in place since 7123bca7fb6e1dde51be8329cfb523d2bb9ffadf
(which precedes the introduction of class properties).

This patch expands the filter to take in account identifier + whether the property is class/instance. This
ensures that both properties are emitted in this special situation.

Reviewed By: aprantl

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

3 years ago[docs] remove references to checking out svn repos
Nuno Lopes [Tue, 30 Mar 2021 09:00:31 +0000 (10:00 +0100)]
[docs] remove references to checking out svn repos

3 years agoRevert "[X86] Pass to transform tdpbsud&tdpbusd&tdpbuud intrinsics to scalar operation"
Bing1 Yu [Tue, 30 Mar 2021 08:33:07 +0000 (16:33 +0800)]
Revert "[X86] Pass to transform tdpbsud&tdpbusd&tdpbuud intrinsics to scalar operation"

This reverts commit 275df61f043ccf86a9c17957379bff9434da1489.

3 years ago[InstructionCost] Don't conflate Invalid costs with Unknown costs.
Sander de Smalen [Tue, 30 Mar 2021 07:54:59 +0000 (08:54 +0100)]
[InstructionCost] Don't conflate Invalid costs with Unknown costs.

We previously made a change to getUserCost to return a Invalid cost
when one of the TTI costs returned '-1' (meaning 'unknown' or
'infinitely expensive'). It makes no sense to say that:

  shufflevector <2 x i8> %x, <2 x i8> %y, <4 x i32> <i32 0, i32 1, i32 2, i32 3>

has an invalid cost. Perhaps the cost is not known, but the IR is valid
and can be code-generated. Invalid should only be used for IR that
cannot possibly be code-generated and where a cost is nonsensical.

With more passes now asserting that the cost must be valid, it is possible
that those assertions will fail for perfectly valid IR. An incomplete
cost-model probably shouldn't be a reason for the compiler to break.

It's better to consider these costs as 'very expensive' and ignore them
for other reasons. At some point, we should consider replacing -1 with
some other mechanism.

Reviewed By: paulwalker-arm, dmgreen

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

3 years ago[X86] Pass to transform tdpbsud&tdpbusd&tdpbuud intrinsics to scalar operation
Bing1 Yu [Wed, 24 Mar 2021 08:53:12 +0000 (16:53 +0800)]
[X86] Pass to transform tdpbsud&tdpbusd&tdpbuud intrinsics to scalar operation

Reviewed By: pengfei

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