Commit Graph

331355 Commits

Author SHA1 Message Date
Adrian Prantl de5417f81d [ValueObject] Upstream initialization from swift-lldb.
This is a non-Swift-specific change in swift-lldb that seems to be
useful for remote debugging. If does in fact turn out to be redundant
we can remove it from llvm.org and then it will disappear in
swift-lldb, too.
2019-11-05 12:36:14 -08:00
Jonas Devlieghere 2abcf44f4c [Reproducer] Add test case for expression evaluation 2019-11-05 12:33:21 -08:00
Benjamin Kramer 5f158d8e21 [X86] Gate select->fmin/fmax transform on NoSignedZeros instead of UnsafeFPMath 2019-11-05 21:28:41 +01:00
Fred Riss 42beb8ed79 TestBatchMode.py: add missing @skipIfRemote
All the tests in this file were already marked as skipped for remote tests
except for this one.
2019-11-05 12:22:59 -08:00
Fred Riss 270fe47aae testsuite: skipIfNoSBHeaders should skip when running remotely
The LLDB dylib/framework will not be available on the remote host, it makes
no sense to try to run those tests in a remote scenario.
2019-11-05 12:22:59 -08:00
Fred Riss 2ff545e76d Modernize add-dsym test Makefile 2019-11-05 12:22:59 -08:00
Julian Lettner d77ef856fc Revert "[lit] Better/earlier errors when no tests are executed"
This reverts commit d8f2bff751.
2019-11-05 12:10:43 -08:00
Stanislav Mekhanoshin f2e7679d0f [AMDGPU] Removed dead code from R600ISelLowering.cpp
This was added to inhibit a warning from gcc 7.3 according to
the comment. However, it triggers warning from PVS. In addition
I cannot reproduce it with gcc 7.4 and I also cannot reproduce
it with gcc 7.3 using compiler explorer.

Differential Revision: https://reviews.llvm.org/D69863
2019-11-05 12:02:48 -08:00
Philip Reames 027aa27d95 [X86/Atomics] (Semantically) revert G246098, switch back to the old atomic example
When writing an email for a follow up proposal, I realized one of the diffs in the committed change was incorrect.  Digging into it revealed that the fix is complicated enough to require some thought, so reverting in the meantime.

The problem is visible in this diff (from the revert):
 ; X64-SSE-LABEL: store_fp128:
 ; X64-SSE:       # %bb.0:
-; X64-SSE-NEXT:    movaps %xmm0, (%rdi)
+; X64-SSE-NEXT:    subq $24, %rsp
+; X64-SSE-NEXT:    .cfi_def_cfa_offset 32
+; X64-SSE-NEXT:    movaps %xmm0, (%rsp)
+; X64-SSE-NEXT:    movq (%rsp), %rsi
+; X64-SSE-NEXT:    movq {{[0-9]+}}(%rsp), %rdx
+; X64-SSE-NEXT:    callq __sync_lock_test_and_set_16
+; X64-SSE-NEXT:    addq $24, %rsp
+; X64-SSE-NEXT:    .cfi_def_cfa_offset 8
 ; X64-SSE-NEXT:    retq
   store atomic fp128 %v, fp128* %fptr unordered, align 16
   ret void

The problem here is three fold:
1) x86-64 doesn't guarantee atomicity of anything larger than 8 bytes.  Some platforms observably break this guarantee, others don't, but the codegen isn't considering this, so it's wrong on at least some platforms.
2) When I started to track down the problem, I discovered that DAGCombiner had stripped the atomicity off the store entirely.  This comes down to idiomatic usage of DAG.getStore passing all MMO components separately as opposed to just passing the MMO.
3) On x86 (not -64), there are cases where 8 byte atomiciy is supported, but only for floating point operations.  This would seem to imply that operation typing matters for correctness, and DAGCombine happily folds away bitcasts.  I'm not 100% sure there's a problem here, but I'm not entirely sure there isn't either.

