Commit Graph

248058 Commits

Author SHA1 Message Date
Rui Ueyama 0ede7f281e Make log(), error() and fatal() thread-safe.
llvm-svn: 287794
2016-11-23 18:34:28 +00:00
Reid Kleckner 98c80572f2 Add dllexport default ctor closure PCH regression test for PR31121
Follow up to r287774

llvm-svn: 287793
2016-11-23 18:33:54 +00:00
Michael Kuperstein 47eb85a003 [X86] Allow folding of stack reloads when loading a subreg of the spilled reg
We did not support subregs in InlineSpiller:foldMemoryOperand() because targets
may not deal with them correctly.

This adds a target hook to let the spiller know that a target can handle
subregs, and actually enables it for x86 for the case of stack slot reloads.
This fixes PR30832.

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

llvm-svn: 287792
2016-11-23 18:33:49 +00:00
Reid Kleckner 3c3fe5d885 [asan/win] Skip incremental linker padding during unregistration
Should fix issues that came up while testing Win64 ASan.

llvm-svn: 287791
2016-11-23 18:28:04 +00:00
Rui Ueyama ac95f6bfcc Limit default maximum number of errors to 20.
This is in the context of https://llvm.org/bugs/show_bug.cgi?id=31109.
When LLD prints out errors for relocations, it tends to print out
extremely large number of errors (like millions) because it would
print out one error per relocation.

This patch makes LLD bail out if it prints out more than 20 errors.
You can configure the limitation using -error-limit argument.
-error-limit=0 means no limit.

I chose the flag name because Clang has the same feature as -ferror-limit.
"f" doesn't make sense to us, so I omitted it.

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

llvm-svn: 287789
2016-11-23 18:15:37 +00:00
Rui Ueyama 28590b6118 Re-commit r287727: Use SHA1::hash and MD5::hash functions.
r287727 was not a change that broke buildbots; the other change
(r287726) that I made to LLVM broke them.

llvm-svn: 287788
2016-11-23 18:11:38 +00:00
Rui Ueyama 3fc0f7e54f Define toString() as a generic function to get a string for error message.
We have different functions to stringize objects to construct
error messages. For InputFile, we have getFilename, and for
InputSection, we have getName. You had to memorize them.

I think this is the case where the function overloading comes in handy.

This patch defines toString() functions that are overloaded for all these
types, so that you just call it in error().

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

llvm-svn: 287787
2016-11-23 18:07:33 +00:00
Hemant Kulkarni a6ee9fd642 llvm-readobj: Use hash tables to print dynamic symbols.
-symbols prints both .symtab and .dynsym symbols for GNU style in ELF.
-dyn-symbols prints symbols looking up through hash tables. This helps validate hash tables.

llvm-svn: 287786
2016-11-23 18:04:23 +00:00
Reid Kleckner ff8f2b8f89 [asan/win] Check assumptions about the incremental linker more
Remove a needless cast as well.

llvm-svn: 287785
2016-11-23 18:02:16 +00:00
Chandler Carruth dab4eae274 [PM] Change the static object whose address is used to uniquely identify
analyses to have a common type which is enforced rather than using
a char object and a `void *` type when used as an identifier.

This has a number of advantages. First, it at least helps some of the
confusion raised in Justin Lebar's code review of why `void *` was being
used everywhere by having a stronger type that connects to documentation
about this.

However, perhaps more importantly, it addresses a serious issue where
the alignment of these pointer-like identifiers was unknown. This made
it hard to use them in pointer-like data structures. We were already
dodging this in dangerous ways to create the "all analyses" entry. In
a subsequent patch I attempted to use these with TinyPtrVector and
things fell apart in a very bad way.

And it isn't just a compile time or type system issue. Worse than that,
the actual alignment of these pointer-like opaque identifiers wasn't
guaranteed to be a useful alignment as they were just characters.

This change introduces a type to use as the "key" object whose address
forms the opaque identifier. This both forces the objects to have proper
alignment, and provides type checking that we get it right everywhere.
It also makes the types somewhat less mysterious than `void *`.

We could go one step further and introduce a truly opaque pointer-like
type to return from the `ID()` static function rather than returning
`AnalysisKey *`, but that didn't seem to be a clear win so this is just
the initial change to get to a reliably typed and aligned object serving
is a key for all the analyses.

Thanks to Richard Smith and Justin Lebar for helping pick plausible
names and avoid making this refactoring many times. =] And thanks to
Sean for the super fast review!

While here, I've tried to move away from the "PassID" nomenclature
entirely as it wasn't really helping and is overloaded with old pass
manager constructs. Now we have IDs for analyses, and key objects whose
address can be used as IDs. Where possible and clear I've shortened this
to just "ID". In a few places I kept "AnalysisID" to make it clear what
was being identified.

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

