Commit Graph

364101 Commits

Author SHA1 Message Date
Luboš Luňák dcd4589a0d [lldb][gui] use left/right in the source view to scroll
I intentionally decided not to reset the column automatically
anywhere, because I don't know where and if at all that should happen.
There should be always an indication of being scrolled (too much)
to the right, so I'll leave this to whoever has an opinion.

Differential Revision: https://reviews.llvm.org/D85290
2020-08-18 13:25:01 +02:00
Alex Zinenko 74f577845e [mlir] expose standard types to C API
Provide C API for MLIR standard types. Since standard types live under lib/IR
in core MLIR, place the C APIs in the IR library as well (standard ops will go
into a separate library). This also defines a placeholder for affine maps that
are necessary to construct a memref, but are not yet exposed to the C API.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D86094
2020-08-18 13:11:37 +02:00
Paul Walker 9f63dc3265 [SVE] Fix shift-by-imm patterns used by asr, lsl & lsr intrinsics.
Right shift patterns will no longer incorrectly accept a shift
amount of zero.  At the same time they will allow larger shift
amounts that are now saturated to their upper bound.

Patterns have been extended to enable immediate forms for shifts
taking an arbitrary predicate.

This patch also unifies the code path for immediate parsing so the
i64 based shifts are no longer treated specially.

Differential Revision: https://reviews.llvm.org/D86084
2020-08-18 11:41:26 +01:00
Sam Parker 5eb705d5dc [NFC] Add some more Arm tests for IndVarSimplify
Copy some generic functions and apply minsize for arm.
2020-08-18 11:24:35 +01:00
Paul Walker cb5cc47a65 [SVE] Lower fixed length vector ISD::SPLAT_VECTOR operations.
Also strengthens the CHECK lines for scalable vector splat tests.

Differential Revision: https://reviews.llvm.org/D86070
2020-08-18 11:19:43 +01:00
Simon Pilgrim d2057a8015 [X86][AVX] Lower v16i8/v8i16 binary shuffles using VTRUNC/TRUNCATE
This patch adds lowerShuffleWithVTRUNC to handle basic binary shuffles that can be lowered either as a pure ISD::TRUNCATE or a X86ISD::VTRUNC (with undef/zero values in the remaining upper elements).

We concat the binary sources together into a single 256-bit source vector. To avoid regressions we perform this after we've tried to lower with PACKS/PACKUS which typically does a cleaner job than a concat.

For non-AVX512VL cases we have to canonicalize VTRUNC cases to use a 512-bit source vectors (inserting undefs/zeros in the upper elements as necessary), truncate and then (possibly) extract the 128-bit result.

This should address the last regressions in D66004

Differential Revision: https://reviews.llvm.org/D86093
2020-08-18 11:11:58 +01:00
sameeran joshi eaff200429 [Flang] Move markdown files(.MD) from documentation/ to docs/
Summary:
Other LLVM sub-projects use docs/ folder for documentation files.
Follow LLVM project policy.
Modify `documentation/` references in sources to `docs/`.
This patch doesn't modify files to reStructuredText(.rst) file format.

Reviewed By: DavidTruby, sscalpone

Differential Revision: https://reviews.llvm.org/D85884
2020-08-18 15:14:15 +05:30
QingShan Zhang 9b32ef9413 [Test][NFC] Add a new test to verify if scheduler can cluster two ld/st
even with different preds
2020-08-18 09:42:15 +00:00
Rainer Orth 13080ca1f0 [compiler-rt][test] XFAIL two tests on 32-bit sparc
Two tests `FAIL` on 32-bit sparc:

  Profile-sparc :: Posix/instrprof-gcov-parallel.test
  UBSan-Standalone-sparc :: TestCases/Float/cast-overflow.cpp

The failure mode is similar:

  Undefined                       first referenced
   symbol                             in file
  __atomic_store_4                    /var/tmp/instrprof-gcov-parallel-6afe8d.o
  __atomic_load_4                     /var/tmp/instrprof-gcov-parallel-6afe8d.o

  Undefined                       first referenced
   symbol                             in file
  __atomic_load_1                     /var/tmp/cast-overflow-72a808.o

