Commit Graph

204704 Commits

Author SHA1 Message Date
Peter Collingbourne 8e17451d54 COFF: Fix bug involving archives defining a symbol multiple times.
Previously we were unnecessarily loading lazy symbols if they appeared in an
archive multiple times, as can happen with comdat symbols. This change fixes
the bug by only loading symbols from archives at load time if the original
symbol was undefined.

Differential Revision: http://reviews.llvm.org/D10980

llvm-svn: 241538
2015-07-07 02:15:25 +00:00
Alex Lorenz 36962cd925 MIR Parser: Verify the implicit machine register operands.
This commit verifies that the parsed machine instructions contain the implicit
register operands as specified by the MCInstrDesc. Variadic and call
instructions aren't verified.

Reviewers: Duncan P. N. Exon Smith

Differential Revision: http://reviews.llvm.org/D10781

llvm-svn: 241537
2015-07-07 02:08:46 +00:00
Juergen Ributzka 9622cdf4b9 [StackMap Liveness] Calling the base class' getAnalysisUsage method. NFCI.
Calling into the base class' getAnalysisUsage method after we did our pass
specific modifications. This shouldn't really matter since this is the last
pass in the pipeline anyways.

llvm-svn: 241536
2015-07-07 02:05:18 +00:00
Juergen Ributzka c111fcc0a0 [StackMap Liveness] No need to cache the MachineFunction. NFC.
Don't cache the MachineFunction in the pass and range'ify some loops.

llvm-svn: 241535
2015-07-07 02:05:15 +00:00
Adrian Prantl 3d2c051cf6 Debug info: Emit distinct __block_literal_generic types for blocks with
different function signatures. (Previously clang would emit all block
pointer types with the type of the first block pointer in the compile
unit.)

rdar://problem/21602473

llvm-svn: 241534
2015-07-07 00:49:35 +00:00
Reid Kleckner 9fe7f2396b Revert "Revert 241171, 241187, 241199 (32-bit SEH)."
This reverts commit r241244, but restricts SEH support to Win64.

This way, Chromium builds will still fall back on TUs with SEH, and
Clang developers can work on this incrementally upstream while patching
this small predicate locally. It'll also make it easier to review small
fixes.

llvm-svn: 241533
2015-07-07 00:36:30 +00:00
Eric Fiselier 1faf289e27 [libcxx] Add atomic_support.h header to src that handles needed atomic operations.
Summary:
In some places in libc++ we need to use the `__atomic_*` builtins. This patch adds a header that provides access to those builtins in a uniform way from within the dylib source.

If the compiler building the dylib does not support these builtins then a warning is issued.

Only relaxed loads are needed within the headers. A singe function to do these relaxed loads has been added to `<memory>`.

This patch applies the new atomic builtins to `__shared_count` and `call_once`.

Reviewers: mclow.lists

Subscribers: majnemer, jroelofs, cfe-commits

Differential Revision: http://reviews.llvm.org/D10406

llvm-svn: 241532
2015-07-07 00:27:16 +00:00
Enrico Granata d529d04fd7 Add a summary for vector types
The summary is - quite simply - a one-line printout of the vector elements

We still need synthetic children:
a) as a source of the elements to print in the summary
b) for graphical IDEs that display structure regardless of the summary settings

rdar://5429347

llvm-svn: 241531
2015-07-07 00:20:57 +00:00
Davide Italiano 5a2acd1e1e Fix undefined behaviour exposed by the new -Wshift-negative-value warning.
llvm-svn: 241530
2015-07-07 00:02:59 +00:00
Eric Christopher 3fe5739451 Remember to mark the target attribute as documented and clean up the
Subjects line to avoid redundancy.

llvm-svn: 241529
2015-07-07 00:01:55 +00:00
Benjamin Kramer 1a15f2ec57 [Driver] Use llvm::Triple methods to handle -EL and -EB.
Add a test for ppc64(le), which wasn't handled before.

