platform/upstream/llvm.git
3 years ago[AArch64] Add pipeline model for HiSilicon's TSV110
Elvina Yakubova [Fri, 6 Nov 2020 22:22:35 +0000 (01:22 +0300)]
[AArch64] Add pipeline model for HiSilicon's TSV110

This patch adds the scheduling and cost model for TSV110.

Reviewed by: SjoerdMeijer, bryanpkc

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

3 years ago[TableGen] Use llvm::is_contained (NFC)
Kazu Hirata [Fri, 6 Nov 2020 22:18:00 +0000 (14:18 -0800)]
[TableGen] Use llvm::is_contained (NFC)

3 years ago[ms] [llvm-ml] Allow arbitrary strings as integer constants
Eric Astor [Fri, 6 Nov 2020 20:18:15 +0000 (15:18 -0500)]
[ms] [llvm-ml] Allow arbitrary strings as integer constants

MASM interprets strings in expression contexts as integers expressed in big-endian base-256, treating each character as its ASCII representation.

This completely eliminates the need to special-case single-character strings.

Reviewed By: thakis

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

3 years ago[LoopDeletion] Remove dead loops with no exit blocks
Atmn Patel [Sun, 25 Oct 2020 22:30:09 +0000 (18:30 -0400)]
[LoopDeletion] Remove dead loops with no exit blocks

Currently, LoopDeletion refuses to remove dead loops with no exit blocks
because it cannot statically determine the control flow after it removes
the block. This leads to miscompiles if the loop is an infinite loop and
should've been removed.

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

3 years ago[llvm-objcopy][MachO] Skip sections with zero offset
Alexander Shaposhnikov [Fri, 6 Nov 2020 21:10:41 +0000 (13:10 -0800)]
[llvm-objcopy][MachO] Skip sections with zero offset

Some binaries can contain regular sections with zero offset and zero size.
This diff makes llvm-objcopy's handling of such sections consistent with
cctools's strip (which doesn't modify them),
previously the tool would allocate file space for them.

Test plan: make check-all

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

3 years ago[debuginfo-tests] Skip optnone-loops.cpp on Darwin
Jonas Devlieghere [Fri, 6 Nov 2020 21:04:55 +0000 (13:04 -0800)]
[debuginfo-tests] Skip optnone-loops.cpp on Darwin

This is failing on GreenDragon:
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/24745/

3 years agoAdd new matchers for dependent names in templates
Stephen Kelly [Sat, 31 Oct 2020 00:41:16 +0000 (00:41 +0000)]
Add new matchers for dependent names in templates

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

3 years agoFix gcc warning by removing extra `;` after a macro (NFC)
Mehdi Amini [Fri, 6 Nov 2020 20:46:09 +0000 (20:46 +0000)]
Fix gcc warning by removing extra `;` after a macro (NFC)

3 years ago[obj2yaml] [yaml2obj] Add yaml support for SHT_LLVM_BB_ADDR_MAP section.
Rahman Lavaee [Fri, 6 Nov 2020 20:44:24 +0000 (12:44 -0800)]
[obj2yaml] [yaml2obj] Add yaml support for SHT_LLVM_BB_ADDR_MAP section.

YAML support allows us to better test the feature in the subsequent patches. The implementation is quite similar to the .stack_sizes section.

Reviewed By: jhenderson, grimar

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

3 years ago[clangd] Set the User option for clang-tidy to mimick its behaviour
Nathan James [Fri, 6 Nov 2020 19:58:19 +0000 (19:58 +0000)]
[clangd] Set the User option for clang-tidy to mimick its behaviour

Probably not essential as afaik only one check uses this field. but still good to have consistent behaviour.

Reviewed By: sammccall

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

3 years agoFix unwind info relocation with large code model on AArch64
Valentin Churavy [Fri, 6 Nov 2020 19:26:04 +0000 (14:26 -0500)]
Fix unwind info relocation with large code model on AArch64

