Commit Graph

368216 Commits

Author SHA1 Message Date
Dmitri Gribenko 37c74dfe72 Revert "[c++17] Implement P0145R3 during constant evaluation."
This reverts commit ded79be635. It causes
a crash (I sent the crash reproducer directly to the author).
2020-10-06 15:49:44 +02:00
Simon Pilgrim 17b9a91ec2 [InstCombine] canRewriteGEPAsOffset - don't dereference a dyn_cast<>. NFCI.
We know V is a IntToPtrInst or PtrToIntInst type so we know its a CastInst - so use cast<> directly.

Prevents clang static analyzer warning that we could deference a null pointer.
2020-10-06 14:48:34 +01:00
Simon Pilgrim 75d33a3a97 [InstCombine] FoldShiftByConstant - consistently use ConstantExpr in logicalshift(trunc(shift(x,c1)),c2) fold. NFCI.
This still only gets used for scalar types but now always uses ConstantExpr in preparation for vector support - it was using APInt methods in some places.
2020-10-06 14:48:34 +01:00
Haojian Wu 8a3cbb1535 [clangd] Add basic keyword-name-validation in rename.
Differential Revision: https://reviews.llvm.org/D88875
2020-10-06 15:47:57 +02:00
Sam Tebbs 68e002e181 [ARM] Fold select_cc(vecreduce_[u|s][min|max], x) into VMINV or VMAXV
This folds a select_cc or select(set_cc) of a max or min vector reduction with a scalar value into a VMAXV or VMINV.

    Differential Revision: https://reviews.llvm.org/D87836
2020-10-06 14:44:58 +01:00
Dmitry Preobrazhensky e2452f57fa [AMDGPU][MC] Added detection of unsupported instructions
Implemented identification of unsupported instructions; improved errors reporting.

See bug 42590.

Reviewers: rampitec

Differential Revision: https://reviews.llvm.org/D88211
2020-10-06 16:44:27 +03:00
Nicolas Vasilache d8ee28b96e [mlir][Linalg] Extend buffer allocation to support Linalg init tensors
This revision adds init_tensors support to buffer allocation for Linalg on tensors.
Currently makes the assumption that the init_tensors fold onto the first output tensors.

This assumption is not currently enforced or cast in stone and requires experimenting with tiling linalg on tensors for ops **without reductions**.

Still this allows progress towards the end-to-end goal.
2020-10-06 13:24:27 +00:00
Chuyang Chen 8fa45e1fd5 Convert diagnostics about multi-character literals from extension to warning
This addresses PR46797.
2020-10-06 08:47:17 -04:00
Jonas Paulsson 5588dbce73 [SystemZAsmParser] Treat VR128 separately in ParseDirectiveInsn().
This patch makes the parser
  - reject higher vector registers (>=16) in operands where they should not
    be accepted.
  - accept higher integers (>=16) in vector register operands.

Review: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D88888
2020-10-06 14:42:40 +02:00
Michał Górny a825eaa90e [lldb] [Platform] Move common ::DebugProcess() to PlatformPOSIX
Move common ::DebugProcess() implementation shared by Linux and NetBSD
(and to be shared by FreeBSD shortly) into PlatformPOSIX, and move
the old base implementation used only by Darwin to PlatformDarwin.