I plan on returning to each issue in turn;  sorry for the churn here.
2019-11-05 11:24:27 -08:00
Michael Liao 0a220de9e9 [HIP] Fix visibility for 'extern' device variables.
Summary:
- Fix a bug which misses the change for a variable to be set with
  target-specific attributes.

Reviewers: yaxunl

Subscribers: jvesely, nhaehnle, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D63020
2019-11-05 14:19:32 -05:00
Sid Manning 6cd47f9dd7 [llvm-objdump] Fix spurious "The end of the file was unexpectedly encountered" if a SHT_NOBITS sh_offset is larger than the file size
llvm-objdump -D this file:

  int a[100000];
  int main() { return 0; }

Will produce an error: "The end of the file was unexpectedly encountered".

This happens because of a check in Binary.h checkOffset.  (Addr + Size > M.getBufferEnd()).

The sh_offset and sh_size fields can be ignored for SHT_NOBITS sections.
Fix the error by changing ELFObjectFile<ELFT>::getSectionContents to use
the file base for SHT_NOBITS sections.

Reviewed By: grimar, MaskRay

Differential Revision: https://reviews.llvm.org/D69192
2019-11-05 11:14:12 -08:00
Joel E. Denny f1b4c4bfd0 [lit] Fix `not` calling internal commands
Without this patch, when using lit's internal shell, if `not` on a lit
RUN line calls `env`, `diff`, or any of the other in-process shell
builtins that lit implements, lit accidentally searches for the latter
as an external executable.  What's worse is that works fine when a
developer is testing on a platform where those executables are
available and behave as expected, but it then breaks on other
platforms.

`not` seems useful for some builtins, such as `diff`, so this patch
supports such uses.  `not --crash` does not seem useful for builtins,
so this patch diagnoses such uses.  In all cases, this patch ensures
shell builtins are found behind any sequence of `env` and `not`
commands.

`not` calling `env` calling an external command appears useful when
the `env` and external command are part of a lit substitution, as in
D65156.  This patch supports that by looking through any sequence of
`env` and `not` commands, building the environment from the `env`s,
and storing the `not`s.  The `not`s are then added back to the command
line without the `env`s to execute externally.  This avoids the need
to replicate the `not` implementation, in particular the `--crash`
option, in lit.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D66531
2019-11-05 14:09:21 -05:00
Stanislav Mekhanoshin 4f12ba50bb [AMDGPU] Removed dead code handling M0CopyReg
Static analyzer complains about always false condition.
See https://bugs.llvm.org/show_bug.cgi?id=43886

Differential Revision: https://reviews.llvm.org/D69860
2019-11-05 11:05:13 -08:00
Adrian Prantl 3606b56784 ValueObject: Upstream early-exit from swift-lldb. (NFC) 2019-11-05 10:53:57 -08:00
Reid Kleckner 63f49465c3 [dexter] Fix feature tests on Windows
First, add LLD as a dependency on Windows. The windows batch scripts
pass -fuse-ld=lld, so they need it.

Second, decode builder stdout/stderr even if the command fails.
Otherwise it gets printed as b'line 1\n\rline 2\n\r'.

Last, make the batch script one line less noisy. We might want to try to
do more here, though. It would be nice if we could get as close to
possible as lit, where you can literally copy & paste the failing
command to re-run it.

With the two changes above, now the feature tests that use clang++.bat
pass for me. The clang-cl_vs2015 ones still fail, and I'll fix them
separately.

Reviewers: jmorse

Differential Revision: https://reviews.llvm.org/D69725
2019-11-05 10:49:57 -08:00
Reid Kleckner 7035ea6e3e [dexter] Remove lit check for python 3
This is checking the version of Python used to run lit, which is not
necessarily the same as the version used to run the dexter tests.  If
the tests are run via the build/bin/llvm-lit[.py] helper script, then
that is likely to pick up whatever version of Python is on PATH.
Conventionally, this will find Python 2. CMake already checks that
Python 3 is in use and puts the path to it in the lit site config, so
this check is redundant, and Python 3 will ultimately be used to run
dexter.

Reviewers: jmorse

