Commit Graph

258253 Commits

Author SHA1 Message Date
Karl-Johan Karlsson bb6cf7378f [TableGen] Make CodeGenMapTable understand the namespace field of an instruction
Do not force the backends to use target name as namespace.

Original patch by Mattias Eriksson

Reviewers: stoklund, craig.topper

Reviewed By: stoklund

Subscribers: materi, llvm-commits

Differential Revision: https://reviews.llvm.org/D31322

llvm-svn: 298834
2017-03-27 07:13:44 +00:00
Dean Michael Berris 1dcec25487 [XRay][compiler-rt] Use sanitizer_common's atomic ops
Instead of std::atomic APIs for atomic operations, we instead use APIs
include with sanitizer_common. This allows us to, at runtime, not have
to depend on potentially dynamically provided implementations of these
atomic operations.

Fixes http://llvm.org/PR32274.

llvm-svn: 298833
2017-03-27 07:13:35 +00:00
Marshall Clow d3ecc0db44 Mark *fail tests as UNUSUPPORTED instead of XFAIL on old compilers
llvm-svn: 298832
2017-03-27 06:31:58 +00:00
Craig Topper 1dd20e6544 [IR] Implement pairs of non-const and const methods using the const version instead of the non-const version. NFCI
This removes a const_cast of the this pointer.

llvm-svn: 298831
2017-03-27 05:47:03 +00:00
Craig Topper 1c78f4a0ff [IR] Share implementation for pairs of const and non-const methods using const_cast. NFCI
llvm-svn: 298830
2017-03-27 05:46:58 +00:00
Rui Ueyama 70c8efd03c Sort.
llvm-svn: 298829
2017-03-27 03:42:55 +00:00
Rui Ueyama ceb5bd59cc Simplify. NFC.
This patch calls getAddend on a relocation only when the relocation is RELA.
That doesn't really improve runtime performance but should improve
readability as the code now matches the function description.

llvm-svn: 298828
2017-03-27 03:41:00 +00:00
Craig Topper 74fb7ac2e0 [IR] Share implementation of pairs of const and non-const methods in BasicBlock using the const version instead of the non-const version
Summary:
During post-commit review of a previous change I made it was pointed out that const casting 'this' is technically a bad practice. This patch re-implements all of the methods in BasicBlock that do this to use the const BasicBlock version and const_cast the return value instead.

I think there are still many other classes that do similar things. I may look at more in the future.

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31377

llvm-svn: 298827
2017-03-27 02:38:17 +00:00
Craig Topper 224b19d626 [IR] Make Instruction::isAssociative method inline. Add LLVM_READONLY to the static version.
llvm-svn: 298826
2017-03-26 23:23:29 +00:00
Davide Italiano a2c4e4b929 [Target] Remove some code probably copy/pasted from another backend.
llvm-svn: 298825
2017-03-26 21:45:04 +00:00
Vassil Vassilev 3b7a6f9be6 Revert r298742 "[ODRHash] Add error messages for mismatched parameters in methods."
I failed to revert this in r298816.

llvm-svn: 298824
2017-03-26 21:39:16 +00:00
Davide Italiano 5c2aa5d3e4 [MachineScheduler] Reference the correct header.
llvm-svn: 298823
2017-03-26 21:27:21 +00:00
Kuba Mracek 0b16ae5090 [asan] Remove column numbers from test expectations in invalid-pointer-pairs.cc
This is failing on some of our internal bots because we're using different symbolizers. It doesn't seem important and we never test for column numbers in any other tests, so let's just remove it.

Differential Revision: https://reviews.llvm.org/D30122

llvm-svn: 298822
2017-03-26 21:20:42 +00:00
Rui Ueyama 4c6dfbdc20 Factor out code to add a GOT entry.
llvm-svn: 298821
2017-03-26 21:00:09 +00:00
Kuba Mracek a1737293fc [tsan] Only Acquire/Release GCD queues if they're not NULL
While it's usually a bug to call GCD APIs, such as dispatch_after, with NULL as a queue, this often "somehow" works and TSan should maintain binary compatibility with existing code. This patch makes sure we don't try to call Acquire and Release on NULL queues, and add one such testcase for dispatch_after.

Differential Revision: https://reviews.llvm.org/D31355

llvm-svn: 298820
2017-03-26 20:59:23 +00:00
Sanjoy Das e4b073a4e8 Fix typo in comment; NFC
llvm-svn: 298819
2017-03-26 20:56:25 +00:00
Rui Ueyama 37c3c2d0ca Factor out common code.
llvm-svn: 298818
2017-03-26 20:51:14 +00:00
Rui Ueyama a2f63f1471 Remove MIPS-specific code from computeAddend.
Previously, computeAddend had many parameters but most of them were
used only for MIPS. The MIPS ABI is too odd that I don't want to mix
it into the regular code path. Splitting the function into non-MIPS
and MIPS parts makes the regular code path easy to follow.

llvm-svn: 298817
2017-03-26 19:35:24 +00:00
Vassil Vassilev bae9202b9a Revert 298754 and 298742.
They broke llvm modules builds and our internal modules infrastructure.

