Commit Graph

371515 Commits

Author SHA1 Message Date
Tres Popp 6e8a8c2d7e [mlir] Fix bug in use of rewiter for AtomicRMWOp.
The legalization did not forward the listener which prevents dynamic
legalization and prevents rollbacks. This handled that and then changed
the associated pass to support all other std ops to support partial
conversion.

Previously, this lowering was failing, but due to the
initial bug, the op's modifications were not reverted, and thus the
pattern matching succeeded.

Differential Revision: https://reviews.llvm.org/D91079
2020-11-09 16:00:32 +01:00
Sjoerd Meijer e2dcea4489 [LoopFlatten] FlattenInfo bookkeeping. NFC.
Introduce struct FlattenInfo to group some of the bookkeeping. Besides this
being a bit of a clean-up, it is a prep step for next additions (D90640). I
could take things a bit further, but thought this was a good first step also
not to make this change too large.

Differential Revision: https://reviews.llvm.org/D90408
2020-11-09 14:50:26 +00:00
LLVM GN Syncbot 65c489852c [gn build] Port 9ca6fc4e09 2020-11-09 14:31:09 +00:00
Krasimir Georgiev 7b7170fa57 [clang-format] avoid introducing multiline comments
In C++ with -Werror=comment, multiline comments are not allowed.
clang-format could accidentally introduce multiline comments when reflowing.
This adapts clang-format to not introduce multiline comments by not allowing a
break after `\`. Note that this does not apply to comment lines that already are
multiline comments, such as comments in macros.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D90949
2020-11-09 15:29:09 +01:00
Frank Derry Wanye 9ca6fc4e09 Add a new altera kernel name restriction check to clang-tidy.
The altera kernel name restriction check finds kernel files and include
directives whose filename is "kernel.cl", "Verilog.cl", or "VHDL.cl".
Such kernel file names cause the Altera Offline Compiler to generate
intermediate design files that have the same names as certain internal
files, which leads to a compilation error.

As per the "Guidelines for Naming the Kernel" section in the "Intel FPGA
SDK for OpenCL Pro Edition: Programming Guide."

This reverts the reversion from 43a38a6523.
2020-11-09 09:26:50 -05:00
Alex Zinenko 4669ea3bd8 [mlir] Add initial Python bindings for DenseInt/FPElementsAttr
Enumerating elements in these classes is necessary to enable custom
operand accessors for variadic operands.

Depends On D90919

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D90923
2020-11-09 15:23:54 +01:00
Florian Hahn f0d76275cb
[VPlan] Print result value for loads in VPWidenMemoryInst (NFC).
For loads, print the result value.
2020-11-09 14:01:29 +00:00
Florian Hahn 537829f2a7
[VPlan] Add isStore helper to VPWidenMemoryInstructionRecipe (NFC).
Move logic to check if the recipe is a store to a helper for easier
reuse.
2020-11-09 14:01:29 +00:00
Alex Zinenko c3a6e7c9b7 [mlir] Expose operation attributes to Python bindings
Operations in a MLIR have a dictionary of attributes attached. Expose
those to Python bindings through a pseudo-container that can be indexed
either by attribute name, producing a PyAttribute, or by a contiguous
index for enumeration purposes, producing a PyNamedAttribute.

Depends On D90917

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D90919
2020-11-09 14:59:56 +01:00
Evgeny Leviant 885d3f4129 [llvm-mca] Add branch forms of ALU instructions to Cortex-A57 test 2020-11-09 16:53:50 +03:00
Jay Foad 55ea017759 [AMDGPU] Remove unused DisableDecoder machinery. NFC.
This has been unused since D24738.
2020-11-09 13:53:27 +00:00
Florian Hahn fec64de261
[VPlan] Use VPValue def for VPWidenCall.
This patch turns VPWidenCall into a VPValue and uses it
during VPlan construction and codegeneration instead of the plain IR
reference where possible.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D84681
2020-11-09 13:29:41 +00:00
Nathan James f0922efdde
[clang-tidy] Remove bad assert after 3b9b90a1
Forgot to remove it on push, just there to help debugging
2020-11-09 13:21:55 +00:00
Dmitry Preobrazhensky f4cc511303 [AMDGPU][MC] Added tests for checking error position
See bug 47519: https://bugs.llvm.org/show_bug.cgi?id=47519

Reviewers: arsenm, rampitec

Differential Revision: https://reviews.llvm.org/D90925
2020-11-09 16:19:28 +03:00
David Green a0a9e1c798 [ARM] Remove kill flags between VCMP and insertion point
When we fold a VCMP into a VPST instruction any kill flags between the
old VCMP position and the new insertion point need to be removed, in
order to keep the verifier happy.

Differential Revision: https://reviews.llvm.org/D90964
2020-11-09 13:17:53 +00:00
Lucas Prates c2c2cc1360 [ARM][AArch64] Adding Neoverse V1 CPU support
Add support for the Neoverse V1 CPU to the ARM and AArch64 backends.

This is based on patches from Mark Murray and Victor Campos.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D90765
2020-11-09 13:15:40 +00:00
Simon Pilgrim 4f175dce80 [InterleavedAccess] Remove unused check-prefixes
Just use default CHECK
2020-11-09 13:12:40 +00:00
Simon Pilgrim 6fa7030a76 [ConstProp] Remove unused check-prefixes
Just use default CHECK and remove duplicate RUN
2020-11-09 13:12:40 +00:00
Simon Pilgrim 8c4a86f790 [CodeGenPrepare] Remove unused check-prefixes 2020-11-09 13:12:39 +00:00
Francesco Petrogalli fc2fe6817e [llvm][AArch64] Simplify (and (sign_extend..) #bitmask).
Fold

    VT = (and (sign_extend NarrowVT to VT) #bitmask)

into

    VT = (zero_extend NarrowVT)

With this combine, the test replaces a sign extended load + an
unsigned extention with a zero extended load to render one of the
operands of the last multiplication.

  BEFORE                       |  AFTER
    f_i16_i32:                 |    f_i16_i32:
         .fnstart              |           .fnstart
         ldrsh   r0, [r0]      |           ldrh    r1, [r1]
         ldrsh   r1, [r1]      |           ldrsh   r0, [r0]
         smulbb  r0, r1, r0    |           smulbb  r0, r0, r1
         uxth    r1, r1        |           mul     r0, r0, r1
         mul     r0, r0, r1    |           bx      lr
         bx      lr            |

Reviewed By: resistor

Differential Revision: https://reviews.llvm.org/D90605
2020-11-09 12:53:36 +00:00
Florian Hahn 091c5c9a18
[VPlan] Add printOperands helper to VPUser (NFC).
Factor out the code for printing operands of a VPUser so it can be
re-used when printing other recipes.
2020-11-09 12:30:57 +00:00
serge-sans-paille 1e70ec10eb [lld] Provide a hook to customize undefined symbols error handling
This is a follow up to https://reviews.llvm.org/D87758, implementing the missing
symbol part, as done by binutils.

Differential Revision: https://reviews.llvm.org/D89687
2020-11-09 13:28:48 +01:00
Simon Pilgrim 28fc173819 [LoopVectorize] Remove unused check-prefixes 2020-11-09 12:18:20 +00:00
Simon Pilgrim 8a34e30d33 [LoopVectorize][AMDGPU] Regenerate packed-math test checks 2020-11-09 12:18:20 +00:00
Simon Pilgrim d2f8961b7b [MemCpyOpt] Remove unused check-prefixes
Just use default CHECK
2020-11-09 12:18:20 +00:00
Simon Pilgrim 4020bcd0ec [NewGVN] Remove unused check-prefixes 2020-11-09 12:18:19 +00:00
Nathan James 5918ef8b1a
[clangd] Handle duplicate enum constants in PopulateSwitch tweak
If an enum has different names for the same constant, make sure only the first one declared gets added into the switch. Failing to do so results in a compiler error as 2 case labels can't represent the same value.

```
lang=c
enum Numbers{
One,
Un = One,
Two,
Deux = Two,
Three,
Trois = Three
};