Differential Revision: https://reviews.llvm.org/D69724
2019-11-05 10:49:56 -08:00
Benjamin Kramer 00e53d912d [X86] Specifically limit fmin/fmax commutativity to NoNaNs + NoSignedZeros
The backend UnsafeFPMath flag is not a superset of all the others, so
limit it to the exact bits needed.
2019-11-05 19:34:06 +01:00
Daniel Sanders e74c5b9661 [globalisel] Rename G_GEP to G_PTR_ADD
Summary:
G_GEP is rather poorly named. It's a simple pointer+scalar addition and
doesn't support any of the complexities of getelementptr. I therefore
propose that we rename it. There's a G_PTR_MASK so let's follow that
convention and go with G_PTR_ADD

Reviewers: volkan, aditya_nandakumar, bogner, rovka, arsenm

Subscribers: sdardis, jvesely, wdng, nhaehnle, hiraditya, jrtc27, atanasyan, arphaman, Petar.Avramovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69734
2019-11-05 10:31:17 -08:00
Stanislav Mekhanoshin de56a89072 [AMDGPU] return Fail instead of SolfFail from addOperand()
addOperand() method of AMDGPU disassembler returns SoftFail
on error. All instances which may lead to that place are
an impossible encdoing, not something which is possible to
encode, but semantically incorrect as described for SoftFail.

Then tablegen generates a check of the following form:

if (Decode...(..) == MCDisassembler::Fail) { return MCDisassembler::Fail; }

Since we can only return Success and SoftFail that is dead
code as detected by the static code analyzer.

Solution: return Fail as it should be.

See https://bugs.llvm.org/show_bug.cgi?id=43886

Differential Revision: https://reviews.llvm.org/D69819
2019-11-05 10:25:27 -08:00
Ilya Biryukov 87e0cb4f1a [clangd] Implement semantic highlightings via findExplicitReferences
Summary:
To keep the logic of finding locations of interesting AST nodes in one
place.

The advantage is better coverage of various AST nodes, both now and in
the future: as new nodes get added to `findExplicitReferences`, semantic
highlighting will automatically pick them up.

The drawback of this change is that we have to traverse declarations
inside our file twice in order to highlight dependent names, 'auto'
and 'decltype'. Hopefully, this should not affect the actual latency
too much, most time should be spent in building the AST and not
traversing it.

Reviewers: hokein

Reviewed By: hokein

Subscribers: nridge, merge_guards_bot, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69673
2019-11-05 19:15:24 +01:00
Jonas Devlieghere a9970036d4 [lldb] Fix Python 3 incompatibility in API/lit.cfg.py
This code path is only taken on the sanitized bot, where it caused a
TypeError: "Can't mix strings and bytes in path components".
2019-11-05 10:13:01 -08:00
Michael Liao 15140e4bac [hip] Enable pointer argument lowering through coercing type.
Reviewers: tra, rjmccall, yaxunl

Subscribers: jvesely, nhaehnle, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69826
2019-11-05 13:05:05 -05:00
Sergey Dmitriev 82588e05cc [SLP] - Add couple safety checks to TreeEntry::dump(). NFC
Summary: Check for MainOp and AltOp for NULL before dereferencing or issue NULL.

Reviewers: Vasilis, dtemirbulatov, RKSimon, ABataev

Reviewed By: ABataev

Subscribers: mehdi_amini, hiraditya, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69812
2019-11-05 09:57:30 -08:00
Daniel Sanders 312932a334 [globalisel][docs] Add KnownBits Analysis documentation
Summary:
This is largely based off of the slides from the keynote

Depends on D69545

Reviewers: volkan, rovka, arsenm

Subscribers: wdng, arphaman, Petar.Avramovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69644
2019-11-05 09:55:33 -08:00
Kazu Hirata 893afb9ca1 [JumpThreading] Factor out code to merge basic blocks (NFC)
Summary:
This patch factors out code to merge a basic block with its sole
successor -- partly for readability and partly to facilitate an
upcoming patch of my own.

