Commit Graph

352163 Commits

Author SHA1 Message Date
Kerry McLaughlin 17f6e18acf [AArch64][SVE] Add SVE intrinsic for LD1RQ
Summary:
Adds the following intrinsic for contiguous load & replicate:
  - @llvm.aarch64.sve.ld1rq

The LD1RQ intrinsic only needs the SImmS16XForm added by this
patch. The others (SImmS2XForm, SImmS3XForm & SImmS4XForm)
were added for consistency.

Reviewers: andwar, sdesmalen, efriedma, cameron.mcinally, dancgr, rengolin

Reviewed By: sdesmalen

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, danielkiss, cfe-commits, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76929
2020-04-22 11:29:27 +01:00
Benjamin Kramer b198f1f86c Make some static class members constexpr
This allows them to be ODR used in C++17 mode. NFC.
2020-04-22 12:25:01 +02:00
Georgii Rymar 2bf5674317 [yaml2obj] - Program headers: add an additional check for `Offset`
The `Offset` field is used to set the file offset of a program header.
In a normal object it should not be greater than the minimal offset
of sections included into segment.

This patch adds a check for that and adds tests.

Differential revision: https://reviews.llvm.org/D78304
2020-04-22 12:49:05 +03:00
Georgii Rymar 87d33d9e09 [yaml2obj] - Change how p_offset is calculated when creating segments. NFCI.
This depends on D78361 and simplifies the computation of the `p_offset`.

Differential revision: https://reviews.llvm.org/D78363
2020-04-22 12:37:44 +03:00
Georgii Rymar 317c4913c6 [obj2yaml] - Fix the issue with dumping empty sections when dumping program headers.
Imagine we have:

```
ProgramHeaders:
  - Type:  PT_LOAD
    Flags: [ PF_W, PF_R ]
    Sections:
      - Section: .bar
    VAddr: 0x2000
Sections:
  - Name:    .foo
    Type:    SHT_PROGBITS
    Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
    Address: 0x1000
  - Name:    .bar
    Type:    SHT_PROGBITS
    Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
    Address: 0x2000
```

Both `.foo` and `.bar` share the same starting file offset,
but `VA(.foo)` < `VA(PT_LOAD)`, we should not include it into segment.

This patch fixes the issue.

Differential revision: https://reviews.llvm.org/D77652
2020-04-22 12:36:00 +03:00
Sjoerd Meijer 0736d1ccf3 [ARM][MVE] Tail-predication: some more comments and debug messages. NFC.
Finding the loop tripcount is the first crucial step in preparing a loop for
tail-predication, and this adds a debug message if a tripcount cannot be found.

And while I was at it, I added some more comments here and there.

Differential Revision: https://reviews.llvm.org/D78485
2020-04-22 10:34:23 +01:00
Sam McCall 161afc0106 [clangd] Remove vscode plugin: now https://github.com/clangd/vscode-clangd
Summary:
Moving this out of the monorepo for consistency with other editor plugins.
There's no version lock with clangd itself, and we never ran tests with lit.

The first version from the new repo has been published.

Reviewers: hokein

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D78598
2020-04-22 11:11:13 +02:00
Sjoerd Meijer 35cf2f42dd [Driver][docs] Document option -mtune as a no-op.
This documents that option -mtune is accepted for compatibility with GCC,
currently it has no effect, and thus does not currently perform any CPU type
specific tuning.

Corresponding discussion on the cfe dev list:
http://lists.llvm.org/pipermail/cfe-dev/2020-April/065169.html

Differential Revision: https://reviews.llvm.org/D78511
2020-04-22 09:15:48 +01:00
Jay Foad 7318625674 [AMDGPU] Remove obsolete special case for 1024-bit vector types. NFC. 2020-04-22 09:05:24 +01:00
Jay Foad 2fa17cdd7a [AMDGPU] Simplify definition of VReg and AReg classes. NFC.
Differential Revision: https://reviews.llvm.org/D78553
2020-04-22 08:59:28 +01:00
Frederik Gossen 0372db05bb [MLIR] Use nested symbol to identify kernel in `LaunchFuncOp`.
Summary:
Use a nested symbol to identify the kernel to be invoked by a `LaunchFuncOp` in the GPU dialect.
This replaces the two attributes that were used to identify the kernel module and the kernel within seperately.