// Old behaviour
switch (<Number>) {
  case One:
  case Un:
  case Two:
  case Duex:
  case Three:
  case Trois: break;
}

// New behaviour
switch (<Number>) {
  case One:
  case Two:
  case Three: break;
}
```

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D90555
2020-11-09 12:14:53 +00:00
Georgii Rymar 57f87977f5 [LLDB][test] - Update one more test after the yaml2obj change.
I've missed this one.
2020-11-09 14:56:07 +03:00
LemonBoy 42732d33cc
[InstCombine] Fix constant-folding of overflowing arithmetic ops on vectors
Feeding vector values to `InstCombiner::OptimizeOverflowCheck` produces a scalar boolean flag if it proves the overflow check can be eliminated.
This causes `InstCombiner::CreateOverflowTuple` to crash as it correctly expects a vector of i1 values instead.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D89628
2020-11-09 14:41:07 +03:00
Sanne Wouda f4f256fb7b Reland "Precommit LTO pipeline test"
Target Pass Configuration does not always run, so we can't check for it.
2020-11-09 11:37:01 +00:00
Simon Pilgrim 10f8156e79 [SLPVectorizer][X86] Remove unused check-prefixes 2020-11-09 11:17:08 +00:00
Michał Górny bc125665c5 [lldb] [Host/freebsd] Set Arg0 for 'platform process list -v'
Same fix as in NetBSD (a6712889f5).

Differential Revision: https://reviews.llvm.org/D91026
2020-11-09 12:09:12 +01:00
Michał Górny 2384c4f971 Revert "[lldb] [Host/freebsd] Set Arg0 for 'platform process list -v'"
Accidentally referenced the wrong diff.

This reverts commit fce8e75889.
2020-11-09 12:09:12 +01:00
Georgii Rymar 62e3b2ec1d [lldb][test] - Update test cases after yaml2obj change.
The format of program header descriptions was changed by D90458.
2020-11-09 13:53:40 +03:00
Simon Pilgrim 5c987212b7 [SimplifyCFG] Remove unused check-prefixes 2020-11-09 10:37:18 +00:00
Simon Pilgrim 0654eb5702 [Scalarizer] Remove unused check-prefixes 2020-11-09 10:37:17 +00:00
Michał Górny afcdd43bf7 [llvm] [Support] Fix segv if argv0 is null in getMainExecutable()
When LLDB Python bindings are used and stack backtraces are enabled
for logging, getMainExecutable() is called with argv0 being null.
This caused the fallback function getprogpath() (used on FreeBSD, NetBSD
and Linux) to segfault.  Make it handle null executable name gracefully.

Differential Revision: https://reviews.llvm.org/D91012
2020-11-09 11:35:11 +01:00
Michał Górny fce8e75889 [lldb] [Host/freebsd] Set Arg0 for 'platform process list -v'
Same fix as in NetBSD (a6712889f5).

Differential Revision: https://reviews.llvm.org/D91012
2020-11-09 11:35:11 +01:00
Michał Górny 7e2ef84fe7 [lldb] [test] Extend watchpoint test to wait for thread to start
TestWatchpointMultipleThreads currently accounts for two scenarios:
setting the watchpoint before a new thread starts (presumably, verifying
that it will be propagated to the new thread) and setting it after
the thread starts (presumably, verifying that a new watchpoint is set
on all threads).  However, the latter test currently assumes that
the thread will be reported to the debugger before the breakpoint is
hit.  This is not the case on FreeBSD and NetBSD.

On NetBSD, new threads do not inherit debug registers from their parent
threads.  Instead, LLDB copies them manually after the new thread is
reported.  Since the thread is actually reported after the second
breakpoint location, both tests effectively check the same behavior
(i.e. watchpoint being set before the new thread is reported).

On FreeBSD, new threads inherit debug registers and we seem to hit
an interesting race condition.  While the thread is reported after
the breakpoint is hit, the kernel seems to construct it and copy
the debug register before that happens.  As a result, setting
the watchpoint at the second breakpoint location modifies the debug
registers of the first thread after they have been copied to the second
thread but before the debugger is aware of it.  Therefore,
the watchpoint is not propagated to the second thread and the test
fails.

Extend the test to cover all three possible scenarios: setting
watchpoint before the thread is lanched, after it is launched but before
it is guaranteed to have started and after it has actually started.  Add
a second barrier to account for the last case.  This should ensure that
the second assumption (i.e. that the watchpoint is set on all currently
known threads) is actually tested on FreeBSD and NetBSD.

Differential Revision: https://reviews.llvm.org/D91030
2020-11-09 11:35:11 +01:00
Michał Górny 9e1409aa1e [lldb] [Process/FreeBSDRemote] Handle exec() from inferior
Differential Revision: https://reviews.llvm.org/D90938
2020-11-09 11:35:11 +01:00
Georgii Rymar a7a447be0f [yaml2obj] - ProgramHeaders: introduce FirstSec/LastSec instead of Sections list.
Imagine we have a YAML declaration of few sections: `foo1`, `<unnamed 2>`, `foo3`, `foo4`.

To put them into segment we can do (1*):

```
Sections:
 - Section: foo1
 - Section: foo4