This is a known bug: `clang` doesn't inline atomics on 32-bit sparc, unlike
`gcc`.

The patch therefore `XFAIL`s the tests.

Tested on `sparcv9-sun-solaris2.11` and `amd64-pc-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D85346
2020-08-18 11:32:51 +02:00
LLVM GN Syncbot b246bea921 [gn build] Port 00d7b7d014 2020-08-18 09:10:43 +00:00
Shinji Okumura 5e361e2aa4 [Attributor] Deduce noundef attribute
This patch introduces a new abstract attribute `AANoUndef` which corresponds to `noundef` IR attribute and deduce them.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D85184
2020-08-18 18:05:54 +09:00
Georgii Rymar 6786b3e307 [llvm-readobj/elf] - Refine the malformed-pt-dynamic.test.
This is splitted out from D85519, but significantly reworked.

Changes:
1) This test was changed to stop using python.
2) Use NoHeaders: true instead of `llvm-objcopy --strip-sections`.
3) Test llvm-readelf too (not just llvm-readobj).
4) Simplify the YAML used a bit (e.g. remove PT_LOAD).
5) Test 2 different cases: objects with section header table and without.

Differential revision: https://reviews.llvm.org/D86073
2020-08-18 11:51:03 +03:00
Georgii Rymar b475eca1ed [llvm-readobj/elf] - Merge mips-got-overlapped.test to mips-got.test and refine testing.
The `mips-got-overlapped.test` was introduced in D16968 and its intention is
to check that when there is an empty section at the same address as `.got`,
then we are able to locate `.got` and dump it.

The issue is that this test does not test llvm-readelf and uses a precompiled
object. This path starts using YAML instead and merges
mips-got-overlapped.test to mips-got.test.

Differential revision: https://reviews.llvm.org/D86080
2020-08-18 11:37:34 +03:00
Alex Zinenko 674f2df4fe [mlir] Fix printing of unranked memrefs in non-default memory space
The type printer was ignoring the memory space on unranked memrefs.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D86096
2020-08-18 09:32:35 +02:00
Jakub Lichman a4b8c2de1d [mlir] VectorToSCF bug in setAllocAtFunctionEntry fixed.
The function makes too strong assumption regarding parent FuncOp
which gets broken when FuncOp is first lowered to llvm function.
In this fix we generalize the assumption to allocation scope and
add assertion to produce user friendly message in case our assumption
is broken.

Differential Revision: https://reviews.llvm.org/D86086
2020-08-18 07:12:40 +00:00
Nathan Ridge e33ec9d904 [clangd] Target member of dependent base made visible via a using-decl
Fixes https://github.com/clangd/clangd/issues/307

Differential Revision: https://reviews.llvm.org/D86047
2020-08-18 03:03:49 -04:00
David Blaikie be3ef93bf5 PR44685: DebugInfo: Handle address-use-invalid type units referencing non-type units
Theory was that we should never reach a non-type unit (eg: type in an
anonymous namespace) when we're already in the invalid "encountered an
address-use, so stop emitting types for now, until we throw out the
whole type tree to restart emitting in non-type unit" state. But that's
not the case (prior commit cleaned up one reason this wasn't exposed
sooner - but also makes it easier to test/demonstrate this issue)
2020-08-17 21:42:00 -07:00
David Blaikie 24c3dabef4 DebugInfo: Emit class template parameters first, before members
This reads more like what you'd expect the DWARF to look like (from the
lexical order of C++ - template parameters come before members, etc),
and also happens to make it easier to tickle (& thus test) a bug related
to type units and Split DWARF I'm about to fix.
2020-08-17 21:42:00 -07:00
Johannes Doerfert 8abd69aa9e [Attributor] Bail early if AAMemoryLocation cannot derive anything
Before this change we looked through all memory operations in a function
even if the first was an unknown call that could do anything. This did
cost a lot of time but there is little use to do so. We also avoid
creating AAs for things that we would have looked at in case no other AA
will; that is the reason for the test changes.

Running only the attributor-cgscc pass on a IR version of
`llvm-test-suite/MultiSource/Applications/SPASS/clause.c` reduced the
time we spend in `AAMemoryLocation::update` from 4% total to
0.9% (disclaimer: no accurate measurements).
2020-08-17 23:36:36 -05:00
Johannes Doerfert 1d99c3d707 [Attributor] We (should) keep the CG updated so we can mark it as preserved 2020-08-17 23:36:36 -05:00
Johannes Doerfert 858c75f7d1 [Attributor][NFC] Directly return proper type to avoid casts 2020-08-17 23:36:36 -05:00
Johannes Doerfert b27bdf955a [Attributor][FIX] Handle function pointers properly in AANonNull
Before we tired to create a dominator tree for a declaration when we
wanted to determine if the function pointer is `nonnull`. We now avoid
looking at global values if `Value::getPointerDereferenceableBytes` not
already determined `nonnull`.
2020-08-17 23:36:35 -05:00
Nathan Ridge 00d7b7d014 [clang] Fix visitation of ConceptSpecializationExpr in constrained-parameter
Summary: RecursiveASTVisitor needs to traverse TypeConstraint::ImmediatelyDeclaredConstraint

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D84136
2020-08-18 00:32:34 -04:00
Nathan Ridge 15673d748a [clangd] Index refs to main-file symbols as well
Summary: This will be needed to support call hierarchy

Reviewers: kadircet

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D83536
2020-08-18 00:30:07 -04:00
Harmen Stoppels a52173a3e5 Use find_library for ncurses
Currently it is hard to avoid having LLVM link to the system install of
ncurses, since it uses check_library_exists to find e.g. libtinfo and
not find_library or find_package.

With this change the ncurses lib is found with find_library, which also
considers CMAKE_PREFIX_PATH. This solves an issue for the spack package
manager, where we want to use the zlib installed by spack, and spack
provides the CMAKE_PREFIX_PATH for it.

This is a similar change as https://reviews.llvm.org/D79219, which just
landed in master.

Differential revision: https://reviews.llvm.org/D85820
2020-08-17 19:52:52 -07:00
Amy Kwan c7ec3a7e33 [PowerPC] Implement Vector Extract Mask builtins in LLVM/Clang
This patch implements the vec_extractm function prototypes in altivec.h in
order to utilize the vector extract with mask instructions introduced in Power10.

Differential Revision: https://reviews.llvm.org/D82675
2020-08-17 21:14:17 -05:00
Arthur Eubanks 2af4c2b2b1 [NewPM] Pin various tests under Other/ to legacy PM
These all are legacy PM-specific or have a corresponding NPM RUN line.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D86124
2020-08-17 18:58:08 -07:00
Hamilton Tobon Mosquera 496f8e5b36 [OpenMPOpt][HideMemTransfersLatency] Split __tgt_target_data_begin_mapper into its "issue" and "wait" counterparts.
WIP that tries to hide the latency of runtime calls that involve host to
device memory transfers by splitting them into their "issue" and "wait"
versions. The "issue" is moved upwards as much as possible. The "wait" is
moved downards as much as possible. The "issue" issues the memory transfer
asynchronously, returning a handle. The "wait" waits in the returned
handle for the memory transfer to finish. We still lack of the movement.
2020-08-17 20:56:10 -05:00
Leonard Chan 1454018dc1 Revert "[libc++] Use CMake interface targets to setup benchmark flags"
This reverts commit da0592e4c8.

Reverting because this is incompatible with cmake 3.13.5, with the
minimum supported version being 3.13.4.

See https://luci-milo.appspot.com/p/fuchsia/builders/ci/clang-linux-x64/b8871967816877544224.
2020-08-17 18:11:56 -07:00
Hongtao Yu de0c7a044b [llvm-objdump] Attempt to fix html doc generation issue.
https://reviews.llvm.org/D84191 caused a html doc build issue with the changes in `llvm-objdump.rst`. It looks like a blank line is missing from the `code-block` directives.

Test Plan:

Differential Revision: https://reviews.llvm.org/D86123
2020-08-17 18:06:22 -07:00
Aditya Kumar 370330f084 NFC: [GVNHoist] Outline functions from the class
Reviewers: sebpop
Reviewed By: hiraditya

Differential Revision: https://reviews.llvm.org/D86032
2020-08-17 17:40:04 -07:00
Craig Topper b673dfbb9a [X86] When manually creating intrinsic nodes in X86ISelLowering, make sure we use getTargetConstant and pointer type for the intrinsic ID.
Doesn't really matter in practice but that's how the nodes are
normally created by SelectionDAGBuilder. So we should match.

Found by temporarily hacking type checks into isel table.
2020-08-17 17:25:53 -07:00
Craig Topper 2ffa5d218f [X86] Rename INTR_TYPE_4OP to INTR_TYPE_4OP_IMM8 and truncate immediates to MVT::i8
This makes sure VPTERNLOG is generated with MVT::i8 immediate
as its SDNode declaration in X86InstrFragmentsSIMD.td declares.
2020-08-17 17:25:52 -07:00
Craig Topper bc244f08cf [X86] Truncate immediate to i8 for INTR_TYPE_3OP_IMM8
This is used for DBPSADBW which has a i32 immediate for its
intrinsic and an i8 immediate in tablegen isel patterns.
2020-08-17 17:25:51 -07:00
Craig Topper ab7151f1cf [X86] Make PreprocessISelDAG create X86ISD::VRNDSCALE nodes with i32 constants instead of i8.
This is the type declared in X86InstrFragmentsSIMD.td. ISel pattern
matching doesn't check so it doesn't matter in practice. Maybe for
SelectionDAG CSE it would matter.
2020-08-17 17:25:51 -07:00
Mehdi Amini d0e2c79b61 Fix method name to start with lower case to match style guide (NFC) 2020-08-18 00:19:22 +00:00
Mircea Trofin 62fc44ca3c [MLInliner] In development mode, obtain the output specs from a file
Different training algorithms may produce models that, besides the main
policy output (i.e. inline/don't inline), produce additional outputs
that are necessary for the next training stage. To facilitate this, in
development mode, we require the training policy infrastructure produce
a description of the outputs that are interesting to it, in the form of
a JSON file. We special-case the first entry in the JSON file as the
inlining decision - we care about its value, so we can guide inlining
during training - but treat the rest as opaque data that we just copy
over to the training log.

Differential Revision: https://reviews.llvm.org/D85674
2020-08-17 16:56:47 -07:00
Hongtao Yu 819b2d9c79 [llvm-objdump] Symbolize binary addresses for low-noisy asm diff.
When diffing disassembly dump of two binaries, I see lots of noises from mismatched jump target addresses and global data references, which unnecessarily causes diffs on every function, making it impractical. I'm trying to symbolize the raw binary addresses to minimize the diff noise.
In this change, a local branch target is modeled as a label and the branch target operand will simply be printed as a label. Local labels are collected by a separate pre-decoding pass beforehand. A global data memory operand will be printed as a global symbol instead of the raw data address. Unfortunately, due to the way the disassembler is set up and to be less intrusive, a global symbol is always printed as the last operand of a memory access instruction. This is less than ideal but is probably acceptable from checking code quality point of view since on most targets an instruction can have at most one memory operand.

So far only the X86 disassemblers are supported.

Test Plan:

llvm-objdump -d  --x86-asm-syntax=intel --no-show-raw-insn --no-leading-addr :
```
Disassembly of section .text:

<_start>:
               	push	rax
               	mov	dword ptr [rsp + 4], 0
               	mov	dword ptr [rsp], 0
               	mov	eax, dword ptr [rsp]
               	cmp	eax, dword ptr [rip + 4112]  # 202182 <g>
               	jge	0x20117e <_start+0x25>
               	call	0x201158 <foo>
               	inc	dword ptr [rsp]
               	jmp	0x201169 <_start+0x10>
               	xor	eax, eax
               	pop	rcx
               	ret
```

llvm-objdump -d  **--symbolize-operands** --x86-asm-syntax=intel --no-show-raw-insn --no-leading-addr :
```
Disassembly of section .text:

<_start>:
               	push	rax
               	mov	dword ptr [rsp + 4], 0
               	mov	dword ptr [rsp], 0
<L1>:
               	mov	eax, dword ptr [rsp]
               	cmp	eax, dword ptr  <g>
               	jge	 <L0>
               	call	 <foo>
               	inc	dword ptr [rsp]
               	jmp	 <L1>
<L0>:
               	xor	eax, eax
               	pop	rcx
               	ret
```

Note that the jump instructions like `jge 0x20117e <_start+0x25>` without this work is printed as a real target address and an offset from the leading symbol. With a change in the optimizer that adds/deletes an instruction, the address and offset may shift for targets placed after the instruction. This will be a problem when diffing the disassembly from two optimizers where there are unnecessary false positives due to such branch target address changes. With `--symbolize-operand`, a label is printed for a branch target instead to reduce the false positives. Similarly, the disassemble of PC-relative global variable references is also prone to instruction insertion/deletion.

Reviewed By: jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D84191
2020-08-17 16:55:12 -07:00
Johannes Doerfert 19bd4ef157 [Attributor] Properly use the call site argument position 2020-08-17 18:21:09 -05:00
Johannes Doerfert 5dfc207c53 [Attributor][FIX] Do not request an AANonNull for non-pointer types 2020-08-17 18:21:08 -05:00
Hamilton Tobon Mosquera ad03d0647f [OpenMPOpt][HideMemTransfersLatency] Update regression test with new runtime calls. 2020-08-17 18:16:16 -05:00
Kazushi (Jam) Marukawa 68cb29eff1 [VE] Modify ISelLoweirng following clang-tidy
Modify case style of function names following clang-tidy.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D86076
2020-08-18 07:43:19 +09:00
Roman Lebedev 790878f291
[NFC][clang] Adjust test/CodeGenCXX/nrvo.cpp after 03127f795b 2020-08-18 00:57:35 +03:00
Roman Lebedev 03127f795b
[InstCombine] PHI-aware aggregate reconstruction: correctly detect "use" basic block
While the original implementation added in D85787 / ae7f08812e
is not incorrect, it is known to be suboptimal.

In particular, it is not incorrect to use the basic block
in which the original `insertvalue` instruction is located
as the merge point, that is not necessarily optimal,
as `@test6` shows.

We should look at all the AggElts, and, if they are all defined
in the same basic block, then that is the basic block we should use.

On RawSpeed library, this catches +4% (+50) more cases.
On vanilla LLVM test-suits, this catches +12% (+92) more cases.
2020-08-18 00:45:18 +03:00
Roman Lebedev f4f673e0e3
[NFC][InstCombine] PHI-aware aggregate reconstruction: don't capture UseBB in lambdas, take it as argument
In a following patch, UseBB will be detected later,
so capturing it is potentially error-prone (capture by ref vs by val).

Also, parametrized UseBB will likely be needed
for multiple levels of PHI indirections later on anyways.
2020-08-18 00:45:18 +03:00
Roman Lebedev 4973ca3eac
[NFC][InstCombine] PHI-aware aggregate reconstruction: insert PHI node manually
This is NFC at the moment, because right now we always insert the PHI
into the same basic block in which the original `insertvalue` instruction
is, but that will change.

Also, fixes addition of the suffix to the value names.
2020-08-18 00:45:17 +03:00
Roman Lebedev 4791cbdaf9
[NFC][InstCombine] Add more tests for aggregate reconstruction w/ PHI handling
Even without handling several layers of PHI nodes,
we can handle more cases, as `@test6` shows.
2020-08-18 00:45:17 +03:00
Adrian Prantl a1a3b86910 Convert to early exit (NFC) 2020-08-17 14:42:25 -07:00
Adrian Prantl fc1464c6df Simplify error reporting (NFC) 2020-08-17 14:42:25 -07:00
Adrian Prantl a615ec9a1b Convert if cascade to switch (NFC) 2020-08-17 14:42:25 -07:00