Differential Revision: https://reviews.llvm.org/D78551
2020-04-22 07:44:29 +00:00
Frederik Gossen 648fc95083 [MLIR] Use `kernel` as a short hand for `gpu.kernel` attribute.
Summary:
Use the shortcu `kernel` for the `gpu.kernel` attribute of `gpu.func`.
The parser supports this and test cases are easier to read.

Differential Revision: https://reviews.llvm.org/D78542
2020-04-22 07:38:30 +00:00
Sam Parker 04ef154124 [NFC] Test changes
Add some more targets for the ARM cost model tests and add some tests
for icmps and bitcasts.
2020-04-22 08:28:52 +01:00
Frederik Gossen 2813802746 [MLIR] Fix test case for kernel attribute.
Summary:
Fix a broken test case in the `invalid.mlir` lit test case.
`expect` was missing its `e`.

Differential Revision: https://reviews.llvm.org/D78540
2020-04-22 07:27:39 +00:00
aartbik 5397f29087 [llvm] [X86] Make test more robust against different builds
Summary:
Rationale:
Using the --debug-only flag requires a debug build. Also, the debug output is not always consistent over different builds.
This change avoids all problems by just testing the generated assembly for AVX.

Reviewers: craig.topper, mehdi_amini, nicolasvasilache

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78609
2020-04-22 00:23:46 -07:00
Raphael Isemann a53874b7e4 [lldb] Fix modules build by adding missing include
This header is using FileSpec so we should at least include the forward header.
2020-04-22 09:14:09 +02:00
Kazushi (Jam) Marukawa a6ef471919 [VE] Update shift operation instructions
Summary:
Changing all mnemonic to match assembly instructions to simplify mnemonic
naming rules. This time update all shift operation instructions.  This also
corrects instruction's operation kinds.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D78468
2020-04-22 09:10:10 +02:00
Kazushi (Jam) Marukawa ba4162c1c4 [VE] Add alternative names to registers
Summary:
VE uses identical names "%s0-63" to all generic registers.  Change to use
alternative name mechanism among all generic registers instead of hard-
coding them.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D78174
2020-04-22 09:07:42 +02:00
Craig Topper 05a11974ae [CallSite removal] Remove unneeded includes of CallSite.h. NFC 2020-04-22 00:07:13 -07:00
Alexander Belyaev 146d52e732 [MLIR] Verify there are no side-effecting ops in GenericAtomicRMWOp body.
Differential Revision: https://reviews.llvm.org/D78559
2020-04-22 09:02:58 +02:00
Stephan Herhut c22876b550 [MLIR] Add extra locking during cubin generation.
We also need to lock the LLVMDialect mutex when initializing
LLVM targets or destroying llvm modules concurrently. Added another
scoped lock to that effect.

Differential Revision: https://reviews.llvm.org/D78580
2020-04-22 08:57:45 +02:00
Alexander Belyaev 84e4c09995 [MLIR] Update documentation for loop.parallel.
Differential Revision: https://reviews.llvm.org/D78562
2020-04-22 08:48:49 +02:00
Johannes Doerfert ca59ff5af9 [Attributor] Replace AccessKind2Accesses map with an "array map"
The number of different access location kinds we track is relatively
small (8 so far). With this patch we replace the DenseMap that mapped
from index (0-7) to the access set pointer with an array of access set
pointers. This reduces memory consumption.

No functional change is intended.

---

Single run of the Attributor module and then CGSCC pass (oldPM)
for SPASS/clause.c (~10k LLVM-IR loc):