llvm-svn: 287783
2016-11-23 17:53:26 +00:00
Ed Maste 8fd0196c6f lld: Default image base address to 0x200000 on x86-64
Align to the large page size (known as a superpage or huge page).
FreeBSD automatically promotes large, superpage-aligned allocations.

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

llvm-svn: 287782
2016-11-23 17:44:02 +00:00
Alina Sbirlea a3d2f703a5 [LoadStoreVectorizer] Enable vectorization of stores in the presence of an aliasing load
Summary:
The "getVectorizablePrefix" method would give up if it found an aliasing load for a store chain.
In practice, the aliasing load can be treated as a memory barrier and all stores that precede it
are a valid vectorizable prefix.
Issue found by volkan in D26962. Testcase is a pruned version of the one in the original patch.

Reviewers: jlebar, arsenm, tstellarAMD

Subscribers: mzolotukhin, wdng, nhaehnle, anna, volkan, llvm-commits

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

llvm-svn: 287781
2016-11-23 17:43:15 +00:00
Reid Kleckner f174a0bbd2 [asan/win] Fix incremental linking vs. global registration
The MSVC incremental linker pads every global out to 256 bytes in case
it changes size after an incremental link. So, skip over null entries in
the DSO-wide asan globals array. This only works if the global padding
size is divisible by the size of the asan global object, so add some
defensive CHECKs.

llvm-svn: 287780
2016-11-23 17:37:00 +00:00
Ed Maste 8d0381d61f Replace test instruction byte strings with {{.*}}
An upcoming change to the image base address for x86-64 (D27042) will
will change some addresses and hence the instruction encodings. We care
about the disassembled instructions, not their encodings.

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

llvm-svn: 287778
2016-11-23 17:09:38 +00:00
Alex Lorenz 675221589e [Sema][Atomics] Treat expected pointer in compare exchange atomics as _Nonnull
This commit teaches clang that is has to emit a warning when NULL is passed
as the 'expected' pointer parameter into an atomic compare exchange call.

rdar://18926650

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

llvm-svn: 287776
2016-11-23 16:57:03 +00:00
Ehsan Amiri ac10595b0d [PPC] Reverting r287772
Due to buildbot failure, I revert. Will recommit after investigation.

llvm-svn: 287775
2016-11-23 16:56:03 +00:00
Reid Kleckner c01ee7505a Remove C++ default arg side table for MS ABI ctor closures
Summary:
We don't need a side table in ASTContext to hold CXXDefaultArgExprs. The
important part of building the CXXDefaultArgExprs was to ODR use the
default argument expressions, not to make AST nodes. Refactor the code
to only check the default argument, and remove the side table in
ASTContext which wasn't being serialized.

Fixes PR31121

Reviewers: thakis, rsmith, majnemer

Subscribers: cfe-commits

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

llvm-svn: 287774
2016-11-23 16:51:30 +00:00
Nirav Dave cf34556330 [DAG] Improve loads-from-store forwarding to handle TokenFactor
Forward store values to matching loads down through token
factors. Factored from D14834.

Reviewers: jyknight, hfinkel

Subscribers: hfinkel, nemanjai, llvm-commits

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

llvm-svn: 287773
2016-11-23 16:48:35 +00:00
Ehsan Amiri 5ea1054dab [PPC] support for arithmetic builtins in the FE
This adds various overloads of the following builtins to altivec.h:

    vec_neg
    vec_nabs
    vec_adde
    vec_addec
    vec_sube
    vec_subec
    vec_subc

Note that for vec_sub builtins on 32 bit integers, the semantics is similar to
what ISA describes for instructions like vsubecuq that work on quadwords: the
first operand is added to the one's complement of the second operand. (As
opposed to two's complement which I expected).

llvm-svn: 287772
2016-11-23 16:32:05 +00:00
Alex Lorenz 01bcfc1414 [CodeCompletion] Fix incorrect Objective-C block parameter formatting
This commit fixes an incorrectly formatted Objective-C block parameter
placeholder in a code completion result. The incorrect parameter had a
redundant leading parenthesis.

rdar://25224416

llvm-svn: 287771
2016-11-23 16:28:34 +00:00
Adrian McCarthy 4ad5def9b0 Refactor LLDB's Windows process plugin (NFC)
The Windows process plugin was broken up into multiple pieces a while back in
order to share code between debugging live processes and minidumps
(postmortem) debugging. The minidump portion was replaced by a cross-platform
solution. This left the plugin split into a formerly "common" base classes and
the derived classes for live debugging. This extra layer made the code harder
to understand and work with.