llvm-svn: 241528
2015-07-06 23:59:45 +00:00
Benjamin Kramer 4ea14a671d [Triple] Add a helper to switch between big/little endian variants
This will be used from clang's driver.

llvm-svn: 241527
2015-07-06 23:58:14 +00:00
Eric Christopher d151addc00 Update target attribute support for post-commit feedback.
Use const auto rather than duplicating the type name and fix the
error message when the attribute is applied to an incorrect entity.

llvm-svn: 241526
2015-07-06 23:52:01 +00:00
Eric Christopher af4d608d13 Handle arbitrary whitespace in the target attribute support.
This allows us to deal a bit more gracefully with inclusions done
by macros, token pasting, or just code layout/formatting.

llvm-svn: 241525
2015-07-06 23:51:59 +00:00
Eric Christopher 93d6adfb46 Add some basic documentation for the __attribute__((target(""))) support.
Describes the general syntax of how it's used with the unfortunate
usage of "subtarget features" and some examples from the x86 port
to help users.

llvm-svn: 241524
2015-07-06 23:51:56 +00:00
NAKAMURA Takumi 00409fbe19 Make UnitTestMain/TestMain.cpp free from llvm/Config/config.h.
llvm/Config/config.h is unavailable outside of build tree.

llvm-svn: 241523
2015-07-06 23:51:40 +00:00
Greg Clayton 98424c4460 Make the "lldb/Utility/JSON.h" able to parse JSON into tokens with the new JSONParser class.
Change over existing code to use this new parser so StructuredData can use the tokenizer to parse JSON instead of doing it manually.

This allowed us to easily parse JSON into JSON* objects as well as into StructuredData.

llvm-svn: 241522
2015-07-06 23:40:40 +00:00
Sanjoy Das 8ee6a30b8d [FaultMaps] Add statistic to count the # of implicit null checks.
llvm-svn: 241521
2015-07-06 23:32:10 +00:00
Dan Gohman b2f62a32e4 [WebAssembly] Create a CodeGen unittest directory.
llvm-svn: 241520
2015-07-06 23:14:57 +00:00
Alex Lorenz cb268d46f0 MIR Serialization: Serialize the implicit register flag.
This commit serializes the implicit flag for the register machine operands. It
introduces two new keywords into the machine instruction syntax: 'implicit' and
'implicit-def'. The 'implicit' keyword is used for the implicit register
operands, and the 'implicit-def' keyword is used for the register operands that
have both the implicit and the define flags set.

Reviewers: Duncan P. N. Exon Smith

Differential Revision: http://reviews.llvm.org/D10709

llvm-svn: 241519
2015-07-06 23:07:26 +00:00
Richard Smith e869b753e4 Refactor to avoid long if-condition.
llvm-svn: 241518
2015-07-06 22:56:29 +00:00
Eric Christopher 96353b3281 Remove JumpInstrTableInfo.h as it is no longer used.
llvm-svn: 241517
2015-07-06 22:55:20 +00:00
Simon Pilgrim 40343e6b3a [X86][AVX] Add support for shuffle decoding of vperm2f128/vperm2i128 with zero'd lanes
The vperm2f128/vperm2i128 shuffle mask decoding was not attempting to deal with shuffles that give zero lanes. This patch fixes this so that the assembly printer can provide shuffle comments.

As this decoder is also used in X86ISelLowering for shuffle combining, I've added an early-out to match existing behaviour. The hope is that we can add zero support in the future, this would allow other ops' decodes (e.g. insertps) to be combined as well.

Differential Revision: http://reviews.llvm.org/D10593

llvm-svn: 241516
2015-07-06 22:46:46 +00:00
Sanjay Patel 681a56ac58 [x86] extend machine combiner reassociation optimization to SSE scalar adds
Extend the reassociation optimization of http://reviews.llvm.org/rL240361 (D10460)
to SSE scalar FP SP adds in addition to AVX scalar FP SP adds.

With the 'switch' in place, we can trivially add other opcodes and test cases in
future patches.

Differential Revision: http://reviews.llvm.org/D10975