Before:
```
calls to allocation functions: 472499 (215654/s)
temporary memory allocations: 77794 (35506/s)
peak heap memory consumption: 35.28MB
peak RSS (including heaptrack overhead): 125.46MB
total memory leaked: 269.04KB
```

After:
```
calls to allocation functions: 472270 (308673/s)
temporary memory allocations: 77578 (50704/s)
peak heap memory consumption: 32.70MB
peak RSS (including heaptrack overhead): 121.78MB
total memory leaked: 269.04KB
```

Difference:
```
calls to allocation functions: -229 (346/s)
temporary memory allocations: -216 (326/s)
peak heap memory consumption: -2.58MB
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B
```

---
2020-04-22 01:35:27 -05:00
Johannes Doerfert f20ff4b17d [Attributor] Run IRPosition::verify only with EXPENSIVE_CHECKS 2020-04-22 01:35:12 -05:00
Craig Topper d22989c34e [CallSite removal][Target] Replace CallSite with CallBase. NFC
In some cases just delete an unneeded include.
2020-04-21 23:29:36 -07:00
Qiu Chaofan c12722cde8 [PowerPC] Exploit RLDIMI for OR with large immediates
This patch exploits rldimi instruction for patterns like
`or %a, 0b000011110000`, which saves number of instructions when the
operand has only one use, compared with `li-ori-sldi-or`.

Reviewed By: nemanjai

Differential Revision: https://reviews.llvm.org/D77850
2020-04-22 14:16:52 +08:00
Craig Topper daadb48553 [CallSite removal][TargetTransformInfoImpl] Replace CallSite with CallBase. NFC 2020-04-21 22:49:30 -07:00
Siva Chandra Reddy c08af2c11a [libc][NFC] Cleanup dependencies in src/signal and test/src/signal.
Reviewers: abrachet

Differential Revision: https://reviews.llvm.org/D78585
2020-04-21 22:25:01 -07:00
Igor Kudrin 1f48e22df8 [DebugInfo] Simplify DWARFUnit::determineStringOffsetsTableContribution(). NFC.
The method is called from only one place and the call is already guarded
by a condition which checks that IsDWO is false.

Differential Revision: https://reviews.llvm.org/D78482
2020-04-22 12:11:17 +07:00
Mehdi Amini 8dc790b933 Add `//` before the banner displayed in `--print-ir-before/after-all`
This is making the output file (when the stream is a file) a valid MLIR
file.

Differential Revision: https://reviews.llvm.org/D78604
2020-04-22 04:40:15 +00:00
Eli Friedman 46a52ff9ed [TargetPassConfig] Run MachineVerifier after more passes.
We were disabling verification for no reason in a bunch of places; just
turn it on.

At this point, there are two key places where we don't run verification:
during register allocation, and after addPreEmitPass.  Regalloc probably
isn't worth messing with; it has its own invariants, and verifying
afterwards is probably good enough.  For after addPreEmitPass, it's
probably worth investigating improvements.
2020-04-21 21:05:07 -07:00
Ian Levesque 5081468a66 [xray] Avoid text relocations in trampolines for ARM/AArch64
Summary: Switch to pc-relative lookup of the xray handler function to avoid text relocations.

Reviewers: MaskRay, dberris, johnislarry

Subscribers: kristof.beyls, danielkiss, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D78595
2020-04-21 23:21:02 -04:00
Ian Levesque eeaabe64e3 [xray] Use hidden symbol visibility for xray trampolines
Summary: We load multiple copies of the trampolines into memory when instrumenting DSOs.  Hidden visibility prevents conflicts in this scenario.

Reviewers: MaskRay, dberris, johnislarry

Subscribers: #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D78593
2020-04-21 23:19:52 -04:00
Fangrui Song 8d45d6e39d [Frontend] Drop unneeded CC1 options 2020-04-21 19:59:28 -07:00
Sameer Sahasrabuddhe 5a7a6382bc FixIrreducible: don't crash when moving a child loop
Summary:
When an irreducible SCC is converted into a new natural loop, existing
loops included in that SCC now become children of the new loop. The
logic that moves these loops from the parent loop to the new loop
invoked undefined behaviour when it modified the container that it was
iterating over. Fixed this by first extracting all the loops that are
to be removed from the parent.