```

or we can use (2*):

```
Sections:
 - Section: foo1
 - Section: foo3
 - Section: foo4
```

or (3*) :

```
Sections:
 - Section: foo1
## "(index 2)" here is a name that we automatically created for a unnamed section.
 - Section: (index 2)
 - Section: foo3
 - Section: foo4
```

It looks really confusing that we don't have to list all of sections.

At first I've tried to make this rule stricter and report an error when there is a gap
(i.e. when a section is included into segment, but not listed explicitly).
This did not work perfect, because such approach conflicts with unnamed sections/fills (see (3*)).

This patch drops "Sections" key and introduces 2 keys instead: `FirstSec` and `LastSec`.
Both are optional.

Differential revision: https://reviews.llvm.org/D90458
2020-11-09 13:00:50 +03:00
Georgii Rymar 99a6401acc Recommit: [llvm-readelf/obj] - Allow dumping of ELF header even if some elements are corrupt.
This is recommit for D90903 with fixes for BB:
1) Used std::move<> when returning Expected<> (http://lab.llvm.org:8011/#/builders/112/builds/913)
2) Fixed the name of temporarily file in the file-headers.test (http://lab.llvm.org:8011/#/builders/36/builds/1269)
   (a local old temporarily file was used before)

For creating `ELFObjectFile` instances we have the factory method
`ELFObjectFile<ELFT>::create(MemoryBufferRef Object)`.

The problem of this method is that it scans the section header to locate some sections.
When a file is truncated or has broken fields in the ELF header, this approach does
not allow us to create the `ELFObjectFile` and dump the ELF header.

This is https://bugs.llvm.org/show_bug.cgi?id=40804

This patch suggests a solution - it allows to delay scaning sections in the
`ELFObjectFile<ELFT>::create`. It now allows user code to call an object
initialization (`initContent()`) later. With that it is possible,
for example, for dumpers just to dump the file header and exit.
By default initialization is still performed as before, what helps to keep
the logic of existent callers untouched.

I've experimented with different approaches when worked on this patch.
I think this approach is better than doing initialization of sections (i.e. scan of them)
on demand, because normally users of `ELFObjectFile` API expect to work with a valid object.
In most cases when a section header table can't be read (because of an error), we don't
have to continue to work with object. So we probably don't need to implement a more complex API.

Differential revision: https://reviews.llvm.org/D90903
2020-11-09 12:53:53 +03:00
Jan Kratochvil 24f07531a3 [lldb] Fix DW_AT_decl_file from DW_AT_specification from a different CU
This would be reproducible in future DWZ category of the testsuite as:
  Failed Tests (1):
    lldb-api :: python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py

Differential Revision: https://reviews.llvm.org/D91014
2020-11-09 10:52:48 +01:00
Tim Northover f7fe7ea24d [MergeFunctions] fix function attribute comparison in FunctionComparator
The comparison of AttributeSets stopped after seeing a matching type attribute.
Subsequent mismatching attributes were not detected causing a crash.
2020-11-09 09:19:11 +00:00
QingShan Zhang 2d9097a06a [NFC][Test] Add tests for constant pool on PowerPC 2020-11-09 09:17:28 +00:00
Georgii Rymar f59216b58f Revert "[llvm-readelf/obj] - Allow dumping of ELF header even if some elements are corrupt."
This reverts commit ea8a0b8b29.

It broke BBots.
http://lab.llvm.org:8011/#/builders/14/builds/1439
http://lab.llvm.org:8011/#/builders/112/builds/913
2020-11-09 11:50:50 +03:00
Georgii Rymar ea8a0b8b29 [llvm-readelf/obj] - Allow dumping of ELF header even if some elements are corrupt.
For creating `ELFObjectFile` instances we have the factory method
`ELFObjectFile<ELFT>::create(MemoryBufferRef Object)`.

The problem of this method is that it scans the section header to locate some sections.
When a file is truncated or has broken fields in the ELF header, this approach does
not allow us to create the `ELFObjectFile` and dump the ELF header.

This is https://bugs.llvm.org/show_bug.cgi?id=40804

This patch suggests a solution - it allows to delay scaning sections in the
`ELFObjectFile<ELFT>::create`. It now allows user code to call an object
initialization (`initContent()`) later. With that it is possible,
for example, for dumpers just to dump the file header and exit.
By default initialization is still performed as before, what helps to keep
the logic of existent callers untouched.

I've experimented with different approaches when worked on this patch.
I think this approach is better than doing initialization of sections (i.e. scan of them)
on demand, because normally users of `ELFObjectFile` API expect to work with a valid object.
In most cases when a section header table can't be read (because of an error), we don't
have to continue to work with object. So we probably don't need to implement a more complex API.

Differential revision: https://reviews.llvm.org/D90903
2020-11-09 11:27:07 +03:00
Georgii Rymar c9d036ad4a [yaml2obj] - Implement BBAddrMapSection::getEntries(). NFC.
This allows to use the generic fields validation
mechanism that we have.

The behavior (i.e. an error reported) remains the same.
2020-11-09 11:11:57 +03:00
Sam McCall 053110b22a [clangd] Don't run clang-tidy AST traversal if there are no checks.
While here, clean up ParsedAST::build a bit:
 - remove FIXMEs that were fixed long ago by ReplayPreamble
 - remove redundant if, ClangTidyContext is not actually optional

Differential Revision: https://reviews.llvm.org/D90975
2020-11-09 08:44:06 +01:00
Michael Liao fa5d31f825 [GlobalsAA] Teach to handle `addrspacecast`. 2020-11-09 00:04:52 -05:00