llvm-svn: 241515
2015-07-06 22:35:29 +00:00
Simon Pilgrim 8fbf1c1f4a [X86][SSE] Vectorized i64 uniform constant SRA shifts
This patch adds vectorization support for uniform constant i64 arithmetic shift right operators.

Differential Revision: http://reviews.llvm.org/D9645

llvm-svn: 241514
2015-07-06 22:35:19 +00:00
JF Bastien 86bc91508d WebAssembly: add some TODO
Reviewers: sunfish

Subscribers: llvm-commits, jfb

Differential Revision: http://reviews.llvm.org/D10971

llvm-svn: 241513
2015-07-06 21:41:59 +00:00
Rafael Espindola 2d5d23d41d llvm-nm: treat weak undefined as undefined.
This matches the behavior of gnu ld.

llvm-svn: 241512
2015-07-06 21:36:23 +00:00
Adrian Prantl 498fff661d Debug info: Don't emit a bogus location for the global block pointer type
(__block_literal_generic).

The arbitrary nature of the location confuses lldb and prevents type
uniquing.

rdar://problem/21602473

llvm-svn: 241511
2015-07-06 21:31:35 +00:00
Reid Kleckner f2ea7e1d02 [WinEH] Add some test cases I forgot to add to previous commits
llvm-svn: 241510
2015-07-06 21:13:53 +00:00
Reid Kleckner da76bd444f [WinEH] Insert the EH code load before the block terminator
The previous code put the load after the terminator, leading to invalid
IR and downstream crashes. This caused http://crbug.com/506446.