Fixes bug 45623.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D78544
2020-04-22 07:47:30 +05:30
Dan Liew da820f4f57 Add missing call to `__sanitizer::InitializePlatformEarly()` in UBSan's standalone init.
Summary:
While working on rdar://problem/62083617 I noticed this call was
missing.

This is a no-op for all platforms except Darwin. For Darwin this
means the `use_xnu_fast_mmap` flag is initialized as it was intended
when using UBSan in standalone mode.

Reviewers: vitalybuka, vsk, kubamracek, yln, samsonov

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D78532
2020-04-21 18:43:43 -07:00
Dan Liew 564530e50a Add missing call to `Symbolizer::LateInitialize()` in UBSan's standalone init.
Summary:
This fixes symbolization in Standalone UBSan mode for the Darwin simulators.

861b69faee (rdar://problem/58789439) tried to fix
symbolization for all sanitizers on Darwin simulators but unfortunately it only
fixed the problem for TSan.

For UBSan in standalone mode the fix wasn't sufficient because UBSan's
standalone init doesn't call `Symbolizer::LateInitialize()` like ASan
and TSan do. This meant that `AtosSymbolizerProcess::LateInitialize()`
was never being called before
`AtosSymbolizerProcess::StartSymbolizerSubprocess()` which breaks an
invariant we expect to hold.

The missing call to `Symbolizer::LateInitialize()` during UBSan's
standalone init seems like an accidently omission so this patch simply
adds it.

rdar://problem/62083617

Reviewers: vitalybuka, kubamracek, yln, samsonov

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D78530
2020-04-21 18:43:33 -07:00
Justin Hibbits 4ca2cad947 [PowerPC] Add clang -msvr4-struct-return for 32-bit ELF
Summary:

Change the default ABI to be compatible with GCC.  For 32-bit ELF
targets other than Linux, Clang now returns small structs in registers
r3/r4.  This affects FreeBSD, NetBSD, OpenBSD.  There is no change for
32-bit Linux, where Clang continues to return all structs in memory.

Add clang options -maix-struct-return (to return structs in memory) and
-msvr4-struct-return (to return structs in registers) to be compatible
with gcc.  These options are only for PPC32; reject them on PPC64 and
other targets.  The options are like -fpcc-struct-return and
-freg-struct-return for X86_32, and use similar code.

To actually return a struct in registers, coerce it to an integer of the
same size.  LLVM may optimize the code to remove unnecessary accesses to
memory, and will return i32 in r3 or i64 in r3:r4.

Fixes PR#40736

Patch by George Koehler!

Reviewed By: jhibbits, nemanjai
Differential Revision: https://reviews.llvm.org/D73290
2020-04-21 20:17:25 -05:00
Andrew Browne a30e7ea88e Make SmallVector assert if it cannot grow.
Context:

  /// Double the size of the allocated memory, guaranteeing space for at
  /// least one more element or MinSize if specified.
  void grow(size_t MinSize = 0) { this->grow_pod(MinSize, sizeof(T)); }

  void push_back(const T &Elt) {
    if (LLVM_UNLIKELY(this->size() >= this->capacity()))
      this->grow();
    memcpy(reinterpret_cast<void *>(this->end()), &Elt, sizeof(T));
    this->set_size(this->size() + 1);
  }

When grow is called in push_back() without a MinSize specified, this is
relying on the guarantee of space for at least one more element.

There is an edge case bug where the SmallVector is already at its maximum size
and push_back() calls grow() with default MinSize of zero. Grow is unable to
provide space for one more element, but push_back() assumes the additional
element it will be available. This can result in silent memory corruption, as
this->end() will be an invalid pointer and the program may continue executing.

Another alternative to fix would be to remove the default argument from
grow(), which would mean several changing grow() to grow(this->size()+1)
in several places.

No test case added because it would require allocating ~4GB.

Reviewers: echristo

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77601
2020-04-21 17:53:39 -07:00
Lawrence D'Anna 7375212172 get rid of PythonInteger::GetInteger()
Summary:
One small step in my long running quest to improve python exception handling in
LLDB.  Replace GetInteger() which just returns an int with As<long long> and
friends, which return Expected types that can track python exceptions

Reviewers: labath, jasonmolenda, JDevlieghere, vadimcn

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D78462
2020-04-21 16:55:51 -07:00
LLVM GN Syncbot dad6de4112 [gn build] Port 2360933147 2020-04-21 23:36:07 +00:00
Amy Huang 2360933147 Reland "Implement some functions in NativeSession." with fixes so that
the tests pass on Linux.

Summary:
This change implements readFromExe, and calculating VA and RVA, which
are some of the functionalities that will be used for native PDB reading
for llvm symbolizer.

bug: https://bugs.llvm.org/show_bug.cgi?id=41795
2020-04-21 16:35:27 -07:00
Mircea Trofin 9ee02aef62 [llvm][NFC][CallSite] Remove CallSite from FunctionAttrs
Reviewers: dblaikie, craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78584
2020-04-21 16:16:00 -07:00
Bruno Cardoso Lopes d892eec710 Reapply: Make header inclusion order from umbrella dirs deterministic
Sort the headers by name before adding the includes in
collectModuleHeaderIncludes. This makes the include order for building
umbrellas deterministic across different filesystems and also guarantees
that the ASTWriter always dump top headers in the same order.

There's currently no good way to test for this behavior.

This was first introduced in r289478 and reverted few times because of
ASANifed test failures on open source bots (both from LLVM and Swift).

Finally reproduced the problem in a Linux machine and use std::sort as a
fix, since we are not dealing with POD-like types.

rdar://problem/28116411
2020-04-21 15:45:54 -07:00
Fangrui Song 01d2a01e79 [ELF] Fix a null pointer dereference when relocating a Local-Exec TLS relocation for a lazy symbol
If there is no SHF_TLS section, there will be no PT_TLS and Out::tlsPhdr may be a nullptr.
If the symbol referenced by an R_TLS is lazy, we should treat the symbol as undefined.

Also reorganize tls-in-archive.s and tls-weak-undef.s . They do not test what they intended to test.
2020-04-21 15:39:31 -07:00
Dan Liew c860262bd2 Disable a Darwin test under LSan.
* Changing source lines seems to cause us to hit rdar://problem/62132428.
* Even if I workaround the above issue sometimes the source line in the dylib reported by atos is off by one.

It's simpler to just disable the test for now.

rdar://problem/61793759
2020-04-21 15:17:21 -07:00
Jonas Devlieghere b707cf096d [lldb/Test] Add decorator to the right method 2020-04-21 15:05:32 -07:00
Jonas Devlieghere 1e566f6b47 [lldb/Test] Add skipIfReproducer for tests that diverge during replay
Add the skipIfReproducer decorator to the remaining tests that fail to
replay because the GDB remote packets diverge during replay. This is
*not* expected and should be fixed, but figuring out exactly what caused
the divergence has proven pretty difficult to track down.

I've marked these tests as skipped for now so we can get clean results
and detect new regressions. I have no evidence to believe that these
failures have the same root cause, so I've not assigned them a PR.
2020-04-21 14:42:14 -07:00
Jonas Devlieghere 400b6f2bc5 [lldb/Test] Add skipIfReproducer for tests that are not expected to work
Some tests are not expected to work with reproducers, for example tests
that completely circumvent the reproducers (i.e. using the side_effects
Python module) or that rely on changes to the file system.
2020-04-21 14:42:14 -07:00
LLVM GN Syncbot 67c6b80569 [gn build] Port 352fef3f11 2020-04-21 21:22:08 +00:00