llvm-svn: 298816
2017-03-26 18:32:53 +00:00
Rui Ueyama 09fd21f45c Do not use assert to report broken input files.
llvm-svn: 298815
2017-03-26 18:23:22 +00:00
Rui Ueyama 8d462b2b5f Update comments.
llvm-svn: 298814
2017-03-26 18:23:00 +00:00
Simon Pilgrim ca8bd25824 Fix signed/unsigned comparison warnings.
llvm-svn: 298813
2017-03-26 17:39:41 +00:00
Shoaib Meenai 7375448893 [llvm-readobj] Prefer ILT to IAT for reading COFF imports
We're seeing binutils ld produce binaries where the import address
table's NameRVA entry is actually a VA instead (i.e. it's already base
relocated), which llvm-readobj then chokes on. Both dumpbin and the
Windows loader are able to handle these binaries correctly, however, and
we can make llvm-readobj handle them correctly too by iterating the
import lookup table (which doesn't have a relocated NameRVA) rather than
the import address table.

The import lookup table and the import address table are supposed to be
identical on disk, and prior to r277298 the import lookup table would be
used by `llvm-readobj -coff-imports` anyway, so this shouldn't have any
functional change (except in the case of our malformed binaries). The
import lookup table can apparently be missing when using old Borland
linkers, so fall back to the import address table in that case.

Resolves PR31766.

Differential Revision: https://reviews.llvm.org/D31362

llvm-svn: 298812
2017-03-26 17:10:11 +00:00
Serge Pavlov b71bb80c2d [LoopUnroll] Remap references in peeled iteration
References in cloned blocks must be remapped prior to dominator
calculation.

Differential Revision: https://reviews.llvm.org/D31281

llvm-svn: 298811
2017-03-26 16:46:53 +00:00
Kamil Rytarowski 12801f1e0f [LLDB] OpenBSD support
Summary:
Add basic OpenBSD support. This is enough to be able to analyze core dumps for OpenBSD/amd64, OpenBSD/arm, OpenBSD/arm64 and OpenBSD/i386.

Note that part of the changes to source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp fix a bug that probably affects other platforms as well.  The GetProgramHeaderByIndex() interface use 1-based indices, but in some case when looping over the headers the, the loop starts at 0 and misses the last header.  This caused problems on OpenBSD since OpenBSD core dumps have the PT_NOTE segment as the last program header.


Reviewers: joerg, labath, krytarowski

Reviewed By: krytarowski

Subscribers: aemerson, emaste, rengolin, srhines, krytarowski, mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31131

llvm-svn: 298810
2017-03-26 15:34:57 +00:00
Dmitry Vyukov 8096a8c86f tsan: add new mutex annotations
There are several problems with the current annotations (AnnotateRWLockCreate and friends):
- they don't fully support deadlock detection (we need a hook _before_ mutex lock)
- they don't support insertion of random artificial delays to perturb execution (again we need a hook _before_ mutex lock)
- they don't support setting extended mutex attributes like read/write reentrancy (only "linker init" was bolted on)
- they don't support setting mutex attributes if a mutex don't have a "constructor" (e.g. static, Java, Go mutexes)
- they don't ignore synchronization inside of lock/unlock operations which leads to slowdown and false negatives
The new annotations solve of the above problems. See tsan_interface.h for the interface specification and comments.

Reviewed in https://reviews.llvm.org/D31093

llvm-svn: 298809
2017-03-26 15:27:04 +00:00
Chandler Carruth de27a6dcfa [IR] Switch to more normal template parameter names ending in `T`
instead of `Ty`.

The `Ty` suffix is much more commonly used for LLVM `Type` variable
names, so this seemed like a particularly confusing collision.

llvm-svn: 298808
2017-03-26 14:24:06 +00:00
Simon Pilgrim 311c5ddb5b Fix signed/unsigned comparison warnings.
llvm-svn: 298807
2017-03-26 13:59:17 +00:00
Simon Pilgrim 92925ea701 [X86][SSE] Add computeKnownBitsForTargetNode support for (V)PSLL/(V)PSRL instructions
llvm-svn: 298806
2017-03-26 13:17:55 +00:00
Simon Pilgrim 049d9c921f [X86][AVX512F] Fix reg class for VMOVSSZrr/VMOVSSZrrk and VMOVSDZrr/VMOVSDZrrk
Fixed -verify-machineinstrs errors in fast-isel-select-sse.ll (one of many in PR27481)

The VMOVSSZrr/VMOVSSZrrk and VMOVSDZrr/VMOVSDZrrk instructions were assuming both source registers were V128X when the second is actually supposed to be FR32X/FR64X

Differential Revision: https://reviews.llvm.org/D31200

llvm-svn: 298805
2017-03-26 12:52:28 +00:00
Simon Pilgrim bc71539454 Fix MSVC signed/unsigned comparison warnings.
llvm-svn: 298804
2017-03-26 11:17:05 +00:00
Simon Pilgrim 544f750de6 Regenerate test
llvm-svn: 298803
2017-03-26 10:33:03 +00:00
Simon Pilgrim a2b81dc411 Regenerate test
The CHECK-DAG aren't necessary and get in the way of automated checks

llvm-svn: 298802
2017-03-26 10:31:37 +00:00
Simon Pilgrim 1d8235a022 Regenerate tests to remove duplicated checks
llvm-svn: 298801
2017-03-26 10:28:39 +00:00
Igor Breger 531a203a06 [GlobalISel][X86] support G_FRAME_INDEX instruction selection.
Summary:
    Support G_FRAME_INDEX instruction selection.

    Reviewers: zvi, rovka, ab, qcolombet

    Reviewed By: ab

    Subscribers: llvm-commits, dberris, kristof.beyls, eladcohen, guyblank

    Differential Revision: https://reviews.llvm.org/D30980

llvm-svn: 298800
2017-03-26 08:11:12 +00:00
Joerg Sonnenberger fa7367428a Split the SimplifyCFG pass into two variants.
The first variant contains all current transformations except
transforming switches into lookup tables. The second variant
contains all current transformations.

The switch-to-lookup-table conversion results in code that is more
difficult to analyze and optimize by other passes. Most importantly,
it can inhibit Dead Code Elimination. As such it is often beneficial to
only apply this transformation very late. A common example is inlining,
which can often result in range restrictions for the switch expression.

Changes in execution time according to LNT:
SingleSource/Benchmarks/Misc/fp-convert +3.03%
MultiSource/Benchmarks/ASC_Sequoia/CrystalMk/CrystalMk -11.20%
MultiSource/Benchmarks/Olden/perimeter/perimeter -10.43%
and a couple of smaller changes. For perimeter it also results 2.6%
a smaller binary.

Differential Revision: https://reviews.llvm.org/D30333

llvm-svn: 298799
2017-03-26 06:44:08 +00:00
Andrew Wilkins ebfe3a9df8 Add check for BSD when setting LIB_NAMES for GNU ld
Patch by Koop Mast and Alex Arslan!

Differential Revision: https://reviews.llvm.org/D28215

llvm-svn: 298798
2017-03-26 05:58:48 +00:00
Rui Ueyama ff524bf739 Sort. NFC.
llvm-svn: 298797
2017-03-26 04:10:43 +00:00
Rui Ueyama f7c2b0cb49 Remove a redundant local variable.
llvm-svn: 298796
2017-03-26 03:42:00 +00:00
Rui Ueyama a588b5fcdc Add a comment.
llvm-svn: 298795
2017-03-26 03:41:41 +00:00
Rui Ueyama 2bb35f6844 Inline a function that is used only once.
llvm-svn: 298794
2017-03-26 03:21:08 +00:00
Rui Ueyama 94e36c894e De-template a few functions in which ELFT is not needed.
llvm-svn: 298793
2017-03-26 03:20:49 +00:00
Rui Ueyama 760197cef1 Add comments and return early.
llvm-svn: 298792
2017-03-26 03:20:30 +00:00
Chandler Carruth 0d256c0f5d [IR] Make SwitchInst::CaseIt almost a normal iterator.
This moves it to the iterator facade utilities giving it full random
access semantics, etc. It can also now be used with standard algorithms
like std::all_of and std::any_of and range adaptors like llvm::reverse.

Also make the semantics of iterating match what every other iterator
uses and forbid decrementing past the begin iterator. This was used as
a hacky way to work around iterator invalidation. However, every
instance trying to do this failed to actually avoid touching invalid
iterators despite the clear documentation that the removed and all
subsequent iterators become invalid including the end iterator. So I've
added a return of the next iterator to removeCase and rewritten the
loops that were doing this to correctly follow the iterator pattern of
either incremneting or removing and assigning fresh values to the
iterator and the end.

In one case we were trying to go backwards to make this cleaner but it
doesn't actually work. I've made that code match the code we use
everywhere else to remove cases as we iterate. This changes the order of
cases in one test output and I moved that test to CHECK-DAG so it
wouldn't care -- the order isn't semantically meaningful anyways.

llvm-svn: 298791
2017-03-26 02:49:23 +00:00
Rui Ueyama beeab45770 Remove unused parameter.
llvm-svn: 298790
2017-03-26 02:28:09 +00:00
Rui Ueyama cb815ac549 Remove redundant local variables.
llvm-svn: 298789
2017-03-26 02:27:50 +00:00
Rui Ueyama b5cb328383 Remove a parameter from adjustExpr. NFC.
llvm-svn: 298788
2017-03-26 02:27:30 +00:00
Rui Ueyama dfd204fa1d Inline a small lambda.
llvm-svn: 298787
2017-03-26 02:27:11 +00:00
Rui Ueyama 2f274230f1 Rename C -> Sec and RI -> Rel.
C is short for Chunk, but we are no longer using that term.
RI is probably short for relocation iterator, but this is not an interator.

llvm-svn: 298786
2017-03-26 02:26:52 +00:00
Rui Ueyama 08aede362b Simplify relocation offset adjustment.
Previously, relocation offsets are recalculated for .eh_frame sections
inside the main loop, and that messed up the main loop. This patch
separates that logic into a dedicated class.

llvm-svn: 298785
2017-03-26 02:26:33 +00:00