Reviewers: wmi

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69852
2019-11-05 09:46:57 -08:00
Steven Wu e64f7bfefe Revert "[Object][MachO] Rewrite macho-invalid-fat-arch-size into YAML"
The invalid binary trying to construct triggers an assertion.
2019-11-05 09:34:26 -08:00
Simon Pilgrim 117e6dd6cc Remove redundant assignment. NFCI.
Fixes cppcheck warning.
2019-11-05 17:08:08 +00:00
Simon Pilgrim 76166a1ac7 Use iterator prefix increment. NFCI. 2019-11-05 17:08:08 +00:00
Simon Pilgrim 7ad2583613 [MachineOutliner] Reduce scope of variable and stop duplicate getMF() calls. NFCI. 2019-11-05 17:08:08 +00:00
Steven Wu bc496677d0 [Object][MachO] Rewrite macho-invalid-fat-arch-size into YAML
Rewrite one of the invalid macho test input file with YAML file. The
original invalid macho is breaking our internal test infrastusture
because it is too broken to be copy around.

rdar://problem/56879982
2019-11-05 09:07:06 -08:00
Fangrui Song 5ad0103d8a [llvm-objcopy][ELF] Implement --only-keep-debug
--only-keep-debug produces a debug file as the output that only
preserves contents of sections useful for debugging purposes (the
binutils implementation preserves SHT_NOTE and non-SHF_ALLOC sections),
by changing their section types to SHT_NOBITS and rewritting file
offsets.

See https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html

The intended use case is:

```
llvm-objcopy --only-keep-debug a a.dbg
llvm-objcopy --strip-debug a b
llvm-objcopy --add-gnu-debuglink=a.dbg b
```

The current layout algorithm is incapable of deleting contents and
shrinking segments, so it is not suitable for implementing the
functionality.

This patch adds a new algorithm which assigns sh_offset to sections
first, then modifies p_offset/p_filesz of program headers. It bears a
resemblance to lld/ELF/Writer.cpp.

Reviewed By: jhenderson, jakehehrlich

Differential Revision: https://reviews.llvm.org/D67137
2019-11-05 08:56:15 -08:00
Fangrui Song ade55d0787 [llvm-objcopy][ELF] Add OriginalType & OriginalFlags
`llvm::objcopy:🧝:*Section::classof` matches Type and Flags, yet Type
and Flags are mutable (by setSectionFlagsAndTypes and upcoming
--only-keep-debug feature). Add OriginalType & OriginalFlags to be used
in classof, to prevent classof results from changing.

Reviewed By: jakehehrlich, jhenderson, alexshap

Differential Revision: https://reviews.llvm.org/D69739
2019-11-05 08:40:39 -08:00
David Green 03bf229bd4 [ARM] Multi-vector MVE spill test
This is a test from D67169, that can now be added after the vld2
intrinsics were committed upstream.
2019-11-05 16:17:25 +00:00
Michał Górny df3ae1eb29 [lldb] [Python] Build readline override module only on Linux
Restrict building the readline override to Linux only.  It both does not
build on *BSD systems, and is largely irrelevant since they default to
using libedit over readline anyway.  This restores the behavior
of the old readline override that also was built only on Linux.

Differential Revision: https://reviews.llvm.org/D69846
2019-11-05 17:07:59 +01:00
jmolloy 39525a6723 [DFAPacketizer] Allow up to 64 functional units
Summary:
To drive the automaton we used a uint64_t as an action type. This
contained the transition's resource requirements as a conjunction:

  (a OR b) AND (b OR c)

We encoded this conjunction as a sequence of four 16-bit bitmasks.
This limited the number of addressable functional units to 16, which
is quite low and has bitten many people in the past.

Instead, the DFAEmitter now generates a lookup table from InstrItinerary
class (index of the ItinData inside the ProcItineraries) to an internal
action index which is essentially a dense embedding of the conjunctive
form. Because we never materialize the conjunctive form, we no longer
have the 16 FU restriction.

In this patch we limit to 64 functional units due to using a uint64_t
bitmask in the DFAEmitter. Now that we've decoupled these representations
we can increase this in future.

Reviewers: ThomasRaoux, kparzysz, majnemer