This patch simplifies these class hierarchies by rolling the live debugging
concrete classes up to the base classes. Last week I posted my intent to make
this change to lldb-dev, and I didn't hear any objections.

This involved moving code and changing references to classes like
ProcessWindowsLive to ProcessWindows. It still builds for both 32- and 64-bit,
and the tests still pass on 32-bit. (Tests on 64-bit weren't passing before
this refactor for unrelated reasons.)

llvm-svn: 287770
2016-11-23 16:26:37 +00:00
Yichao Yu 5abf14ba51 Fix doc of `llvm.bitreverse.iN`
Summary:
The return type is `iN` rather than always `i16`

Seems to be a typo in https://reviews.llvm.org/rL252878 .

Reviewers: jmolloy

Subscribers: llvm-commits

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

llvm-svn: 287769
2016-11-23 16:25:31 +00:00
Shoaib Meenai 4304955545 [libc++] Remove unneeded visibility pragmas
The function definitions being guarded by the pragma were all static, so
they wouldn't be exported anyway. In any case, we should prefer the
visibility macros. No functional change.

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

llvm-svn: 287768
2016-11-23 16:11:15 +00:00
Marcin Koscielnicki 441dd21da9 Revert "[ASan] Enable on SystemZ."
This reverts commit r287764.

Two tests broke on the clang-s390x-linux buildbot:
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/1293.

llvm-svn: 287767
2016-11-23 16:07:07 +00:00
John Brawn 150addb45c [DAGCombiner] Fix infinite loop in vector mul/shl combining
We have the following DAGCombiner transformations:
 (mul (shl X, c1), c2) -> (mul X, c2 << c1)
 (mul (shl X, C), Y) -> (shl (mul X, Y), C)
 (shl (mul x, c1), c2) -> (mul x, c1 << c2)
Usually the constant shift is optimised by SelectionDAG::getNode when it is
constructed, by SelectionDAG::FoldConstantArithmetic, but when we're dealing
with vectors and one of those vector constants contains an undef element
FoldConstantArithmetic does not fold and we enter an infinite loop.

Fix this by making FoldConstantArithmetic use getNode to decide how to fold each
vector element, the same as FoldConstantVectorArithmetic does, and rather than
adding the constant shift to the work list instead only apply the transformation
if it's already been folded into a constant, as if it's not we're going to loop
endlessly. Additionally add missing NoOpaques to one of those transformations,
which I noticed when writing the tests for this.

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

llvm-svn: 287766
2016-11-23 16:05:51 +00:00
Nemanja Ivanovic 10fc3cfc63 [PowerPC] Remove InstAlias definitions that cause incorrect assembly
In rL283190, I added some InstAlias definitions to generate extended mnemonics
for some uses of the XXPERMDI instruction. However, when the assembler matches
these extended mnemonics, it matches the new instruction in situations where it
should match the old one.
This patch removes these definitions and accomplishes that by defining these
mnemonics with additional instructions that are isCodeGenOnly.

Fixes PR31127.

llvm-svn: 287765
2016-11-23 15:51:52 +00:00
Marcin Koscielnicki 9a02c55edf [ASan] Enable on SystemZ.
Differential Revision: http://reviews.llvm.org/D21831

llvm-svn: 287764
2016-11-23 15:47:41 +00:00
Gabor Horvath 0866c2f5d4 [ASTImporter] Added ability to import AtomicType nodes
Patch by: Kareem Khazem

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

llvm-svn: 287763
2016-11-23 15:24:23 +00:00
Simon Pilgrim 4e9b9cbee9 [X86][AVX512] Add support for v4i64 fptosi/fptoui/sitofp/uitofp on AVX512DQ-only targets
Use 512-bit instructions with subvector insertion/extraction like we do in a number of similar circumstances

llvm-svn: 287762
2016-11-23 14:01:18 +00:00
Elena Demikhovsky 09375d98b8 Type legalization for compressstore and expandload intrinsics.
Implemented widening (v2f32) and splitting (v16f64).
On splitting, I use "popcnt" to calculate memory increment. 
More type legalization work will come in the next patches.

llvm-svn: 287761
2016-11-23 13:58:24 +00:00
Simon Pilgrim 03cd8f887c [CostModel][X86] Add missing AVX512DQ v8i64 fptosi/sitofp costs
llvm-svn: 287760
2016-11-23 13:42:09 +00:00
Benjamin Kramer 1eba23b308 [clang-rename] Add test case for r287758.
llvm-svn: 287759
2016-11-23 13:14:19 +00:00
Benjamin Kramer 66039d39e1 [clang-rename] Fix non-functional offset check.
Adding something to a SourceLocation will only produce an invalid
SourceLocation in edge cases (overflow or adding 0 to an invalid one).
Check that the offset is inside the file instead and add a test case to
verify that the error message works.