Differential Revision: https://reviews.llvm.org/D88852
2020-10-06 14:38:54 +02:00
Simon Pilgrim 21100f885d [InstCombine] FoldShiftByConstant - use PatternMatch for logicalshift(trunc(shift(x,c1)),c2) fold. NFCI. 2020-10-06 13:13:08 +01:00
Simon Pilgrim 0b402e985e [InstCombine] FoldShiftByConstant - remove unnecessary cast<>. NFC.
Op1 is already a Constant*
2020-10-06 13:13:08 +01:00
Alexey Lapshin 7bbb65b0a4 [llvm-objcopy][NFC] fix style issues reported by clang-format. 2020-10-06 15:06:25 +03:00
LLVM GN Syncbot 95429b88a4 [gn build] Port d6c9dc3c17 2020-10-06 12:02:07 +00:00
Adam Balogh d6c9dc3c17 [clang-tidy] Remove obsolete checker google-runtime-references
The rules which is the base of this checker is removed from the
//Google C++ Style Guide// in May:
[[ https://github.com/google/styleguide/pull/553 | Update C++ styleguide ]].
Now this checker became obsolete.

Differential Revision: https://reviews.llvm.org/D88831
2020-10-06 14:03:55 +02:00
Alexander Shaposhnikov 315970de1d [llvm-objcopy][MachO] Add support for universal binaries
This diff adds support for universal binaries to llvm-objcopy.
This is a recommit of 32c8435ef7 with the asan issue fixed.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D88400
2020-10-06 04:01:40 -07:00
Denis Antrushin c08d48fc2d [Statepoints] Change statepoint machine instr format to better suit VReg lowering.
Current Statepoint MI format is this:

   STATEPOINT
   <id>, <num patch bytes >, <num call arguments>, <call target>,
   [call arguments...],
   <StackMaps::ConstantOp>, <calling convention>,
   <StackMaps::ConstantOp>, <statepoint flags>,
   <StackMaps::ConstantOp>, <num deopt args>, [deopt args...],
   <gc base/derived pairs...> <gc allocas...>

Note that GC pointers are listed in pairs <base,derived>.
This causes base pointers to appear many times (at least twice) in
instruction, which is bad for us when VReg lowering is ON.
The problem is that machine operand tiedness is 1-1 relation, so
it might look like this:

  %vr2 = STATEPOINT ... %vr1, %vr1(tied-def0)

Since only one instance of %vr1 is tied, that may lead to incorrect
codegen (see PR46917 for more details), so we have to always spill
base pointers. This mostly defeats new VReg lowering scheme.

This patch changes statepoint instruction format so that every
gc pointer appears only once in operand list. That way they all can
be tied. Additional set of operands is added to preserve base-derived
relation required to build stackmap.
New statepoint has following format:

  STATEPOINT
  <id>, <num patch bytes>, <num call arguments>, <call target>,
  [call arguments...],
  <StackMaps::ConstantOp>, <calling convention>,
  <StackMaps::ConstantOp>, <statepoint flags>,
  <StackMaps::ConstantOp>, <num deopt args>, [deopt args...],
  <StackMaps::ConstantOp>, <num gc pointers>, [gc pointers...],
  <StackMaps::ConstantOp>, <num gc allocas>,  [gc allocas...]
  <StackMaps::ConstantOp>, <num entries in gc map>, [base/derived indices...]

Changes are:
  - every gc pointer is listed only once in a flat length-prefixed list;
  - alloca list is prefixed with its length too;
  - following alloca list is length-prefixed list of base-derived
    indices of pointers from gc pointer list. Note that indices are
    logical (number of pointer), not absolute (index of machine operand).

Differential Revision: https://reviews.llvm.org/D87154
2020-10-06 17:40:29 +07:00
Alex Richardson 04f908b9f0 [libcxx][lit] Add support for custom ssh/scp flags in ssh.py
In our CHERI Jenkins CI we need to pass `-F <custom_config_file>` to each
ssh/scp command to set various arguments such as the localhost port, usage
of controlmaster, etc. to speed up connections to our emulated QEMU systems.

For our specific use-case I could have also added a single --ssh-config-file
argument that can be used for both the scp and ssh commands, but being able
to pass arbitrary extra flags for both commands seems more flexible.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D84097
2020-10-06 11:38:52 +01:00
David Spickett f0a78bdfdc [AArch64] Correct parameter type for unsigned Neon scalar shift intrinsics
In the following intrinsics the shift amount
(parameter 2) should be signed.

vqshlb_u8 vqshlh_u16  vqshls_u32  vqshld_u64
vqrshlb_u8 vqrshlh_u16 vqrshls_u32 vqrshld_u64
vshld_u64
vrshld_u64

See https://developer.arm.com/documentation/ihi0073/latest

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D88013
2020-10-06 11:34:58 +01:00
Sam McCall 3cb1220709 [clangd] Add `score` extension to workspace/symbol response.
The protocol doesn't really incorporate ranking.
As with code completion, most clients respect what the server sends, but
VSCode re-ranks items, with predictable results.
See https://github.com/clangd/vscode-clangd/issues/81

There's no filterText field so we may be unable to construct a good workaround.
But expose the score so we may be able to do this on the client in future.

Differential Revision: https://reviews.llvm.org/D88844
2020-10-06 11:57:38 +02:00
Paul Walker 27f3d51b4e [SVE] Lower fixed length vector fneg and fsqrt operations.
Also updates sve-fp.ll to use fneg directly.

Differential Revision: https://reviews.llvm.org/D88683
2020-10-06 10:48:16 +01:00
Paul Walker 8bb702a8ad [SVE] Lower fixed length vector floating point rounding operations.
Adds lowering for:
  llvm.ceil
  llvm.floor
  llvm.nearbyint
  llvm.rint
  llvm.round
  llvm.trunc

Differential Revision: https://reviews.llvm.org/D88671
2020-10-06 10:48:16 +01:00
Pushpinder Singh 3a12ff0dac [OpenMP][RTL] Remove dead code
RequiresDataSharing was always 0, resulting dead code in device runtime library.

Reviewed By: jdoerfert, JonChesterfield

Differential Revision: https://reviews.llvm.org/D88829
2020-10-06 05:43:47 -04:00
Tres Popp fe2bd543f5 [mlir] Add file to implement bufferization for shape ops.
This adds a shape-bufferize pass and implements the pattern for
shape.assuming.

Differential Revision: https://reviews.llvm.org/D88083
2020-10-06 11:35:16 +02:00
Dmitri Gribenko 80f66ac0d5 Revert "[llvm-objcopy][MachO] Add support for universal binaries"
This reverts commit 32c8435ef7. It fails
ASan, details in https://reviews.llvm.org/D88400.
2020-10-06 11:29:24 +02:00
Dmitri Gribenko 8ed7946a7d Revert "[llvm-objcopy][MachO] Add missing std::move."
This reverts commit 6e25586990. It depends
on 32c8435ef7, which I'm reverting due to
ASan failures. Details in https://reviews.llvm.org/D88400.
2020-10-06 11:28:55 +02:00
Mauri Mustonen cef0de5eb5 [VPlan] Add vplan native path vectorization test case for inner loop reduction
Regarding this bug I posted earlier: https://bugs.llvm.org/show_bug.cgi?id=47035

After reading through LLVM source code and getting familiar with VPlan I was able to vectorize the code using by enabling VPlan native path. After talking with @fhahn he suggested that I contribute this as a test case. So here it is. I tried to follow the available guides how to do this best I could. I modified IR code by hand to have more clear variable names instead of numbers.

One thing what I'd like to get input from someone is that is current CHECK lines sufficient enough to verify that the inner loop has been vectorized properly?

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D87564
2020-10-06 10:11:58 +01:00
Georgii Rymar f1ceaa200f [llvm-readobj/elf][test] - Stop using precompiled binaries in mips-got.test
This removed 2 last precompiled binaries from the mips-got.test.
YAML descriptions are used instead.

Differential revision: https://reviews.llvm.org/D88565
2020-10-06 12:04:44 +03:00
Haojian Wu 48a82c4245 [clangd] Verify the diagnostic code in include-fixer diagnostic tests, NFC.
Make it easier to spot which diagnostics in the include-fixer list are tested.

Differential Revision: https://reviews.llvm.org/D88828
2020-10-06 11:02:22 +02:00
Sebastian Neubauer 9fc535f987 [AMDGPU] Fix gcc warnings
uint8_t types are implicitly promoted to int, leading to a
unsigned-signed comparison.

Thanks for the heads-up @uabelho.

Differential Revision: https://reviews.llvm.org/D88876
2020-10-06 10:55:08 +02:00
George Mitenkov b81bedf714 [MLIR][SPIRVToLLVM] Conversion for composite extract and insert
A pattern to convert `spv.CompositeInsert` and `spv.CompositeExtract`.
In LLVM, there are 2 ops that correspond to each instruction depending
on the container type. If the container type is a vector type, then
the result of conversion is `llvm.insertelement` or `llvm.extractelement`.
If the container type is an aggregate type (i.e. struct, array), the
result of conversion is `llvm.insertvalue` or `llvm.extractvalue`.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D88205
2020-10-06 11:46:25 +03:00
Haojian Wu 77d3b14458 [clangd] Fix an inconsistent ReasonToReject enum usage, NFC. 2020-10-06 10:17:47 +02:00
Nicolas Vasilache 4a8c70c319 [mlir][Linalg] Reintroduced missing verification check
A verification check on the number of indexing maps seems to have dropped inadvertently. Also update the relevant roundtrip tests.
2020-10-06 07:59:59 +00:00
Andrzej Warzynski 25692b7765 [flang][NFC] Remove redundant `;`
Sadly this has been causing gcc-10 builds to fail.
2020-10-06 08:45:53 +01:00
Muhammad Omair Javaid 3dffec03b0 [LLDB] Add QEMU testing environment setup guide for SVE testing
This patch adds a HowTo document to lldb docs which gives instruction for
setting up a virtual environment based on QEMU emulator for LLDB testing.

Instruction in this document are tested on Arm and AArch64 targets but
can easily be duplicated for other targets supported by QEMU.

This helps test LLDB in absence for modern AArch64 features not released
in publicly available hardware till date.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D82064
2020-10-06 12:35:08 +05:00
Raphael Isemann ce4d15fe14 [lldb] Symlink the Clang resource directory to the LLDB build directory in standalone builds
When doing a standalone build (i.e., building just LLDB against an existing
LLVM/Clang installation), LLDB is currently unable to find any Clang resource
directory that contains all the builtin headers we need to parse real source
code. This causes several tests that actually parse source code on disk within
the expression parser to fail (most notably nearly all the import-std-module
tests).

The reason why LLDB can't find the resource directory is that we search based on
the path of the LLDB shared library path. We assumed that the Clang resource
directory is in the same prefix and has the same relative path to the LLDB
shared library (e.g., `../clang/10.0.0/include`). However for a standalone build
where the existing Clang can be anywhere on the disk, so we can't just rely on
the hardcoded relative paths to the LLDB shared library.

It seems we can either solve this by copying the resource directory to the LLDB
installation, symlinking it there or we pass the path to the Clang installation
to the code that is trying to find the resource directory. When building the
LLDB framework we currently copy the resource directory over to the framework
folder (this is why the import-std-module are not failing on the Green Dragon
standalone bot).

This patch symlinks the resource directory of Clang into the LLDB build
directory. The reason for that is simply that this is only needed when running
LLDB from the build directory. Once LLDB and Clang/LLVM are installed the
already existing logic can find the Clang resource directory by searching
relative to the LLDB shared library.

Reviewed By: kastiglione, JDevlieghere

Differential Revision: https://reviews.llvm.org/D88581
2020-10-06 09:28:39 +02:00
David Sherwood 4ed47d50ea [SVE][CodeGen] Fix DAGCombiner::ForwardStoreValueToDirectLoad for scalable vectors
In DAGCombiner::ForwardStoreValueToDirectLoad I have fixed up some
implicit casts from TypeSize -> uint64_t and replaced calls to
getVectorNumElements() with getVectorElementCount(). There are some
simple cases of forwarding that we can definitely support for
scalable vectors, i.e. when the store and load are both scalable
vectors and have the same size. I have added tests for the new
code paths here:

  CodeGen/AArch64/sve-forward-st-to-ld.ll

Differential Revision: https://reviews.llvm.org/D87098
2020-10-06 08:04:03 +01:00
Haojian Wu 70d9dc8674 [AST][RecoveryExpr] Support dependent binary operator in C for error recovery.
see the whole context in:  https://reviews.llvm.org/D85025

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D84226
2020-10-06 08:53:31 +02:00
Johannes Doerfert ee599bf2a9 [AttributeFuncs][FIX] Update new tests (D87304, D87306) after sret changes
Hopefully the last of these, apologies for the noise.
2020-10-06 00:12:18 -05:00
Max Kazantsev bbb0ee6e34 Revert "[SCEV] Prove implicaitons via AddRec start"
This reverts commit 69acdfe075.

Need to investigate reported miscompiles.
2020-10-06 11:40:14 +07:00
Johannes Doerfert 848342b333 [AttributeFuncs][FIX] Update new tests (D87304) after sret changes 2020-10-05 23:37:15 -05:00
Lang Hames 01baeda7ca [JITLink][ELF] Handle BSS sections, improve some error messages.
This patch enables basic BSS section handling, and improves a couple of error
messages in the ELF section parsing code.

Patch by Christian Schafmeister. Thanks Christian!

Differential Revision: https://reviews.llvm.org/D88867
2020-10-05 21:35:35 -07:00
Johannes Doerfert ef48436e62 [AttributeFuncs] Consider `noundef` in `typeIncompatible`
Drop `noundef` for return values that are replaced by void and make it
illegal to put `noundef` on a void value.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D87306
2020-10-05 23:23:06 -05:00
Johannes Doerfert 2a078c3072 [AttributeFuncs] Consider `align` in `typeIncompatible`
Alignment attributes need to be dropped for non-pointer values.
This also introduces a check into the verifier to ensure you don't use
`align` on anything but a pointer. Test needed to be adjusted
accordingly.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D87304
2020-10-05 23:23:05 -05:00
Serguei Katkov b988898013 [GVN LoadPRE] Extend the scope of optimization by using context to prove safety of speculation
Use context to prove that load can be safely executed at a point where load is being hoisted.

Postpone the decision about safety of speculative load execution till the moment we know
where we hoist load and check safety at that context.

Reviewers: nikic, fhahn, mkazantsev, lebedev.ri, efriedma, reames
Reviewed By: reames, mkazantsev
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D88725
2020-10-06 09:25:16 +07:00
Jonas Devlieghere f22496a9f4 [dotest] Simplify logic to find the Python path
Simplify the logic of parsing the lldb -P output to find the python
path. This removes the special handling for the LLDB.framework case and
instead of pattern matching known errors focus on finding a directory
path that contains an __init__.py.

Differential revision: https://reviews.llvm.org/D88840
2020-10-05 19:04:33 -07:00
Richard Smith ded79be635 [c++17] Implement P0145R3 during constant evaluation.
Ensure that we evaluate assignment and compound-assignment
right-to-left, and array subscripting left-to-right.

Fixes PR47724.
2020-10-05 19:04:14 -07:00
Richard Smith ebf6fd633e Make OpenMP tests less brittle in the face of changes in constant
evaluation diagnostics.
2020-10-05 19:04:14 -07:00
Arthur Eubanks d4e08c95e5 [NewPM] Set -enable-npm-optnone to true by default
This makes the NPM skip not required passes on functions marked optnone.

If this causes a pass that should be required but has not been marked
required to be skipped, add
`static bool isRequired() { return true; }`
to the pass class. AlwaysInlinerPass is an example.

clang/test/CodeGen/O0-no-skipped-passes.c is useful for checking that
no passes are skipped under -O0.

The -enable-npm-optnone option will be removed once this has been stable
for long enough without issues.

Reviewed By: ychen, asbirlea

Differential Revision: https://reviews.llvm.org/D87869
2020-10-05 18:42:32 -07:00
Mircea Trofin 36bb1fb1fe [MLInliner] Factor out logging
Factored out the logging facility, to allow its reuse outside the
inliner.

Differential Revision: https://reviews.llvm.org/D88770
2020-10-05 18:09:17 -07:00