Reviewed By: ThomasRaoux

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69110
2019-11-05 15:41:42 +00:00
Alexey Bataev 7b710a4294 [OPENMP]Improve diagnostics for unsupported unified addressing.
Improved diagnostics for better user experience.
2019-11-05 10:31:59 -05:00
Gil Rapaport 100e797adb [LV] Apply sink-after & interleave-groups as VPlan transformations (NFC)
This recommits 2be17087f8 (reverted in
d3ec06d219 for heap-use-after-free) with a fix
in IAI's reset() which was not clearing the set of interleave groups after
deleting them.
2019-11-05 17:29:13 +02:00
Simon Pilgrim 95a25d8883 Fix uninitialized variable warning. NFCI. 2019-11-05 15:15:14 +00:00
Simon Pilgrim dec21e4451 [MCObjectFileInfo] Fix uninitialized variable warnings. NFCI. 2019-11-05 15:15:14 +00:00
Simon Pilgrim c7f127d93f [MachineOutliner] Fix uninitialized variable warnings. NFCI. 2019-11-05 15:15:14 +00:00
Alexey Bataev 642916adc9 [OPENMP][DOCS]Fix coloring of the implemented features status, NFC. 2019-11-05 10:13:58 -05:00
Francis Visoiu Mistrih 47d1029788 [ObjC][ARC] Ignore lifetime markers between *ReturnValue calls
When eliminating a pair of

`llvm.objc.autoreleaseReturnValue`

followed by

`llvm.objc.retainAutoreleasedReturnValue`

we need to make sure that the instructions in between are safe to
ignore.

Other than bitcasts and useless GEPs, it's also safe to ignore lifetime
markers for both static allocas (lifetime.start/lifetime.end) and dynamic
allocas (stacksave/stackrestore).

These get added by the inliner as part of the return sequence and can
prevent the transformation from happening in practice.

Differential Revision: https://reviews.llvm.org/D69833
2019-11-05 06:39:22 -08:00
Francis Visoiu Mistrih 68f39de042 [NFC][ObjC][ARC] Add tests for OptimizeRetainRVCall
Add tests for bitcasts + zero GEPs, and pre-commit tests for lifetime
markers.
2019-11-05 06:39:22 -08:00
Kazu Hirata 0016c1f400 [JumpThreading] Factor out common code to update the SSA form (NFC)
Summary:
This patch factors out common code to update the SSA form in
JumpThreading.cpp -- partly for readability and partly to facilitate
an coming patch of my own.

Reviewers: wmi

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69811
2019-11-05 06:15:44 -08:00
Simon Pilgrim 77debf51ab [GVN] Fix uninitialized variable warnings. NFCI. 2019-11-05 14:10:32 +00:00
Simon Pilgrim 1842fe6be3 Add missing GVN =operator. NFCI.
Fixes PVS Studio warning that the 'ValueTable' class implements a copy constructor, but lacks the '=' operator.
2019-11-05 13:41:50 +00:00
Sanjay Patel 3ce0c78501 [InstCombine] add tests for shift-logic-shift; NFC
This is based on existing CodeGen test files for x86 and AArch64.
The corresponding potential transform is shown in:
rL370617
2019-11-05 08:18:50 -05:00
serge-sans-paille d590498829 [lldb] Fix readline/libedit compat patch for py2
This is a follow-up to https://reviews.llvm.org/D69793
2019-11-05 14:16:39 +01:00
Dávid Bolvanský 9f294fc497 [AtomicExpandPass] Silence static analyzer warnings about operator priority. NFCI. 2019-11-05 13:55:46 +01:00
David Green f01b9aa89e [MachineScheduler] Enable AA in PostRA Machine scheduler
This adds AA to Post-RA Machine Scheduling, allowing the pass more
freedom when handling memory operations.

My understanding is that this was just never done, not that it is
inherently incorrect to do so. The older PostRA List scheduler already
makes use of AA, it's just that the MI PostRA Scheduler was never taught
to use it.

Differential Revision: https://reviews.llvm.org/D69814
2019-11-05 11:58:50 +00:00