Makes sure that the unwind info uses 64bits pcrel relocation if a large code model is specified and handle the corresponding relocation in the ExecutionEngine. This can happen with certain kernel configuration (the same as the one in https://reviews.llvm.org/D27609, found at least on the ArchLinux stock kernel and the one used on https://www.packet.net/) using the builtin JIT memory manager.

Co-authored-by: Yichao Yu <yyc1992@gmail.com>
Differential Revision: https://reviews.llvm.org/D27629

3 years ago[libc][WrapperGen] Replace the C _Noreturn annotation with C++ [[noreturn]].
Siva Chandra Reddy [Fri, 6 Nov 2020 01:07:17 +0000 (17:07 -0800)]
[libc][WrapperGen] Replace the C _Noreturn annotation with C++ [[noreturn]].

Reviewed By: michaelrj

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

3 years ago[RTDYLD] support absolute relocations where needed
Valentin Churavy [Fri, 6 Nov 2020 19:08:30 +0000 (14:08 -0500)]
[RTDYLD] support absolute relocations where needed

These appear in some sections, such as DWARF tables, since
RuntimeDyldELF explicitly maps to this as a sentinel value:
https://github.com/llvm/llvm-project/blob/29d1fba7b5335d969e3e5daa84b7a25cd1fa75ef/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp#L1199

That could then be a source of problems if it tried to examine these
sections (for example, with either setProcessAllSections(true) or ORCv2 on i686).

Replaces https://reviews.llvm.org/D89241

Reviewed By: lhames, vchuravy

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

3 years ago[BranchProbabilityInfo] Use succ_size (NFC)
Kazu Hirata [Fri, 6 Nov 2020 19:05:35 +0000 (11:05 -0800)]
[BranchProbabilityInfo] Use succ_size (NFC)

3 years ago[RISCV] Add test case to show incorrect matching to sroiw when the or mask does not...
Craig Topper [Fri, 6 Nov 2020 18:29:22 +0000 (10:29 -0800)]
[RISCV] Add test case to show incorrect matching to sroiw when the or mask does not have 1s in the upper 32 bits.

The matching code for sroiw is truncating the mask to 32 bits before
checking its value. We need to check all 64 bits.

3 years agoPrevent LICM and machineLICM from hoisting convergent operations
Quentin Colombet [Fri, 6 Nov 2020 18:25:16 +0000 (10:25 -0800)]
Prevent LICM and machineLICM from hoisting convergent operations

Results of convergent operations are implicitly affected by the
enclosing control flows and should not be hoisted out of arbitrary
loops.

Patch by Xiaoqing Wu <xiaoqing_wu@apple.com>

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

3 years ago[lldb] add a missing dependency on intrinsics_gen
Richard Howell [Fri, 6 Nov 2020 18:04:28 +0000 (10:04 -0800)]
[lldb] add a missing dependency on intrinsics_gen

Sometimes builds will fail with errors like:

```
In file included from /build/external/llvm-project/lldb/source/Symbol/SwiftASTContext.cpp:52:
In file included from /build/external/swift/include/swift/IRGen/Linking.h:22:
In file included from /build/external/swift/include/swift/SIL/SILFunction.h:24:
In file included from /build/external/swift/include/swift/SIL/SILBasicBlock.h:23:
In file included from /build/external/swift/include/swift/SIL/SILInstruction.h:21:
In file included from /build/external/swift/include/swift/AST/Builtins.h:24:
**/build/external/llvm-project/llvm/include/llvm/IR/Attributes.h:74:14: fatal error: 'llvm/IR/Attributes.inc' file not found**
**^~~~~~~~~~~~~~~~~~~~~~~~**
```
This change ensures the `Attributes.inc` file is generated before building `SwiftASTContext.cpp`.

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

3 years ago[mlir] Use PyValue instead of PyOpResult in Python operand container
Alex Zinenko [Fri, 6 Nov 2020 10:00:13 +0000 (11:00 +0100)]
[mlir] Use PyValue instead of PyOpResult in Python operand container

The PyOpOperands container was erroneously constructing objects for
individual operands as PyOpResult. Operands in fact are just values,
which may or may not be results of another operation. The code would
eventually crash if the operand was a block argument. Add a test that
exercises the behavior that previously led to crashes.

Reviewed By: stellaraccident

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

3 years agoRevert "[mlir][CAPI] Proposal: Always building a libMLIRPublicAPI.so."
Alex Zinenko [Fri, 6 Nov 2020 17:59:58 +0000 (18:59 +0100)]
Revert "[mlir][CAPI] Proposal: Always building a libMLIRPublicAPI.so."

This reverts commit 80fe2f61fac9f72825f907637a9c63aca32d8f14.

Broke linkage with GNU ld. See original review thread for more details.

3 years ago[OpenMP] Fix potential division by 0
Nawrin Sultana [Fri, 6 Nov 2020 16:47:33 +0000 (10:47 -0600)]
[OpenMP] Fix potential division by 0

This patch fixes potential division by 0 in case hwloc does not
recognize cores (or architecture has no cores).

Patch by Andrey Churbanov

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

3 years ago[scudo][standalone] Simplify populateFreelist
Kostya Kortchinsky [Tue, 3 Nov 2020 19:21:15 +0000 (11:21 -0800)]
[scudo][standalone] Simplify populateFreelist

`populateFreelist` was more complicated that it needed to be. We used
to call to `populateBatches` that would do some internal shuffling and
add pointers one by one to the batches, but ultimately this was not
needed. We can get rid of `populateBatches`, and do processing in
bulk. This doesn't necessarily make things faster as this is not on the
hot path, but it makes the function cleaner.

Additionally clean up a couple of items, like `UNLIKELY`s and setting
`Exhausted` to `false` which can't happen.

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

3 years ago[InstCombine] computeKnownBitsMul - use KnownBits::isNonZero() helper.
Simon Pilgrim [Fri, 6 Nov 2020 17:26:56 +0000 (17:26 +0000)]
[InstCombine] computeKnownBitsMul - use KnownBits::isNonZero() helper.

Avoid an expensive isKnownNonZero() call - this is a small cleanup before moving the extra NSW functionality from computeKnownBitsMul into KnownBits::computeForMul.

3 years ago[SLP][AMDGPU] Regenerate packed-math tests and remove unused check prefix
Simon Pilgrim [Fri, 6 Nov 2020 17:22:28 +0000 (17:22 +0000)]
[SLP][AMDGPU] Regenerate packed-math tests and remove unused check prefix

3 years ago[VectorCombine][X86] Removed unused check prefixes
Simon Pilgrim [Fri, 6 Nov 2020 17:14:10 +0000 (17:14 +0000)]
[VectorCombine][X86] Removed unused check prefixes

3 years ago[mlir][CAPI] Proposal: Always building a libMLIRPublicAPI.so.
Stella Laurenzo [Fri, 6 Nov 2020 06:37:47 +0000 (22:37 -0800)]
[mlir][CAPI] Proposal: Always building a libMLIRPublicAPI.so.

We were discussing on discord regarding the need for extension-based systems like Python to dynamically link against MLIR (or else you can only have one extension that depends on it). Currently, when I set that up, I piggy-backed off of the flag that enables build libLLVM.so and libMLIR.so and depended on libMLIR.so from the python extension if shared library building was enabled. However, this is less than ideal.

In the current setup, libMLIR.so exports both all symbols from the C++ API and the C-API. The former is a kitchen sink and the latter is curated. We should be splitting them and for things that are properly factored to depend on the C-API, they should have the option to *only* depend on the C-API, and we should build that shared library no matter what. Its presence isn't just an optimization: it is a key part of the system.

To do this right, I needed to:

* Introduce visibility macros into mlir-c/Support.h. These should work on both *nix and windows as-is.
* Create a new libMLIRPublicAPI.so with just the mlir-c object files.
* Compile the C-API with -fvisibility=hidden.
* Conditionally depend on the libMLIR.so from libMLIRPublicAPI.so if building libMLIR.so (otherwise, also links against the static libs and will produce a mondo libMLIRPublicAPI.so).
* Disable re-exporting of static library symbols that come in as transitive deps.

This gives us a dynamic linked C-API layer that is minimal and should work as-is on all platforms. Since we don't support libMLIR.so building on Windows yet (and it is not very DLL friendly), this will fall back to a mondo build of libMLIRPublicAPI.so, which has its uses (it is also the most size conscious way to go if you happen to know exactly what you need).

Sizes (release/stripped, Ubuntu 20.04):

Shared library build:
libMLIRPublicAPI.so: 121Kb
_mlir.cpython-38-x86_64-linux-gnu.so: 1.4Mb
mlir-capi-ir-test: 135Kb
libMLIR.so: 21Mb

Static build:
libMLIRPublicAPI.so: 5.5Mb (since this is a "static" build, this includes the MLIR implementation as non-exported code).
_mlir.cpython-38-x86_64-linux-gnu.so: 1.4Mb
mlir-capi-ir-test: 44Kb

Things like npcomp and circt which bring their own dialects/transforms/etc would still need the shared library build and code that links against libMLIR.so (since it is all C++ interop stuff), but hopefully things that only depend on the public C-API can just have the one narrow dep.

I spot checked everything with nm, and it looks good in terms of what is exporting/importing from each layer.

I'm not in a hurry to land this, but if it is controversial, I'll probably split off the Support.h and API visibility macro changes, since we should set that pattern regardless.

Reviewed By: mehdi_amini, benvanik

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

3 years ago[FPEnv] Use strictfp metadata in casting nodes
Kevin P. Neal [Fri, 6 Nov 2020 15:44:13 +0000 (10:44 -0500)]
[FPEnv] Use strictfp metadata in casting nodes

The strictfp metadata was added to the casting AST nodes in D85960, but
we aren't using that metadata yet. This patch adds that support.

In order to avoid lots of ad-hoc passing around of the strictfp bits I
updated the IRBuilder when moving from a function that has the Expr* to a
function that lacks it. I believe we should switch to this pattern to keep
the strictfp support from being overly invasive.

For the purpose of testing that we're picking up the right metadata, I
also made my tests use a pragma to make the AST's strictfp metadata not
match the global strictfp metadata. This exposes issues that we need to
deal with in subsequent patches, and I believe this is the right method
for most all of our clang strictfp tests.

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

3 years ago[TableGen] Indentation and whitespace fixes in generated code. NFC.
Jay Foad [Fri, 6 Nov 2020 14:19:59 +0000 (14:19 +0000)]
[TableGen] Indentation and whitespace fixes in generated code. NFC.

Some of these were found by running clang-format over the generated
code, although that complains about far more issues than I have fixed
here.

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

3 years ago[AMDGPU] Simplify exp target parsing
Jay Foad [Fri, 6 Nov 2020 15:25:43 +0000 (15:25 +0000)]
[AMDGPU] Simplify exp target parsing

Treat any identifier as a potential exp target and diagnose them all the
same way as "invalid exp target"s.

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

3 years ago[analyzer][NFCi] Mark CallEvent::getOriginExpr virtual, some cleanup
Balazs Benics [Fri, 6 Nov 2020 15:51:34 +0000 (16:51 +0100)]
[analyzer][NFCi] Mark CallEvent::getOriginExpr virtual, some cleanup

Previously we just shadowed the original implementation with a virtual
declaration - which is really bugprone in a long run.

This patch marks `CallEvent::getOriginExpr` virtual to let subclasses
override it's behavior.
At the same time, I checked all virtual functions of this class hierarchy
to make sure we don't suffer from this elsewhere.
Removes redundant declarations of `virtual` if `override` is already present.

In theory, this patch is a functional change, but no tests were broken.
I suspect that there were no meaningful changes in behavior in the
subclasses compared to the shadowed `CallEvent::getOriginExpr`.

That being said, I had a hard time coming up with unit-tests covering this.
Motivation: https://reviews.llvm.org/D74735#2370909

Reviewed By: NoQ

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

3 years agoTraverse-ignore explicit template instantiations
Stephen Kelly [Mon, 2 Nov 2020 23:56:32 +0000 (23:56 +0000)]
Traverse-ignore explicit template instantiations

Continue to dump and match on explicit template specializations, but
omit explicit instantiation declarations and definitions.

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

3 years ago[Arm][MC] Remove unused prefixes in .arch_extension fp tests
David Spickett [Fri, 6 Nov 2020 10:20:20 +0000 (10:20 +0000)]
[Arm][MC] Remove unused prefixes in .arch_extension fp tests

idiv: There is no difference between Armv7m and Thumbv7M
behaviour so the specific CHECKs are not needed.
The errors for Armv7-a and Thumbv7-a will always
include "ARM" or "THUMB" respectively so they need their
own CHECK prefix, making CHECK-V7 redundant.

mp: Behaviour is dependent on whether the triple is v6/v7/v7M
regardless of being Arm or Thumb. So we don't need the more
specific CHECK-ARMv7M etc.

simd: Errors are either v7 only, or v7 and v8 so CHECK-V8
is not needed.

fp: Same as simd

Reviewed By: ostannard

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

3 years ago[libc++] Try fixing the oss-fuzz build
Louis Dionne [Fri, 6 Nov 2020 15:06:44 +0000 (10:06 -0500)]
[libc++] Try fixing the oss-fuzz build

See https://github.com/google/oss-fuzz/issues/4586.

3 years ago[AMDGPU] Run exp tests on GFX9 and GFX10 too. NFC.
Jay Foad [Fri, 6 Nov 2020 14:57:51 +0000 (14:57 +0000)]
[AMDGPU] Run exp tests on GFX9 and GFX10 too. NFC.

3 years ago[NFC][InstCombine] Update few comment updates i missed in 0ac56e8eaaeb
Roman Lebedev [Fri, 6 Nov 2020 14:35:17 +0000 (17:35 +0300)]
[NFC][InstCombine] Update few comment updates i missed in 0ac56e8eaaeb

As pointed out in post-commit review in that commit

3 years agollvm.coro.id.async lowering: Parameterize how-to restore the current's continutation...
Arnold Schwaighofer [Mon, 2 Nov 2020 17:37:15 +0000 (09:37 -0800)]
llvm.coro.id.async lowering: Parameterize how-to restore the current's continutation context and restart the pipeline after splitting

The `llvm.coro.suspend.async` intrinsic takes a function pointer as its
argument that describes how-to restore the current continuation's
context from the context argument of the continuation function. Before
we assumed that the current context can be restored by loading from the
context arguments first pointer field (`first_arg->caller_context`).

This allows for defining suspension points that reuse the current
context for example.

Also:

llvm.coro.id.async lowering: Add llvm.coro.preprare.async intrinsic

Blocks inlining until after the async coroutine was split.

Also, change the async function pointer's context size position

   struct async_function_pointer {
     uint32_t relative_function_pointer_to_async_impl;
     uint32_t context_size;
   }

And make the position of the `async context` argument configurable. The
position is specified by the `llvm.coro.id.async` intrinsic.

rdar://70097093

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

3 years ago[NVPTX] [TableGen] Use new features of TableGen to simplify and clarify.
Paul C. Anagnostopoulos [Thu, 5 Nov 2020 14:53:19 +0000 (09:53 -0500)]
[NVPTX] [TableGen] Use new features of TableGen to simplify and clarify.

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

3 years ago[VE] Add v(m)regs to preserve_all reg mask
Simon Moll [Fri, 6 Nov 2020 14:09:32 +0000 (15:09 +0100)]
[VE] Add v(m)regs to preserve_all reg mask

V(m)regs where defined before CSR_preserve_all was, add them now.

Reviewed By: kaz7

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

3 years ago[Clang][AArch64] Remove unused prefix in constrained rounding test
David Spickett [Fri, 6 Nov 2020 10:59:16 +0000 (10:59 +0000)]
[Clang][AArch64] Remove unused prefix in constrained rounding test

This test was added in 7f38812d5b7e0fd5145e44d5ae831a67d782dca6
and all the other tests make use of the COMMONIR check. So I think
this was left in by mistake for this particular test.

Reviewed By: kpn

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

3 years ago[NFC] Fix typo in comment.
Than McIntosh [Thu, 5 Nov 2020 14:09:44 +0000 (09:09 -0500)]
[NFC] Fix typo in comment.

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

3 years ago[TableGen] Clarify text and fix errors in the Programmer's Reference
Paul C. Anagnostopoulos [Thu, 5 Nov 2020 21:44:15 +0000 (16:44 -0500)]
[TableGen] Clarify text and fix errors in the Programmer's Reference

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

3 years ago[lldb] [test] Avoid double negation in llgs/debugserver logic
Michał Górny [Thu, 5 Nov 2020 20:24:56 +0000 (21:24 +0100)]
[lldb] [test] Avoid double negation in llgs/debugserver logic

Use positive logic (i.e. llgs_platform/debugserver_platform) for
indicating which platforms use the particular server variant.
Deduplicate the lists — it is rather expected that none of the platforms
using LLGS would use debugserver.

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

3 years ago[VE][NFC] Refactor to support more than one calling conv
Simon Moll [Fri, 6 Nov 2020 13:25:13 +0000 (14:25 +0100)]
[VE][NFC] Refactor to support more than one calling conv

Prepare for supporting  different calling conventions by factoring out
things into CC-dependent selection functions (getParamCC, getReturnCC).

Reviewed By: kaz7

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

3 years ago[debuginfo-tests] NFC: Move test that was committed to the wrong location
Louis Dionne [Fri, 6 Nov 2020 13:17:02 +0000 (08:17 -0500)]
[debuginfo-tests] NFC: Move test that was committed to the wrong location

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

3 years agoAllow running back-deployment testing against libc++abi
Louis Dionne [Wed, 8 Jul 2020 20:38:54 +0000 (16:38 -0400)]
Allow running back-deployment testing against libc++abi

Summary:
Before this patch, we could only link against the back-deployment libc++abi
dylib. This patch allows linking against the just-built libc++abi, but
running against the back-deployment one -- just like we do for libc++.

Also, add XFAIL markup to flag expected errors.

3 years ago[SLP] Also try to vectorize incoming values of PHIs .
Florian Hahn [Fri, 6 Nov 2020 09:39:55 +0000 (09:39 +0000)]
[SLP] Also try to vectorize incoming values of PHIs .

Currently we do not consider incoming values of PHIs as roots for SLP
vectorization. This means we miss scenarios like the one in the test
case and PR47670.

It appears quite straight-forward to consider incoming values of PHIs as
roots for vectorization, but I might be missing something that makes
this problematic.

In terms of vectorized instructions, this applies to quite a few
benchmarks across MultiSource/SPEC2000/SPEC2006 on X86 with -O3 -flto

    Same hash: 185 (filtered out)
    Remaining: 52
    Metric: SLP.NumVectorInstructions

    Program                                        base    patch   diff
     test-suite...ProxyApps-C++/HPCCG/HPCCG.test     9.00   27.00  200.0%
     test-suite...C/CFP2000/179.art/179.art.test     8.00   22.00  175.0%
     test-suite...T2006/458.sjeng/458.sjeng.test    14.00   30.00  114.3%
     test-suite...ce/Benchmarks/PAQ8p/paq8p.test    11.00   18.00  63.6%
     test-suite...s/FreeBench/neural/neural.test    12.00   18.00  50.0%
     test-suite...rimaran/enc-3des/enc-3des.test    65.00   95.00  46.2%
     test-suite...006/450.soplex/450.soplex.test    63.00   89.00  41.3%
     test-suite...ProxyApps-C++/CLAMR/CLAMR.test   177.00  250.00  41.2%
     test-suite...nchmarks/McCat/18-imp/imp.test    13.00   18.00  38.5%
     test-suite.../Applications/sgefa/sgefa.test    26.00   35.00  34.6%
     test-suite...pplications/oggenc/oggenc.test   100.00  133.00  33.0%
     test-suite...6/482.sphinx3/482.sphinx3.test   103.00  134.00  30.1%
     test-suite...oxyApps-C++/miniFE/miniFE.test   169.00  213.00  26.0%
     test-suite.../Benchmarks/Olden/tsp/tsp.test    59.00   73.00  23.7%
     test-suite...TimberWolfMC/timberwolfmc.test   503.00  622.00  23.7%
     test-suite...T2006/456.hmmer/456.hmmer.test    65.00   79.00  21.5%
     test-suite...libquantum/462.libquantum.test    58.00   68.00  17.2%
     test-suite...ternal/HMMER/hmmcalibrate.test    84.00   98.00  16.7%
     test-suite...ications/JM/ldecod/ldecod.test   351.00  401.00  14.2%
     test-suite...arks/VersaBench/dbms/dbms.test    52.00   57.00   9.6%
     test-suite...ce/Benchmarks/Olden/bh/bh.test   118.00  128.00   8.5%
     test-suite.../Benchmarks/Bullet/bullet.test   6355.00 6880.00  8.3%
     test-suite...nsumer-lame/consumer-lame.test   480.00  519.00   8.1%
     test-suite...000/183.equake/183.equake.test   226.00  244.00   8.0%
     test-suite...chmarks/Olden/power/power.test   105.00  113.00   7.6%
     test-suite...6/471.omnetpp/471.omnetpp.test    92.00   99.00   7.6%
     test-suite...ications/JM/lencod/lencod.test   1173.00 1261.00  7.5%
     test-suite...0/253.perlbmk/253.perlbmk.test    55.00   59.00   7.3%
     test-suite...oxyApps-C/miniAMR/miniAMR.test    92.00   98.00   6.5%
     test-suite...chmarks/MallocBench/gs/gs.test   446.00  473.00   6.1%
     test-suite.../CINT2006/403.gcc/403.gcc.test   464.00  491.00   5.8%
     test-suite...6/464.h264ref/464.h264ref.test   998.00  1055.00  5.7%
     test-suite...006/453.povray/453.povray.test   5711.00 6007.00  5.2%
     test-suite...FreeBench/distray/distray.test   102.00  107.00   4.9%
     test-suite...:: External/Povray/povray.test   4184.00 4378.00  4.6%
     test-suite...DOE-ProxyApps-C/CoMD/CoMD.test   112.00  117.00   4.5%
     test-suite...T2006/445.gobmk/445.gobmk.test   104.00  108.00   3.8%
     test-suite...CI_Purple/SMG2000/smg2000.test   789.00  819.00   3.8%
     test-suite...yApps-C++/PENNANT/PENNANT.test   233.00  241.00   3.4%
     test-suite...marks/7zip/7zip-benchmark.test   417.00  428.00   2.6%
     test-suite...arks/mafft/pairlocalalign.test   627.00  643.00   2.6%
     test-suite.../Benchmarks/nbench/nbench.test   259.00  265.00   2.3%
     test-suite...006/447.dealII/447.dealII.test   4641.00 4732.00  2.0%
     test-suite...lications/ClamAV/clamscan.test   106.00  108.00   1.9%
     test-suite...CFP2000/177.mesa/177.mesa.test   1639.00 1664.00  1.5%
     test-suite...oxyApps-C/RSBench/rsbench.test    66.00   65.00  -1.5%
     test-suite.../CINT2000/252.eon/252.eon.test   3416.00 3444.00  0.8%
     test-suite...CFP2000/188.ammp/188.ammp.test   1846.00 1861.00  0.8%
     test-suite.../CINT2000/176.gcc/176.gcc.test   152.00  153.00   0.7%
     test-suite...CFP2006/444.namd/444.namd.test   3528.00 3544.00  0.5%
     test-suite...T2006/473.astar/473.astar.test    98.00   98.00   0.0%
     test-suite...frame_layout/frame_layout.test    NaN     39.00   nan%

On ARM64, there appears to be a slight regression on SPEC2006, which
might be interesting to investigate:

   test-suite...T2006/473.astar/473.astar.test   0.9%

Reviewed By: ABataev

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

3 years ago[lld testing] Unbreak read-only source builds
David Zarzycki [Fri, 6 Nov 2020 12:13:55 +0000 (07:13 -0500)]
[lld testing] Unbreak read-only source builds

Tests must not modify the source tree.

3 years ago[InstCombine] Regenerate narrow-math.ll tests
Simon Pilgrim [Fri, 6 Nov 2020 11:35:36 +0000 (11:35 +0000)]
[InstCombine] Regenerate narrow-math.ll tests

3 years ago[AArch64][MC] Remove unused CHECK-ERROR in SVE test file
David Spickett [Fri, 6 Nov 2020 09:54:43 +0000 (09:54 +0000)]
[AArch64][MC] Remove unused CHECK-ERROR in SVE test file

This file is only ever looking for errors so we can
just use the default CHECK.

Reviewed By: sdesmalen

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

3 years ago[AArch64][MC] Remove unused prefix in v8.4-a trace test
David Spickett [Fri, 6 Nov 2020 09:45:16 +0000 (09:45 +0000)]
[AArch64][MC] Remove unused prefix in v8.4-a trace test

It was unused when added and the CHECK-ERROR lines
cover the possible outputs.

Reviewed By: ostannard

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

3 years ago[VE] Optimize address calculation
Kazushi (Jam) Marukawa [Sun, 1 Nov 2020 01:59:28 +0000 (10:59 +0900)]
[VE] Optimize address calculation

Optimize address calculations using LEA/LEASL instructions.
Update comments in VEISelLowering.cpp also.  Update an
existing regression test optimized by this modification.

Reviewed By: simoll

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

3 years ago[VE][TTI] don't advertise vregs/vops
Simon Moll [Fri, 6 Nov 2020 10:11:11 +0000 (11:11 +0100)]
[VE][TTI] don't advertise vregs/vops

Claim to not have any vector support to dissuade SLP, LV and friends
from generating SIMD IR for the VE target.  We will take this back once
vector isel is stable.

Reviewed By: kaz7, fhahn

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

3 years ago[X86] Regenerate zext-load tests and add 32-bit test coverage.
Simon Pilgrim [Thu, 5 Nov 2020 18:33:14 +0000 (18:33 +0000)]
[X86] Regenerate zext-load tests and add 32-bit test coverage.

3 years ago[VPlan] NFC: Change VFRange to take ElementCount
Sander de Smalen [Fri, 6 Nov 2020 09:03:23 +0000 (09:03 +0000)]
[VPlan] NFC: Change VFRange to take ElementCount

This patch changes the type of Start, End in VFRange to be an ElementCount
instead of `unsigned`. This is done as preparation to make VPlans for
scalable vectors, but is otherwise NFC.

Reviewed By: dmgreen, fhahn, vkmr

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

3 years ago[mlir] Add folding of memref_cast inside another memref_cast
Alex Zinenko [Fri, 6 Nov 2020 09:20:08 +0000 (10:20 +0100)]
[mlir] Add folding of memref_cast inside another memref_cast

There exists a generic folding facility that folds the operand of a memref_cast
into users of memref_cast that support this. However, it was not used for the
memref_cast itself. Fix it to enable elimination of memref_cast chains such as

  %1 = memref_cast %0 : A to B
  %2 = memref_cast %1 : B to A

that is achieved by combining the folding with the existing "A to A" cast
elimination.

Reviewed By: nicolasvasilache

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

3 years ago[clang-format] do not break before { in JS comments
Krasimir Georgiev [Fri, 6 Nov 2020 09:33:23 +0000 (10:33 +0100)]
[clang-format] do not break before { in JS comments

In JavaScript some @tags can be followed by `{`, and machinery that parses
these comments will fail to understand the comment if followed by a line break.

clang-format already handles this case by not breaking before `{` in comments.
However this was not working in cases when the column limit falls within `@tag`
or between `@tag` and `{`. This adapts clang-format for this case.

Reviewed By: mprobst

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

3 years ago[TypeSize] Extend UnivariateLinearPolyBase with getWithIncrement/Decrement methods
Sander de Smalen [Fri, 6 Nov 2020 07:56:55 +0000 (07:56 +0000)]
[TypeSize] Extend UnivariateLinearPolyBase with getWithIncrement/Decrement methods

This patch adds getWithIncrement/getWithDecrement methods to
ElementCount and TypeSize to allow:

  TypeSize::getFixed(8).getWithIncrement(8)     <=> TypeSize::getFixed(16)
  TypeSize::getFixed(16).getWithDecrement(8)    <=> TypeSize::getFixed(8)
  TypeSize::getScalable(8).getWithIncrement(8)  <=> TypeSize::getScalable(16)
  TypeSize::getScalable(16).getWithDecrement(8) <=> TypeSize::getScalable(8)

This patch implements parts of the POC in D90342.

Reviewed By: ctetreau, dmgreen

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

3 years ago[IR] CmpInst: Add getFlippedSignednessPredicate()
Roman Lebedev [Fri, 6 Nov 2020 08:14:03 +0000 (11:14 +0300)]
[IR] CmpInst: Add getFlippedSignednessPredicate()

And refactor a few places to use it

3 years ago[IR] CmpInst: add isRelational()
Roman Lebedev [Fri, 6 Nov 2020 07:40:25 +0000 (10:40 +0300)]
[IR] CmpInst: add isRelational()

Since there's CmpInst::isEquality(), it only makes sense
to have it's inverse for consistency.

3 years ago[IR] CmpInst: add isEquality(Pred)
Roman Lebedev [Fri, 6 Nov 2020 07:36:30 +0000 (10:36 +0300)]
[IR] CmpInst: add isEquality(Pred)

Currently there is only a member version of isEquality(),
which requires an actual [IF]CmpInst to be avaliable,
which isn't always possible, and is inconsistent with
the general pattern here.

I wanted to use it in a new patch, but it wasn't there..

3 years ago[IR] CmpInst: add getUnsignedPredicate()
Roman Lebedev [Fri, 6 Nov 2020 06:52:54 +0000 (09:52 +0300)]
[IR] CmpInst: add getUnsignedPredicate()

There's already getSignedPredicate(), it is not symmetrical to not have
it's opposite. I wanted to use it in new code, but it wasn't there..

3 years ago[X86] use macros to split GFNI intrinsics into different kinds
Freddy Ye [Thu, 5 Nov 2020 07:24:21 +0000 (15:24 +0800)]
[X86] use macros to split GFNI intrinsics into different kinds

Tremont microarchitecture only has GFNI(SSE) version, not AVX and
AVX512 version. This patch is to avoid compiling fail on Windows when
using -march=tremont to invoke one of GFNI(SSE) intrinsic.

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

3 years ago[Test] One more test on IndVars with negative step
Max Kazantsev [Fri, 6 Nov 2020 07:55:18 +0000 (14:55 +0700)]
[Test] One more test on IndVars with negative step

3 years ago[BranchProbabilityInfo] Introduce method copyEdgeProbabilities(). NFC
Yevgeny Rouban [Fri, 6 Nov 2020 07:46:34 +0000 (14:46 +0700)]
[BranchProbabilityInfo] Introduce method copyEdgeProbabilities(). NFC

A new method is introduced to allow bulk copy of outgoing edge
probabilities from one block to another. This can be useful when
a block is cloned from another one and we do not know if there
are edge probabilities set for the original block or not.
Copying outside of the BranchProbabilityInfo class makes the user
unconditionally set the cloned block's edge probabilities even if
they are unset for the original block.

Reviewed By: MaskRay

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

3 years ago[Test] Run test with expensive SE inference. NFC
Max Kazantsev [Fri, 6 Nov 2020 07:23:44 +0000 (14:23 +0700)]
[Test] Run test with expensive SE inference. NFC

The planned changes require expensive inference to kick in

3 years ago[BranchProbabilityInfo] Remove block handles in eraseBlock()
Yevgeny Rouban [Fri, 6 Nov 2020 06:11:08 +0000 (13:11 +0700)]
[BranchProbabilityInfo] Remove block handles in eraseBlock()

BranchProbabilityInfo::eraseBlock() is a public method and
can be called without deleting the block itself.
This method is made remove the correspondent tracking handle
from BranchProbabilityInfo::Handles along with
the probabilities of the block. Handles.erase() call is moved
to eraseBlock().
In setEdgeProbability() we need to add the block handle only once.

Reviewed By: kazu

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

3 years ago[mlir][CAPI] Add missing 'static' to inline C function.
Stella Laurenzo [Fri, 6 Nov 2020 05:47:55 +0000 (21:47 -0800)]
[mlir][CAPI] Add missing 'static' to inline C function.

* Asked to submit separately from https://reviews.llvm.org/D90824

3 years ago[BranchProbabilityInfo] Get rid of MaxSuccIdx. NFC
Yevgeny Rouban [Fri, 6 Nov 2020 05:16:19 +0000 (12:16 +0700)]
[BranchProbabilityInfo] Get rid of MaxSuccIdx. NFC

This refactoring allows to eliminate the MaxSuccIdx map
proposed in the commit a7b662d0.
The idea is to remove probabilities for a block BB for
all its successors one by one from first, second, ...
till N-th until they are defined in Probs. This works
because probabilities for the block are set at once for
all its successors from number 0 to N-1 and the rest
are removed if there were stale probs.
The protected method setEdgeProbability(), which set
probabilities for individual successor, is removed.
This makes it clear that the probabilities are set in
bulk by the public method with the same name.

Reviewed By: kazu, MaskRay

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

3 years agoCheck for nullptr before dereferencing in translateModuleToLLVMIR()
Mehdi Amini [Fri, 6 Nov 2020 04:07:35 +0000 (04:07 +0000)]
Check for nullptr before dereferencing in translateModuleToLLVMIR()

This is defensive with respect to invocations of this API with an IR
that isn't ready to be converted to LLVM IR.

3 years ago[test] Properly test -Werror-implicit-function-declaration and -Wvec-elem-size
Fangrui Song [Fri, 6 Nov 2020 04:08:23 +0000 (20:08 -0800)]
[test] Properly test -Werror-implicit-function-declaration and -Wvec-elem-size

Reviewed By: dblaikie

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

3 years ago[flang][openacc] Add parsing tests and semantic check for set directive
Valentin Clement [Fri, 6 Nov 2020 03:19:21 +0000 (22:19 -0500)]
[flang][openacc] Add parsing tests and semantic check for set directive

This patch add some parsing and clause validity tests for the set directive.
It makes use of the possibility introduces in patch D90770 to check the restriction
were one of the default_async, device_num and device_type clauses is required but also
not more than once on the set directive.

Reviewed By: sameeranjoshi

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

3 years ago[trace][intel-pt] Implement the basic decoding functionality
Walter Erquinigo [Wed, 14 Oct 2020 17:26:10 +0000 (10:26 -0700)]
[trace][intel-pt] Implement the basic decoding functionality

Depends on D89408.

This diff finally implements trace decoding!

The current interface is

  $ trace load /path/to/trace/session/file.json
  $ thread trace dump instructions

  thread #1: tid = 3842849, total instructions = 22
    [ 0] 0x40052d
    [ 1] 0x40052d
    ...
    [19] 0x400521

  $ # simply enter, which is a repeat command
    [20] 0x40052d
    [21] 0x400529
    ...

This doesn't do any disassembly, which will be done in the next diff.

Changes:
- Added an IntelPTDecoder class, that is a wrapper for libipt, which is the actual library that performs the decoding.
- Added TraceThreadDecoder class that decodes traces and memoizes the result to avoid repeating the decoding step.
- Added a DecodedThread class, which represents the output from decoding and that for the time being only stores the list of reconstructed instructions. Later it'll contain the function call hierarchy, which will enable reconstructing backtraces.
- Added basic APIs for accessing the trace in Trace.h:
  - GetInstructionCount, which counts the number of instructions traced for a given thread
  - IsTraceFailed, which returns an Error if decoding a thread failed
  - ForEachInstruction, which iterates on the instructions traced for a given thread, concealing the internal storage of threads, as plug-ins can decide to generate the instructions on the fly or to store them all in a vector, like I do.
- DumpTraceInstructions was updated to print the instructions or show an error message if decoding was impossible.
- Tests included

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

3 years ago[VE][NFC] Update rem.ll regression test
Kazushi (Jam) Marukawa [Fri, 6 Nov 2020 01:20:26 +0000 (10:20 +0900)]
[VE][NFC] Update rem.ll regression test

`Replace ISD::SREM handling with KnownBits::srem to reduce code
duplication` (bf04e34383b06f1b71819de7f34a1a1de2cdb6a4) changed
the result of rem.ll regression test.  So, updating it.

3 years ago[X86] check the k pair register in ipra-reg-usage.ll.
Luo, Yuanke [Fri, 6 Nov 2020 01:29:18 +0000 (09:29 +0800)]
[X86] check the k pair register in ipra-reg-usage.ll.

Reviewed By: pengfei

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

3 years agoRevert "Allow searching for prebuilt implicit modules."
Stella Stamenova [Fri, 6 Nov 2020 01:16:14 +0000 (17:16 -0800)]
Revert "Allow searching for prebuilt implicit modules."

This reverts commit 71e108cd86e70b06c5fa3a63689dcb3555c3d13f.

This change caused a build failure on Windows:
http://lab.llvm.org:8011/#/builders/83/builds/570

3 years ago[lldb] Remove Crashlog/interactive.test
Jonas Devlieghere [Fri, 6 Nov 2020 01:09:54 +0000 (17:09 -0800)]
[lldb] Remove Crashlog/interactive.test

This test requires running under the Python we built against (which is
easy) and setting up the PYTHONPATH (which is not worth it for this
simple test).

3 years ago[CodeExtractor] Replace uses of extracted bitcasts in out-of-region lifetime markers
Giorgis Georgakoudis [Tue, 3 Nov 2020 08:32:37 +0000 (00:32 -0800)]
[CodeExtractor] Replace uses of extracted bitcasts in out-of-region lifetime markers

CodeExtractor handles bitcasts in the extracted region that have
lifetime markers users in the outer region as outputs. That
creates unnecessary alloca/reload instructions and extra lifetime
markers. The patch identifies those cases, and replaces uses in
out-of-region lifetime markers with new bitcasts in the outer region.

**Example**
```
define void @foo() {
entry:
  %0 = alloca i32
  br label %extract

extract:
  %1 = bitcast i32* %0 to i8*
  call void @llvm.lifetime.start.p0i8(i64 4, i8* %1)
  call void @use(i32* %0)
  br label %exit

exit:
  call void @use(i32* %0)
  call void @llvm.lifetime.end.p0i8(i64 4, i8* %1)
  ret void
}
```

**Current extraction**
```
define void @foo() {
entry:
  %.loc = alloca i8*, align 8
  %0 = alloca i32, align 4
  br label %codeRepl

codeRepl:                                         ; preds = %entry
  %lt.cast = bitcast i8** %.loc to i8*
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* %lt.cast)
  %lt.cast1 = bitcast i32* %0 to i8*
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* %lt.cast1)
  call void @foo.extract(i32* %0, i8** %.loc)
  %.reload = load i8*, i8** %.loc, align 8
  call void @llvm.lifetime.end.p0i8(i64 -1, i8* %lt.cast)
  br label %exit

exit:                                             ; preds = %codeRepl
  call void @use(i32* %0)
  call void @llvm.lifetime.end.p0i8(i64 4, i8* %.reload)
  ret void
}

define internal void @foo.extract(i32* %0, i8** %.out) {
newFuncRoot:
  br label %extract

exit.exitStub:                                    ; preds = %extract
  ret void

extract:                                          ; preds = %newFuncRoot
  %1 = bitcast i32* %0 to i8*
  store i8* %1, i8** %.out, align 8
  call void @use(i32* %0)
  br label %exit.exitStub
}
```

**Extraction with patch**
```
define void @foo() {
entry:
  %0 = alloca i32, align 4
  br label %codeRepl

codeRepl:                                         ; preds = %entry
  %lt.cast1 = bitcast i32* %0 to i8*
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* %lt.cast1)
  call void @foo.extract(i32* %0)
  br label %exit

exit:                                             ; preds = %codeRepl
  call void @use(i32* %0)
  %lt.cast = bitcast i32* %0 to i8*
  call void @llvm.lifetime.end.p0i8(i64 4, i8* %lt.cast)
  ret void
}

define internal void @foo.extract(i32* %0) {
newFuncRoot:
  br label %extract

exit.exitStub:                                    ; preds = %extract
  ret void

extract:                                          ; preds = %newFuncRoot
  %1 = bitcast i32* %0 to i8*
  call void @use(i32* %0)
  br label %exit.exitStub
}
```

Reviewed By: vsk

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

3 years ago[TargetList] Delete the destructor
Vedant Kumar [Fri, 6 Nov 2020 00:41:31 +0000 (16:41 -0800)]
[TargetList] Delete the destructor

AFAICT, ~TargetList simply implements the default destructor, plus some
locking.

The history is murky, so I'm not sure why we do this locking. Perhaps,
at some point, it was possible to delete the same TargetList instance
from two different threads, setting up a race. If that were true, then
the locking would protect against the race.

Since TargetList is uniquely owned by Debugger (m_target_list), no such
race is possible today.

Testing: check-lldb

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

3 years ago[AMDGPU] Simplify amdgpu-macros.cl test. NFC.
Stanislav Mekhanoshin [Thu, 5 Nov 2020 22:17:46 +0000 (14:17 -0800)]
[AMDGPU] Simplify amdgpu-macros.cl test. NFC.

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

3 years ago[libc] Add implementations of ilogb[f|l].
Siva Chandra Reddy [Wed, 4 Nov 2020 00:30:16 +0000 (16:30 -0800)]
[libc] Add implementations of ilogb[f|l].

Depends on D90805.

Reviewed By: lntue

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

3 years ago[STLExtras] Add append_range helper.
Sean Silva [Fri, 6 Nov 2020 00:00:38 +0000 (16:00 -0800)]
[STLExtras] Add append_range helper.

This is convenient in a lot of cases, such as when the thing you want
to append is `someReallyLongFunctionName()` that you'd rather not
write twice or assign to a variable for the paired begin/end calls.

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

3 years ago[RISCV] Only enable GPR<->FPR32 bitconvert isel patterns on RV32. NFCI
Craig Topper [Thu, 5 Nov 2020 23:44:49 +0000 (15:44 -0800)]
[RISCV] Only enable GPR<->FPR32 bitconvert isel patterns on RV32. NFCI

Bitconvert requires the bitwidth to match on both sides. On RV64
the GPR size is i64 so bitconvert between f32 isn't possible. The
node should never be generated so the pattern won't ever match, but
moving the patterns under IsRV32 makes it more obviously impossible.
It also moves it to a similar location to the patterns for the
custom nodes we use for RV64.

3 years ago[libc][NFC] Make test macros callable from helper methods of test classes.
Siva Chandra Reddy [Wed, 4 Nov 2020 21:09:26 +0000 (13:09 -0800)]
[libc][NFC] Make test macros callable from helper methods of test classes.

This is acheived by making the RunContext a state variable of the test
classes.

Reviewed By: lntue

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

3 years ago[AMDGPU] Corrected declaration of VOPC instructions with SDWA addressing mode.
Konstantin Pyzhov [Thu, 5 Nov 2020 16:15:50 +0000 (11:15 -0500)]
[AMDGPU] Corrected declaration of VOPC instructions with SDWA addressing mode.

Removed "implicit def VCC" from declarations of AMDGPU VOPC instructions since they do not implicitly write to VCC in SDWA mode.

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

3 years ago[libc++] Also allow customizing the build directory when running CI
Louis Dionne [Fri, 6 Nov 2020 00:09:03 +0000 (19:09 -0500)]
[libc++] Also allow customizing the build directory when running CI

3 years ago[amdgpu] Add `llvm.amdgcn.endpgm` support.
Michael Liao [Wed, 4 Nov 2020 21:07:57 +0000 (16:07 -0500)]
[amdgpu] Add `llvm.amdgcn.endpgm` support.

- `llvm.amdgcn.endpgm` is added to enable "abort" support.

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

3 years ago[TargetList] Simplify dummy target creation
Vedant Kumar [Thu, 5 Nov 2020 19:38:50 +0000 (11:38 -0800)]
[TargetList] Simplify dummy target creation

Factor out dummy target creation from CreateTargetInternal.

This makes it impossible for dummy target creation to accidentally fail
due to too-strict checking in one of the CreateTargetInternal overloads.

Testing: check-lldb

rdar://70630655

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

3 years ago[libc++] Allow customizing a few paths when running build bots
Louis Dionne [Fri, 6 Nov 2020 00:02:32 +0000 (19:02 -0500)]
[libc++] Allow customizing a few paths when running build bots

This allows reusing run-buildbot for downstream testing as well.

3 years ago[libc++] Add a Buildkite job that tests back-deployment on Apple
Louis Dionne [Thu, 5 Nov 2020 15:47:06 +0000 (10:47 -0500)]
[libc++] Add a Buildkite job that tests back-deployment on Apple

The current way we test this is pretty cheap, i.e. we download previously
released macOS dylibs and run against that. Ideally, we would require a
full host running the appropriate version of macOS, and we'd execute the
tests using SSH on that host. But since we don't have such hosts available
easily for now, this is better than nothing.

At the same time, also fix some tests that were failing when back
deploying.

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

3 years agoDo not construct std::string from nullptr
Yuriy Chernyshov [Thu, 5 Nov 2020 20:10:38 +0000 (12:10 -0800)]
Do not construct std::string from nullptr

While I am trying to forbid such usages systematically in https://reviews.llvm.org/D79427 / P2166R0 to C++ standard, this PR fixes this (definitelly incorrect) usage in llvm.

This code is unreachable, so it could not cause any harm

Reviewed By: nikic, dblaikie

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

3 years ago[RISCV] Add isel patterns for fnmadd/fnmsub with an fneg on the second operand instea...
Craig Topper [Thu, 5 Nov 2020 21:56:52 +0000 (13:56 -0800)]
[RISCV] Add isel patterns for fnmadd/fnmsub with an fneg on the second operand instead of the first.

The multiply part of FMA is commutable, but TargetSelectionDAG.td
doesn't have it marked as commutable so tablegen won't automatically
create the additional patterns.

So manually add commuted patterns.

3 years ago[RISCV] Add test cases to show missed opportunities to use fnmadd/fnmsub if the secon...
Craig Topper [Thu, 5 Nov 2020 21:32:33 +0000 (13:32 -0800)]
[RISCV] Add test cases to show missed opportunities to use fnmadd/fnmsub if the second operand to the fma is negated rather than the first. NFC

We need to add more isel patterns to handle this.

3 years ago[LLDB-lua] modify Lua's 'print' to respect 'io.stdout'
Pedro Tammela [Thu, 5 Nov 2020 20:53:16 +0000 (20:53 +0000)]
[LLDB-lua] modify Lua's 'print' to respect 'io.stdout'

This patch changes the implementation of Lua's `print()` function to
respect `io.stdout`.

The original implementation uses `lua_writestring()` internally, which is
hardcoded to `stdout`.

Reviewed By: JDevlieghere

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

3 years agoAPINotes: repair the Windows builders
Saleem Abdulrasool [Thu, 5 Nov 2020 21:17:15 +0000 (21:17 +0000)]
APINotes: repair the Windows builders

Disable the test on Windows, which should've been obvious as being
needed.  The differences in diff implementations and line-endings make
this test difficult to execute on Windows.

3 years ago[openacc][openmp] Allow duplicate between required and allowed once/exclusive
Valentin Clement [Thu, 5 Nov 2020 21:21:15 +0000 (16:21 -0500)]
[openacc][openmp] Allow duplicate between required and allowed once/exclusive

Validity check introduce in D90241 are a bit too restrict and this patch propose to losen
them a bit. The duplicate clauses is now check only between the three allowed lists and between the
requiredClauses and allowedClauses lists. This allows to enable some check where a clause can be
required but also appear only once on the directive. We found these kind of restriction useful
on the set directive in OpenACC for example.

Reviewed By: kiranchandramohan

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

3 years ago[TableGen] Clean up documentation toctrees; clarify two paragraphs.
Paul C. Anagnostopoulos [Wed, 4 Nov 2020 23:48:53 +0000 (18:48 -0500)]
[TableGen] Clean up documentation toctrees; clarify two paragraphs.

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

3 years agoFix MLIR Python bindings build (NFC)
Mehdi Amini [Thu, 5 Nov 2020 21:16:27 +0000 (21:16 +0000)]
Fix MLIR Python bindings build (NFC)

The CMake macro refactoring had a hardcoded value left instead of using
the function argument.
Didn't catch it locally before because it required a clean build to
trigger.

3 years agoAllow searching for prebuilt implicit modules.
Alexandre Rames [Thu, 5 Nov 2020 20:07:28 +0000 (12:07 -0800)]
Allow searching for prebuilt implicit modules.

The behavior is controlled by the `-fprebuilt-implicit-modules` option, and
allows searching for implicit modules in the prebuilt module cache paths.

The current command-line options for prebuilt modules do not allow to easily
maintain and use multiple versions of modules. Both the producer and users of
prebuilt modules are required to know the relationships between compilation
options and module file paths. Using a particular version of a prebuilt module
requires passing a particular option on the command line (e.g.
`-fmodule-file=[<name>=]<file>` or `-fprebuilt-module-path=<directory>`).

However the compiler already knows how to distinguish and automatically locate
implicit modules. Hence this proposal to introduce the
`-fprebuilt-implicit-modules` option. When set, it enables searching for
implicit modules in the prebuilt module paths (specified via
`-fprebuilt-module-path`). To not modify existing behavior, this search takes
place after the standard search for prebuilt modules. If not

Here is a workflow illustrating how both the producer and consumer of prebuilt
modules would need to know what versions of prebuilt modules are available and
where they are located.

  clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules_v1 <config 1 options>
  clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules_v2 <config 2 options>
  clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules_v3 <config 3 options>

  clang -cc1 -x c use.c -fmodules fmodule-map-file=modulemap -fprebuilt-module-path=prebuilt_modules_v1 <config 1 options>
  clang -cc1 -x c use.c -fmodules fmodule-map-file=modulemap <non-prebuilt config options>

With prebuilt implicit modules, the producer can generate prebuilt modules as
usual, all in the same output directory. The same mechanisms as for implicit
modules take care of incorporating hashes in the path to distinguish between
module versions.

Note that we do not specify the output module filename, so `-o` implicit modules are generated in the cache path `prebuilt_modules`.

  clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules <config 1 options>
  clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules <config 2 options>
  clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules <config 3 options>

The user can now simply enable prebuilt implicit modules and point to the
prebuilt modules cache. No need to "parse" command-line options to decide
what prebuilt modules (paths) to use.

  clang -cc1 -x c use.c -fmodules fmodule-map-file=modulemap -fprebuilt-module-path=prebuilt_modules -fprebuilt-implicit-modules <config 1 options>
  clang -cc1 -x c use.c -fmodules fmodule-map-file=modulemap -fprebuilt-module-path=prebuilt_modules -fprebuilt-implicit-modules <non-prebuilt config options>

This is for example particularly useful in a use-case where compilation is
expensive, and the configurations expected to be used are predictable, but not
controlled by the producer of prebuilt modules. Modules for the set of
predictable configurations can be prebuilt, and using them does not require
"parsing" the configuration (command-line options).

Reviewed By: Bigcheese

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

3 years ago[VE] Add isReMaterializable and isAsCheapAsAMove flags
Kazushi (Jam) Marukawa [Tue, 3 Nov 2020 13:42:10 +0000 (22:42 +0900)]
[VE] Add isReMaterializable and isAsCheapAsAMove flags

Add isReMaterializable and isCheapAsAMove flags to integer instructions
which cost cheap.

Reviewed By: simoll

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

3 years agoFix bugs in EOL marking in command line tokenizers
Reid Kleckner [Thu, 5 Nov 2020 17:58:02 +0000 (09:58 -0800)]
Fix bugs in EOL marking in command line tokenizers

Add unit tests for this behavior, since the integration test for
clang-cl did not catch these bugs.

Fixes PR47604

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

3 years ago[CodeGen] Fix Bug 47499: __unaligned extension inconsistent behaviour with C and C++
Jan Ole Hüser [Thu, 5 Nov 2020 19:01:51 +0000 (11:01 -0800)]
[CodeGen] Fix Bug 47499: __unaligned extension inconsistent behaviour with C and C++

For the language C++ the keyword __unaligned (a Microsoft extension) had no effect on pointers.

The reason, why there was a difference between C and C++ for the keyword __unaligned:
For C, the Method getAsCXXREcordDecl() returns nullptr. That guarantees that hasUnaligned() is called.
If the language is C++, it is not guaranteed, that hasUnaligend() is called and evaluated.

Here are some links:

The Bug: https://bugs.llvm.org/show_bug.cgi?id=47499
Thread on the cfe-dev mailing list: http://lists.llvm.org/pipermail/cfe-dev/2020-September/066783.html
Diff, that introduced the check hasUnaligned() in getNaturalTypeAlignment(): https://reviews.llvm.org/D30166

Reviewed By: rnk

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