llvm-svn: 287758
2016-11-23 13:10:07 +00:00
Benjamin Kramer 8a3c49897f [MD5] Use write32le instead of spelling it out with shifts.
No functionality change intended.

llvm-svn: 287757
2016-11-23 11:49:28 +00:00
Simon Pilgrim e5dbdbefca [CostModel][X86] Add v2f32 -> v2i64 fptosi/fptoui cost tests
llvm-svn: 287756
2016-11-23 11:43:00 +00:00
Simon Pilgrim b243bbc87d [X86][AVX512VL] Add missing _mm256_maskz_alignr_epi64 shufflevector check
Missed in rL287733

llvm-svn: 287755
2016-11-23 11:38:52 +00:00
Benjamin Kramer 630cf8c2a3 [CodeGen] Simplify code. No functionality change intended.
llvm-svn: 287754
2016-11-23 11:20:27 +00:00
Eugene Leviant c3a44b2fbe [ELF] Refactor several error messages
Differential revision: https://reviews.llvm.org/D26970

llvm-svn: 287753
2016-11-23 10:07:46 +00:00
Haojian Wu 48ac304c8e [clang-move] Add some options allowing to add old/new.h to new/old.h respectively.
Summary:
* --new_depend_on_old: new header will include old header
* --old_depend_on_new: old header will include new header.

Reviewers: ioeric

Subscribers: cfe-commits

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

llvm-svn: 287752
2016-11-23 10:04:19 +00:00
Eugene Leviant 3582ebf35e [ELF] Fixup buffer pointer when writing synthetic sections
Differential revision: https://reviews.llvm.org/D26980

llvm-svn: 287751
2016-11-23 09:47:38 +00:00
Eugene Leviant 531df4fcef [ELF] Print error location in .eh_frame parser
Differential revision: https://reviews.llvm.org/D26914

llvm-svn: 287750
2016-11-23 09:45:17 +00:00
Eric Fiselier 341c9dd9c4 Fix __hash_table::max_size() on 32 bit systems
llvm-svn: 287749
2016-11-23 09:16:12 +00:00
Marcin Koscielnicki 5bdf70f410 [profile] Enable on SystemZ.
Differential Revision: http://reviews.llvm.org/D21738

llvm-svn: 287748
2016-11-23 08:28:42 +00:00
Rui Ueyama 0cbf749397 Remove one of SymbolTable::addRegular function that forwards other addRegular.
So that we have less number of overloaded functions.

llvm-svn: 287745
2016-11-23 06:59:47 +00:00
Craig Topper f57e17def0 [AVX-512] Remove intrinsics for valignd/q and autoupgrade them to native shuffles.
llvm-svn: 287744
2016-11-23 06:54:55 +00:00
Zvi Rackover 14aba43ea9 [X86] Simplify lowerVectorShuffleAsBitMask to handle only integer VT's
Summary: This function is only called with integer VT arguments, so remove code that handles FP vectors.

Reviewers: RKSimon, craig.topper, delena, andreadb

Subscribers: llvm-commits

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

llvm-svn: 287743
2016-11-23 06:45:25 +00:00
Rui Ueyama 768c6f0ca6 Remove a forwarding constructor that is used only once.
llvm-svn: 287742
2016-11-23 06:31:23 +00:00
Rui Ueyama 35fa6c58ad Parse symbol versions in scanVersionScript() instead of insert().
There are two ways to set symbol versions. One way is to use symbol
definition file, and the other is to embed version names to symbol
names. In the latter way, symbol name is in the form of `foo@version1`
where `foo` is a real name and `version1` is a version.

We were parsing symbol names in insert(). That seems unnecessarily
too early. We can do it later after we resolve all symbols. Doing it
lazily is a good thing because it makes code easier to read
(because now we have a separate pass to parse symbol names). Also
it could slightly improve performance because if two identical symbols
have versions, we now parse them only once.

llvm-svn: 287741
2016-11-23 05:48:40 +00:00
Simon Atanasyan 399ac5c3fb [ELF][MIPS] Turn Config->Threads off for MIPS targets
For now MipsGotSection class is not ready for concurrent access from
multiple threads. The problem is in the getPageEntryOffset method. It
changes state of MipsGotSection object and might be called from
different threads at the same time. So turn Threads off for this target.

It's a temporary solution. The patch fixes MipsGotSection::getPageEntryOffset
is almost ready.

Differential revision: https://reviews.llvm.org/D27035

llvm-svn: 287740
2016-11-23 05:25:02 +00:00
Rui Ueyama d14743e17f Better formatting.
If a line is too long, its error message becomes hard to read.

llvm-svn: 287739
2016-11-23 05:14:01 +00:00