llvm-svn: 241509
2015-07-06 21:13:43 +00:00
Simon Pilgrim d85cae3d52 [X86][SSE4A] Shuffle lowering using SSE4A EXTRQ/INSERTQ instructions
This patch adds support for v8i16 and v16i8 shuffle lowering using the immediate versions of the SSE4A EXTRQ and INSERTQ instructions. Although rather limited (they can only act on the lower 64-bits of the source vectors, leave the upper 64-bits of the result vector undefined and don't have VEX encoded variants), the instructions are still useful for the zero extension of any lane (EXTRQ) or inserting a lane into another vector (INSERTQ). Testing demonstrated that it wasn't typically worth it to use these instructions for v2i64 or v4i32 vector shuffles although they are capable of it.

As well as adding specific pattern matching for the shuffles, the patch uses EXTRQ for zero extension cases where SSE41 isn't available and its more efficient than the SSE2 'unpack' default approach. It also adds shuffle decode support for the EXTRQ / INSERTQ cases when the instructions are handling full byte-sized extractions / insertions.

From this foundation, future patches will be able to make use of the instructions for situations that use their ability to extract/insert at the bit level.

Differential Revision: http://reviews.llvm.org/D10146

llvm-svn: 241508
2015-07-06 20:46:41 +00:00
Adrian McCarthy 381dffd655 Normalize line endings.
llvm-svn: 241507
2015-07-06 20:44:08 +00:00
Simon Pilgrim 8b756596fc [X86][SSE] Use the general SMAX/SMIN/UMAX/UMIN opcodes and remove the X86 implementation
With the completion of D9746 there is now a common implementation of integer signed/unsigned min/max nodes, removing the need for the equivalent X86 specific implementations.

This patch removes the old X86ISD nodes, legalizes the relevant SSE2/SSE41/AVX2/AVX512 instructions for the ISD versions and converts the small amount of existing X86 code.

Differential Revision: http://reviews.llvm.org/D10947

llvm-svn: 241506
2015-07-06 20:30:47 +00:00
Quentin Colombet 40dd510a73 [TwoAddressInstructionPass] Rename a variable to match the coding style.
Spot by Bruno.

llvm-svn: 241505
2015-07-06 20:12:54 +00:00
Eric Fiselier 4cd59b3f49 Automatically detect and use clang verify in failure tests.
Automatically enable clang verify whenever the '-verify-ignore-unexpected' flag
is supported.
Failure tests are run using verify if they contain one or more "expected-*"
diagnostics tags. Otherwise they are run normally.

llvm-svn: 241492
2015-07-06 19:56:45 +00:00
Marshall Clow 3505fba35a Mark LWG#2420 as complete. Eric did this in r228705.
llvm-svn: 241491
2015-07-06 19:36:44 +00:00
Rafael Espindola cab827532e Swap operands instead of using !.
This avoids returning true for A == B.

Thanks to Benjamin Kramer for noticing it.

llvm-svn: 241490
2015-07-06 19:24:40 +00:00
Rafael Espindola 9c7a623015 Update for llvm change.
llvm-svn: 241489
2015-07-06 19:21:08 +00:00
Rafael Espindola e511051f4b When sorting by address, undefined symbols go first.
This matches gnu nm.

llvm-svn: 241488
2015-07-06 19:21:04 +00:00
Kuba Brecka 76cc55a94d [asan] Add OS X 10.11's new dyld interposition support
On OS X 10.11 (which is currently a public beta), the dynamic linker has been improved so that it doesn't require the use of DYLD_INSERT_LIBRARIES in order for interposition/wrappers to work. This patch adds support of this behavior into ASan – we no longer need to re-exec in case the env. variable is not set.

Reviewed at http://reviews.llvm.org/D10924

llvm-svn: 241487
2015-07-06 19:07:55 +00:00
Chaoren Lin bfa848cfa1 Use /proc/$$/stat instead of $PPID.
Summary: $PPID is not available on old shells.

Reviewers: tberghammer, ovyalov

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D10968

llvm-svn: 241486
2015-07-06 18:56:04 +00:00
Yaron Keren adce68ee88 Support -pthread in mingw toolchain.
"-pthread" appends -lpthread after the object files list passed to the linker.

llvm-svn: 241485
2015-07-06 18:52:19 +00:00
Rafael Espindola 63d10d6767 Reduce code duplication. NFC.
llvm-svn: 241484
2015-07-06 18:48:47 +00:00
Reid Kleckner fc0f93832b [llvm-extract] Drop comdats from declarations
The verifier rejects comdats on declarations.

llvm-svn: 241483
2015-07-06 18:48:02 +00:00
Enrico Granata c1f705c229 Add a GetDisplayName() API to SBFrame, SBFunction and SBSymbol
This API is currently a no-op (in the sense that it has the same behavior as the already existing GetName()), but is meant long-term to provide a best-for-visualization version of the name of a function

It is still not hooked up to the command line 'bt' command, nor to the 'gui' mode, but I do have ideas on how to make that work going forward

rdar://21203242

llvm-svn: 241482
2015-07-06 18:28:46 +00:00
Rui Ueyama 95dd08e4c9 COFF: Make ArchiveFile::getMember lock-free.
The previous code was not even safe with MSVC 2013 because the compiler
doesn't guarantee that static variables (in this case, a mutex) are
initialized in a thread-safe manner.

llvm-svn: 241481
2015-07-06 18:22:16 +00:00
Rafael Espindola 80c3354634 Fix printing of common symbols.
Printing the symbol size matches the behavior or both gnu nm and freebsd nm.

llvm-svn: 241480
2015-07-06 18:18:44 +00:00
Oleksiy Vyalov 298be46e3f Add --port-file flag to lldb-platform to store port number which platform is listening.
http://reviews.llvm.org/D10886

llvm-svn: 241479
2015-07-06 18:05:19 +00:00
Davide Italiano bf0f7757e2 [Sema] Warn when shifting a negative value.
Example:
 % ./clang -Wshift-negative-value emit.c
emit.c:3:14: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
  int a = -1 << 3;
          ~~ ^
1 warning generated.

PR:		24026
Differential Revision:	 http://reviews.llvm.org/D10938
Reviewed by:	rsmith

llvm-svn: 241478
2015-07-06 18:02:09 +00:00
Rui Ueyama 183f53fd22 COFF: Support isa<> for Symbol::Body, whose type is std::atomic<SymbolBody *>.
llvm-svn: 241477
2015-07-06 17:45:22 +00:00