oota-llvm.git
10 years agoFix typo, weird indentation
Matt Arsenault [Mon, 7 Jul 2014 18:34:42 +0000 (18:34 +0000)]
Fix typo, weird indentation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212472 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[testing]: lld generally lives in tools/, so fix llvm-lit.
Tim Northover [Mon, 7 Jul 2014 15:26:53 +0000 (15:26 +0000)]
[testing]: lld generally lives in tools/, so fix llvm-lit.

Otherwise we can't run individual tests directly ("llvm-lit /path/to/test")

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212461 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMake helper functions static.
Benjamin Kramer [Mon, 7 Jul 2014 14:47:51 +0000 (14:47 +0000)]
Make helper functions static.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212460 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoX86: revert unintentional change to X86FastISel.
Tim Northover [Mon, 7 Jul 2014 14:06:42 +0000 (14:06 +0000)]
X86: revert unintentional change to X86FastISel.

This crept in with r212443.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212459 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[asan] Generate asm instrumentation in MC.
Evgeniy Stepanov [Mon, 7 Jul 2014 13:57:37 +0000 (13:57 +0000)]
[asan] Generate asm instrumentation in MC.

Generate entire ASan asm instrumentation in MC without
relying on runtime helper functions.

Patch by Yuri Gorshenin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212455 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[msan] Fix handling of phi in blacklisted functions.
Evgeniy Stepanov [Mon, 7 Jul 2014 13:28:31 +0000 (13:28 +0000)]
[msan] Fix handling of phi in blacklisted functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212454 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoInstCombine: Simplify code, no functionality change.
Benjamin Kramer [Mon, 7 Jul 2014 11:01:16 +0000 (11:01 +0000)]
InstCombine: Simplify code, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212449 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[x86] Teach the new vector shuffle lowering code to handle what is
Chandler Carruth [Mon, 7 Jul 2014 09:06:58 +0000 (09:06 +0000)]
[x86] Teach the new vector shuffle lowering code to handle what is
essentially a DAG combine that never gets a chance to run.

We might typically expect DAG combining to remove shuffles-of-splats and
other similar patterns, but we don't get a chance to run the DAG
combiner when we recursively form sub-shuffles during the lowering of
a shuffle. So instead hand-roll a really important combine directly into
the lowering code to detect shuffles-of-splats, especially shuffles of
an all-zero splat which needn't even have the same element width, etc.

This lets the new vector shuffle lowering handle shuffles which
implement things like zero-extension really nicely. This will become
even more important when I wire the legalization of zero-extension to
vector shuffles with the new widening legalization strategy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212444 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCodeGen: it turns out that NAND is not the same thing as BIC. At all.
Tim Northover [Mon, 7 Jul 2014 09:06:35 +0000 (09:06 +0000)]
CodeGen: it turns out that NAND is not the same thing as BIC. At all.

We've been performing the wrong operation on ARM for "atomicrmw nand" for
years, since "a NAND b" is "~(a & b)" rather than ARM's very tempting "a & ~b".
This bled over into the generic expansion pass.

So I assume no-one has ever actually tried to do an atomic nand in the real
world. Oh well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212443 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM: properly lower dllimport'ed global values
Saleem Abdulrasool [Mon, 7 Jul 2014 05:18:35 +0000 (05:18 +0000)]
ARM: properly lower dllimport'ed global values

This completes the handling for DLL import storage symbols when lowering
instructions.  A DLL import storage symbol must have an additional load
performed prior to use.  This is applicable to variables and functions.

This is particularly important for non-function symbols as it is possible to
handle function references by emitting a thunk which performs the translation
from the unprefixed __imp_ symbol to the proper symbol (although, this is a
non-optimal lowering).  For a variable symbol, no such thunk can be
accommodated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212431 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM: correctly mangle dllimport symbols
Saleem Abdulrasool [Mon, 7 Jul 2014 05:18:30 +0000 (05:18 +0000)]
ARM: correctly mangle dllimport symbols

Add support for tracking DLLImport storage class information on a per symbol
basis in the ARM instruction selection.  Use that information to correctly
mangle the symbol (dllimport symbols are referenced via *__imp_<name>).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212430 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM: unify symbol name retrieval
Saleem Abdulrasool [Mon, 7 Jul 2014 05:18:22 +0000 (05:18 +0000)]
ARM: unify symbol name retrieval

Ensure that all paths that retrieve the symbol name go through GetARMGVSymbol
rather than getSymbol.  This is desirable so that any global symbol mangling can
be centralised to this function.  The motivation for this is handling of symbols
that are marked as having dll import dll storage.  Such a symbol requires an
extra load that is currently handled in the backend and a __imp_ prefix on the
symbol name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212429 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[AArch64] Normalize all constants to build a vector.
Kevin Qin [Mon, 7 Jul 2014 02:45:40 +0000 (02:45 +0000)]
[AArch64] Normalize all constants to build a vector.

The value of constant operands will be truncated to fit element width.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212428 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agofixed typos in comments
Sanjay Patel [Sun, 6 Jul 2014 23:24:53 +0000 (23:24 +0000)]
fixed typos in comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212424 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agofixed some typos in comments
Sanjay Patel [Sun, 6 Jul 2014 23:10:24 +0000 (23:10 +0000)]
fixed some typos in comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212423 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAArch64: whitespace cleanup
Saleem Abdulrasool [Sun, 6 Jul 2014 22:13:26 +0000 (22:13 +0000)]
AArch64: whitespace cleanup

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212420 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThese should be EXPECT_TRUE, not EXPECT_FALSE. Amends r212415.
Aaron Ballman [Sun, 6 Jul 2014 20:20:02 +0000 (20:20 +0000)]
These should be EXPECT_TRUE, not EXPECT_FALSE. Amends r212415.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212419 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFixing compile errors related to changes with MemoryBuffer::getFile.
Aaron Ballman [Sun, 6 Jul 2014 19:34:52 +0000 (19:34 +0000)]
Fixing compile errors related to changes with MemoryBuffer::getFile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212415 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate the MemoryBuffer API to use ErrorOr.
Rafael Espindola [Sun, 6 Jul 2014 17:43:13 +0000 (17:43 +0000)]
Update the MemoryBuffer API to use ErrorOr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212405 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDeclare variable on first use.
Rafael Espindola [Sun, 6 Jul 2014 14:31:22 +0000 (14:31 +0000)]
Declare variable on first use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212403 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThis only needs a StringRef.
Rafael Espindola [Sun, 6 Jul 2014 14:24:03 +0000 (14:24 +0000)]
This only needs a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212402 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThis only needs a StringRef.
Rafael Espindola [Sun, 6 Jul 2014 14:17:29 +0000 (14:17 +0000)]
This only needs a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212401 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix the MSVC build following r212382
Alp Toker [Sun, 6 Jul 2014 10:54:41 +0000 (10:54 +0000)]
Fix the MSVC build following r212382

Looks like the casts are needed there after all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212399 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSourceMgr: make valid buffer IDs start from one
Alp Toker [Sun, 6 Jul 2014 10:33:31 +0000 (10:33 +0000)]
SourceMgr: make valid buffer IDs start from one

Use 0 for the invalid buffer instead of -1/~0 and switch to unsigned
representation to enable more idiomatic usage.

Also introduce a trivial SourceMgr::getMainFileID() instead of hard-coding 0/1
to identify the main file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212398 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't use StringRef iterator functions for data access
Alp Toker [Sun, 6 Jul 2014 10:32:55 +0000 (10:32 +0000)]
Don't use StringRef iterator functions for data access

And also remove some redundant casts from r212371.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212397 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove IntrusiveRefCntPtr::getPtr() function
Alp Toker [Sat, 5 Jul 2014 22:20:59 +0000 (22:20 +0000)]
Remove IntrusiveRefCntPtr::getPtr() function

It was deprecated in r212366 and all uses have been switched to get().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212382 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse cast<> instead of dyn_cast + assert
Matt Arsenault [Sat, 5 Jul 2014 21:16:43 +0000 (21:16 +0000)]
Use cast<> instead of dyn_cast + assert

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212380 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix grammar
Matt Arsenault [Sat, 5 Jul 2014 21:16:40 +0000 (21:16 +0000)]
Fix grammar

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212379 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM: mark matching ARM intrinsics as MSBuiltin
Saleem Abdulrasool [Sat, 5 Jul 2014 20:09:24 +0000 (20:09 +0000)]
ARM: mark matching ARM intrinsics as MSBuiltin

A number of the ARM intrinsics are aliased with alternative names in MSVC
compatibility mode.  This change indicates those intrinsics to permit tablegen
to construct an appropriate list of MSBuiltins.  With the corresponding change
in clang, these intrinsics can then be mapped from the frontend.

The tests to validate the intrinsics are aliased correctly will be added with
the corresponding clang change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212377 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert r212375 because of test failures
Ehsan Akhgari [Sat, 5 Jul 2014 19:46:10 +0000 (19:46 +0000)]
Revert r212375 because of test failures

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212376 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd a test case for the tilde operator in Microsoft inline assembly
Ehsan Akhgari [Sat, 5 Jul 2014 19:40:35 +0000 (19:40 +0000)]
Add a test case for the tilde operator in Microsoft inline assembly

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212375 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[llvm-readobj] Fix output of MIPS GOT without local and global entries.
Simon Atanasyan [Sat, 5 Jul 2014 19:28:49 +0000 (19:28 +0000)]
[llvm-readobj] Fix output of MIPS GOT without local and global entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212374 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThis only needs a StringRef. No functionality change.
Rafael Espindola [Sat, 5 Jul 2014 11:38:52 +0000 (11:38 +0000)]
This only needs a StringRef. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212371 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoADT: Add a drop_back() helper to ArrayRef
David Majnemer [Sat, 5 Jul 2014 06:12:30 +0000 (06:12 +0000)]
ADT: Add a drop_back() helper to ArrayRef

The slice(N, M) interface is powerful but not concise when wanting to
drop a few elements off of an ArrayRef, fix this by adding a drop_back
method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212370 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDeprecate IntrusiveRefCntPtr::getPtr() in favour of get()
Alp Toker [Sat, 5 Jul 2014 03:03:21 +0000 (03:03 +0000)]
Deprecate IntrusiveRefCntPtr::getPtr() in favour of get()

This better aligns with other LLVM-specific and C++ standard library smart
pointer types.

In particular there are at least a few uses of intrusive refcounting in the
frontend where it's worth investigating std::shared_ptr as a more appropriate
alternative.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212366 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMC: make MCSymbolData::dump work on const objects
David Majnemer [Sat, 5 Jul 2014 00:39:52 +0000 (00:39 +0000)]
MC: make MCSymbolData::dump work on const objects

This just lets us dump a const MCSymbolData object, no functionality
changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212365 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMake a helper function static. No functionality change.
Rafael Espindola [Sat, 5 Jul 2014 00:39:08 +0000 (00:39 +0000)]
Make a helper function static. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212364 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMC: Correct comment in ExportSymbol
David Majnemer [Fri, 4 Jul 2014 23:20:46 +0000 (23:20 +0000)]
MC: Correct comment in ExportSymbol

No functionality changed, just make it so that the code _could_ be
uncommented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212363 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMC: Cleanup COFFAsmParser::ParseSectionFlags
David Majnemer [Fri, 4 Jul 2014 23:15:28 +0000 (23:15 +0000)]
MC: Cleanup COFFAsmParser::ParseSectionFlags

Switch a normal for-loop to a range-based for. No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212362 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMake RecordStreamer.h private.
Rafael Espindola [Fri, 4 Jul 2014 22:44:18 +0000 (22:44 +0000)]
Make RecordStreamer.h private.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212361 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoIR: Fold away compares between GV GEPs and GVs
David Majnemer [Fri, 4 Jul 2014 22:05:26 +0000 (22:05 +0000)]
IR: Fold away compares between GV GEPs and GVs

A GEP of a non-weak global variable will not be equivalent to another
non-weak global variable or a GEP of such a variable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212360 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix a bug in the conversion to ErrorOr.
Rafael Espindola [Fri, 4 Jul 2014 20:05:56 +0000 (20:05 +0000)]
Fix a bug in the conversion to ErrorOr.

The regular end of the bitcode parsing is in the  BitstreamEntry::EndBlock
case.

Should fix the LTO bootstrap on OS X (this function is only used by ld64).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212357 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert "Convert a few std::strings to StringRef."
Rafael Espindola [Fri, 4 Jul 2014 20:02:42 +0000 (20:02 +0000)]
Revert "Convert a few std::strings to StringRef."

This reverts commit r212342.

We can get a StringRef into the current Record, but not one in the bitcode
itself since the string is compressed in it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212356 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agofixed typos
Sanjay Patel [Fri, 4 Jul 2014 19:40:43 +0000 (19:40 +0000)]
fixed typos

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212355 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoIgnore llvm specific symbols in the LTOModule.
Rafael Espindola [Fri, 4 Jul 2014 19:31:27 +0000 (19:31 +0000)]
Ignore llvm specific symbols in the LTOModule.

These are the llvm.* globals and functions.

I don't think it is possible to test this directly since llvm-lto is not
a full linker and will not report duplicated symbols, but this fixes
bootstrap with gold and lto enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212354 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd support for parsing the not operator in Microsoft inline assembly
Ehsan Akhgari [Fri, 4 Jul 2014 19:13:05 +0000 (19:13 +0000)]
Add support for parsing the not operator in Microsoft inline assembly

This fixes http://llvm.org/PR20202

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212352 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoIgnore llvm.* globals.
Rafael Espindola [Fri, 4 Jul 2014 19:08:22 +0000 (19:08 +0000)]
Ignore llvm.* globals.

It is not clear if llvm.global_ctors should or should not be in llvm.metadata,
but in practice it is not and we need to ignore it for LTO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212351 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTableGen: introduce support for MSBuiltin
Saleem Abdulrasool [Fri, 4 Jul 2014 18:42:25 +0000 (18:42 +0000)]
TableGen: introduce support for MSBuiltin

Add MSBuiltin which is similar in vein to GCCBuiltin.  This allows for adding
intrinsics for Microsoft compatibility to individual instructions.  This is
needed to permit the creation of ARM specific MSVC extensions.

This is not currently in use, and requires an associated change in clang to
enable use of the intrinsics defined by this new class.  This merely sets the
LLVM portion of the infrastructure in place to permit the use of this
functionality.  A separate set of changes will enable the new intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212350 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoImplement LTOModule on top of IRObjectFile.
Rafael Espindola [Fri, 4 Jul 2014 18:40:36 +0000 (18:40 +0000)]
Implement LTOModule on top of IRObjectFile.

IRObjectFile provides all the logic for producing mangled names and getting
symbols from inline assembly.

LTOModule then adds logic for linking specific tasks, like constructing
llvm.compiler_user or extracting linker options from the bitcode.

The rule of the thumb is that IRObjectFile has the functionality that is
needed by both LTO and llvm-ar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212349 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAvoid mangling names twice. No functionality change.
Rafael Espindola [Fri, 4 Jul 2014 16:37:02 +0000 (16:37 +0000)]
Avoid mangling names twice. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212348 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMark intrinsic functions as llvm-specific.
Rafael Espindola [Fri, 4 Jul 2014 15:58:00 +0000 (15:58 +0000)]
Mark intrinsic functions as llvm-specific.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212347 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips][mips64r6] Set ELF e_flags for MIPS32r6/MIPS64r6. Also do MIPS-I to MIPS-V
Daniel Sanders [Fri, 4 Jul 2014 15:21:53 +0000 (15:21 +0000)]
[mips][mips64r6] Set ELF e_flags for MIPS32r6/MIPS64r6. Also do MIPS-I to MIPS-V

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212346 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips] Add tests for the 'ret', 'call', and 'indirectbr' LLVM IR instruction.
Daniel Sanders [Fri, 4 Jul 2014 15:16:14 +0000 (15:16 +0000)]
[mips] Add tests for the 'ret', 'call', and 'indirectbr' LLVM IR instruction.

Summary:
The tests in this directory are intended to test a single IR instruction
with as few dependencies on other instructions as possible. The aim is to
be very confident that each LLVM-IR instruction is implemented correctly and
with the optimal sequence of instructions, as well as to make it easy to tell
what is tested, and make it easier to bring up new ISA revisions in the
future. This gives us a good foundation on which to test bigger things.

These particular tests will allow testing that MIPS32r6/MIPS64r6 generate
the correct return instruction for returns, calls, and indirect branches.
This will be a bit tricky since the assembly text is identical but the
instruction is actually different. On MIPS32r6/MIPS64r6 'jr $rs' has been
removed in favour of the equivalent 'jalr $zero, $rs'. 'jr $rs' remains as
an alias for 'jalr $zero, $rs'.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212345 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't include llvm.metadata variables in archive symbol tables.
Rafael Espindola [Fri, 4 Jul 2014 15:03:17 +0000 (15:03 +0000)]
Don't include llvm.metadata variables in archive symbol tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212344 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoChange LTOModule`s getTargetTriple and setTargetTriple to use c++ types.
Rafael Espindola [Fri, 4 Jul 2014 14:19:41 +0000 (14:19 +0000)]
Change LTOModule`s getTargetTriple and setTargetTriple to use c++ types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212343 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoConvert a few std::strings to StringRef.
Rafael Espindola [Fri, 4 Jul 2014 14:12:46 +0000 (14:12 +0000)]
Convert a few std::strings to StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212342 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoConvert these functions to use ErrorOr.
Rafael Espindola [Fri, 4 Jul 2014 13:52:01 +0000 (13:52 +0000)]
Convert these functions to use ErrorOr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212341 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove unused old-style error handling.
Rafael Espindola [Fri, 4 Jul 2014 13:30:13 +0000 (13:30 +0000)]
Remove unused old-style error handling.

If needed, an ErrorOr should be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212340 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoGlobalDCE: Delete available_externally initializers if it allows removing the value...
Benjamin Kramer [Fri, 4 Jul 2014 12:36:05 +0000 (12:36 +0000)]
GlobalDCE: Delete available_externally initializers if it allows removing the value the initializer is referring to.

This is useful for functions that are not actually available externally but
referenced by a vtable of some kind. Clang emits functions like this for the MS
ABI.

PR20182.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212337 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agollvm/test/CodeGen/XCore/dwarf_debug.ll: Fix not to be affected by *-win32.
NAKAMURA Takumi [Fri, 4 Jul 2014 11:58:03 +0000 (11:58 +0000)]
llvm/test/CodeGen/XCore/dwarf_debug.ll: Fix not to be affected by *-win32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212335 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agollvm/test/CodeGen/X86/vector-gep.ll: Appease to add -mtriple=i686-linux.
NAKAMURA Takumi [Fri, 4 Jul 2014 11:55:40 +0000 (11:55 +0000)]
llvm/test/CodeGen/X86/vector-gep.ll: Appease to add -mtriple=i686-linux.

This doesn't pass if stack alignment is not 16, like cygming, *bsd.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212334 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM: when falling back to scattered relocs, keep the type.
Tim Northover [Fri, 4 Jul 2014 10:58:05 +0000 (10:58 +0000)]
ARM: when falling back to scattered relocs, keep the type.

The linker relies on relocation type info (e.g. is it a branch?) to perform the
correct actions, so we should keep that even when we end up using a scattered
relocation for whatever reason.

rdar://problem/17553104

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212333 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agollvm-readobj: fix MachO relocatoin printing a bit.
Tim Northover [Fri, 4 Jul 2014 10:57:56 +0000 (10:57 +0000)]
llvm-readobj: fix MachO relocatoin printing a bit.

There were two issues here:
1. At the very least, scattered relocations cannot use the same code to
   determine the corresponding symbol being referred to. For some reason we
   pretend there is no symbol, even when one actually exists in the symtab, so to
   match this behaviour getRelocationSymbol should simply return symbols_end for
   scattered relocations.
2. Printing "-" when we can't get a symbol (including the scattered case, but
   not exclusively), isn't that helpful. In both cases there *is* interesting
   information in that field, so we should print it. As hex will do.

Small part of rdar://problem/17553104

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212332 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoInstCombine: Strength reduce sadd.with.overflow into a regular nsw add if we can...
Benjamin Kramer [Fri, 4 Jul 2014 10:22:21 +0000 (10:22 +0000)]
InstCombine: Strength reduce sadd.with.overflow into a regular nsw add if we can prove that it cannot overflow.

PR20194

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212331 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips][mips64r6] Correct the encoding of dmuh, dmuhu, dmul, and dmulu.
Daniel Sanders [Fri, 4 Jul 2014 10:08:27 +0000 (10:08 +0000)]
[mips][mips64r6] Correct the encoding of dmuh, dmuhu, dmul, and dmulu.

We have detected a documentation bug in the encoding tables of the released
MIPS64r6 specification that has resulted in the wrong encodings being used for
these instructions in LLVM. This commit corrects them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212330 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPhabricator doc: Explicit the fact that the patch needs to be there before the commit
Sylvestre Ledru [Fri, 4 Jul 2014 09:00:35 +0000 (09:00 +0000)]
Phabricator doc: Explicit the fact that the patch needs to be there before the commit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212328 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[x86] Relax the line in this check to pacify build bots.
Chandler Carruth [Fri, 4 Jul 2014 08:39:30 +0000 (08:39 +0000)]
[x86] Relax the line in this check to pacify build bots.

I still don't love testing the comments, but its the only sane way to
check shuffle instructions...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212326 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[x86] Move some check lines to be slightly easier for me to find.
Chandler Carruth [Fri, 4 Jul 2014 08:19:37 +0000 (08:19 +0000)]
[x86] Move some check lines to be slightly easier for me to find.

(meant to put this cleanup in the previous patch, sorry)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212325 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[x86] Generalize BuildVectorSDNode::getConstantSplatValue to work for
Chandler Carruth [Fri, 4 Jul 2014 08:11:49 +0000 (08:11 +0000)]
[x86] Generalize BuildVectorSDNode::getConstantSplatValue to work for
any constant, constant FP, or undef splat and to tolerate any undef
lanes in a splat, then replace all uses of isSplatVector in X86's
lowering with it.

This fixes issues where undef lanes in an otherwise splat vector would
prevent the splat logic from firing. It is a touch more awkward to use
this interface, but it is much more accurate. Suggestions for better
interface structuring welcome.

With this fix, the code generated with the widening legalization
strategy for widen_cast-4.ll is *dramatically* improved as the special
lowering strategies for a v16i8 SRA kick in even though the high lanes
are undef.

We also get a slightly different choice for broadcasting an aligned
memory location, and use vpshufd instead of vbroadcastss. This looks
like a minor win for pipelining and domain crossing, but a minor loss
for the number of micro-ops. I suspect its a wash, but folks can easily
tweak the lowering if they want.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212324 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd an explicit bool operator to SDValue to make it easier to test for
Chandler Carruth [Fri, 4 Jul 2014 08:11:38 +0000 (08:11 +0000)]
Add an explicit bool operator to SDValue to make it easier to test for
a non-null node. In particular, this makes it easier to use condition
variables with SDValues, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212323 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[X86] Limit maximum nop length on Silvermont
Alexey Volkov [Fri, 4 Jul 2014 07:14:56 +0000 (07:14 +0000)]
[X86] Limit maximum nop length on Silvermont

Silvermont can only decode one instruction per cycle if the instruction exceeds 8 bytes.
Also in Silvermont instructions with more than 3 prefixes will cause 3 cycle penalty.
Maximum nop length is limited to 7 bytes when used for padding on Silvermont.
For other x86 processors max nop length remains unchanged 15 bytes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212321 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoXCore target: remove incorrect DebugLoc entries from prologue
Robert Lytton [Fri, 4 Jul 2014 06:38:22 +0000 (06:38 +0000)]
XCore target: remove incorrect DebugLoc entries from prologue

Summary: This was causing the prologue_end to be incorrectly positioned.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212318 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoLet test/Unit/lit.cfg add config.shlibdir to $PATH on DLL platforms like cygming.
NAKAMURA Takumi [Fri, 4 Jul 2014 05:11:55 +0000 (05:11 +0000)]
Let test/Unit/lit.cfg add config.shlibdir to $PATH on DLL platforms like cygming.

This makes unittests run with BUILD_SHARED_LIBS on DLL platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212316 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[CMake] Introduce LLVM_ENABLE_PLUGINS as an internal option. BUILD_SHARED_LIBS may...
NAKAMURA Takumi [Fri, 4 Jul 2014 04:45:40 +0000 (04:45 +0000)]
[CMake] Introduce LLVM_ENABLE_PLUGINS as an internal option. BUILD_SHARED_LIBS may not control enable/disable plugins.

FIXME: Make this configurable.

FIXME: "ENABLE_SHARED" doesn't make sense, since it is used just for plugins. We may rename it.
I introduced config.enable_shared in r120273.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212315 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[CMake] Introduce LLVM_SHLIB_OUTPUT_INTDIR.
NAKAMURA Takumi [Fri, 4 Jul 2014 04:23:26 +0000 (04:23 +0000)]
[CMake] Introduce LLVM_SHLIB_OUTPUT_INTDIR.

For now, its user is configure_lit_site_cfg().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212314 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[CMake] Fix set_output_directory to do nothing if *_OUTPUT_INTDIR was not given.
NAKAMURA Takumi [Fri, 4 Jul 2014 04:23:15 +0000 (04:23 +0000)]
[CMake] Fix set_output_directory to do nothing if *_OUTPUT_INTDIR was not given.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212313 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix prefix comparison from r212308
Alp Toker [Fri, 4 Jul 2014 02:01:54 +0000 (02:01 +0000)]
Fix prefix comparison from r212308

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212310 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove function dependent resetting of a subtarget variable out of the
Eric Christopher [Fri, 4 Jul 2014 01:55:26 +0000 (01:55 +0000)]
Move function dependent resetting of a subtarget variable out of the
subtarget. This involved having the movt predicate take the current
function - since we care about size in instruction selection for
whether or not to use movw/movt take the function so we can check
the attributes. This required adding the current MachineFunction to
FastISel and propagating through.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212309 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSink undesirable LTO functions into the old C API
Alp Toker [Fri, 4 Jul 2014 00:58:41 +0000 (00:58 +0000)]
Sink undesirable LTO functions into the old C API

We want to encourage users of the C++ LTO API to reuse memory buffers instead
of repeatedly opening and reading the same file contents.

This reverts commit r212305 and implements a tidier scheme.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212308 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoInstSimplify: Fix a bug when INT_MIN is in a sdiv
David Majnemer [Fri, 4 Jul 2014 00:23:39 +0000 (00:23 +0000)]
InstSimplify: Fix a bug when INT_MIN is in a sdiv

When INT_MIN is the numerator in a sdiv, we would not properly handle
overflow when calculating the bounds of possible values; abs(INT_MIN) is
not a meaningful number.

Instead, check and handle INT_MIN by reasoning that the largest value is
INT_MIN/-2 and the smallest value is INT_MIN.

This fixes PR20199.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212307 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoModify LTOModule::isTargetMatch to take a StringRef instead of a MemoryBuffer.
Peter Collingbourne [Thu, 3 Jul 2014 23:49:28 +0000 (23:49 +0000)]
Modify LTOModule::isTargetMatch to take a StringRef instead of a MemoryBuffer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212305 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agogold plugin: move target initialization to the top of the onload function.
Peter Collingbourne [Thu, 3 Jul 2014 23:28:03 +0000 (23:28 +0000)]
gold plugin: move target initialization to the top of the onload function.

On at least my machine, ar does not register an all symbols read hook (which
previously triggered target initialization), but it does register a claim
files hook, which depends on the targets being initialized.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212303 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoLTO: rename the various makeLTOModule overloads.
Peter Collingbourne [Thu, 3 Jul 2014 23:28:00 +0000 (23:28 +0000)]
LTO: rename the various makeLTOModule overloads.

This rename makes it easier to identify the specific overload being called
in each particular case and makes future refactorings easier.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212302 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove createIRObjectFile to the IRObjectFile class and return the concrete type.
Rafael Espindola [Thu, 3 Jul 2014 23:03:50 +0000 (23:03 +0000)]
Move createIRObjectFile to the IRObjectFile class and return the concrete type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212301 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[x86] Clarify that this lowering only applies to vectors and is only
Chandler Carruth [Thu, 3 Jul 2014 22:57:44 +0000 (22:57 +0000)]
[x86] Clarify that this lowering only applies to vectors and is only
used when we have SSE2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212300 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse std::unique_ptr to manage memory. No functionality change.
Rafael Espindola [Thu, 3 Jul 2014 22:43:03 +0000 (22:43 +0000)]
Use std::unique_ptr to manage memory. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212299 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTemporarily revert "Don't try to construct debug LexicalScopes hierarchy for function...
Eric Christopher [Thu, 3 Jul 2014 22:24:54 +0000 (22:24 +0000)]
Temporarily revert "Don't try to construct debug LexicalScopes hierarchy for functions that do not have top level debug information." as it appears to be breaking some LTO constructs.

This reverts commit r212203.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212298 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove caching of the target machine and initialization of the
Eric Christopher [Thu, 3 Jul 2014 22:24:49 +0000 (22:24 +0000)]
Remove caching of the target machine and initialization of the
subtarget from ARMISelDAGtoDAG. The former is unnecessary and the
latter is initialized on each runOnMachineFunction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212297 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[CostModel][x86] Improved cost model for alternate shuffles.
Andrea Di Biagio [Thu, 3 Jul 2014 22:24:18 +0000 (22:24 +0000)]
[CostModel][x86] Improved cost model for alternate shuffles.

This patch:
 1) Improves the cost model for x86 alternate shuffles (originally
added at revision 211339);
 2) Teaches the Cost Model Analysis pass how to analyze alternate shuffles.

Alternate shuffles are a special kind of blend; on x86, we can often
easily lowered alternate shuffled into single blend
instruction (depending on the subtarget features).

The existing cost model didn't take into account subtarget features.
Also, it had a couple of "dead" entries for vector types that are never
legal (example: on x86 types v2i32 and v2f32 are not legal; those are
always either promoted or widened to 128-bit vector types).

The new x86 cost model takes into account what target features we have
before returning the shuffle cost (i.e. the number of instructions
after the blend is lowered/expanded).

This patch also teaches the Cost Model Analysis how to identify and analyze
alternate shuffles (i.e. 'SK_Alternate' shufflevector instructions):
 - added function 'isAlternateVectorMask';
 - added some logic to check if an instruction is a alternate shuffle and, in
   case, call the target specific TTI to get the corresponding shuffle cost;
 - added a test to verify the cost model analysis on alternate shuffles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212296 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd the -just-symbol-name (aka -j) flag to llvm-nm to just print the
Kevin Enderby [Thu, 3 Jul 2014 21:51:07 +0000 (21:51 +0000)]
Add the -just-symbol-name (aka -j) flag to llvm-nm to just print the
symbol’s name.  On darwin the -j flag is used (often in combinations
with other flags) to produce a complete list of symbol names which
than can then be reorder and used with ld(1)’s -order_file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212294 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[X86] Add ISel patterns to select 'f32_to_f16' and 'f16_to_f32' dag nodes.
Andrea Di Biagio [Thu, 3 Jul 2014 21:51:06 +0000 (21:51 +0000)]
[X86] Add ISel patterns to select 'f32_to_f16' and 'f16_to_f32' dag nodes.

This patch adds tablegen patterns to select F16C float-to-half-float
conversion instructions from 'f32_to_f16' and 'f16_to_f32' dag nodes.

If the target doesn't have F16C, then 'f32_to_f16' and 'f16_to_f32'
are expanded into library calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212293 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoExpand the note about llvm-ar now that inline asm works.
Rafael Espindola [Thu, 3 Jul 2014 21:34:25 +0000 (21:34 +0000)]
Expand the note about llvm-ar now that inline asm works.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212292 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove test since it now depends on the x86 backend.
Rafael Espindola [Thu, 3 Jul 2014 20:26:21 +0000 (20:26 +0000)]
Move test since it now depends on the x86 backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212289 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoLTO depends on Object now.
Rafael Espindola [Thu, 3 Jul 2014 20:19:03 +0000 (20:19 +0000)]
LTO depends on Object now.

Fixes the build with only the ARM backend enabled. For some reason some
other backend was pulling Object and this went unnoticed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212288 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd support for inline asm symbols in llvm-ar.
Rafael Espindola [Thu, 3 Jul 2014 19:40:08 +0000 (19:40 +0000)]
Add support for inline asm symbols in llvm-ar.

This should allow llvm-ar to be used instead of gnu ar + plugin in a LTO
build. I will add a release note about it once I finish a LTO bootstrap with it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212287 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRun interprocedural const prop before global optimizer
Gerolf Hoflehner [Thu, 3 Jul 2014 19:28:15 +0000 (19:28 +0000)]
Run interprocedural const prop before global optimizer

Exposes more constant globals that can be removed by
the global optimizer. A specific example is the removal
of the static global block address array in
clang/test/CodeGen/indirect-goto.c. This change impacts only
lower optimization levels. With LTO interprocedural
const prop runs already before global opt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212284 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agofix configure+make build
Rafael Espindola [Thu, 3 Jul 2014 19:09:53 +0000 (19:09 +0000)]
fix configure+make build

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212283 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd support for inline asm symbols to IRObjectFile.
Rafael Espindola [Thu, 3 Jul 2014 18:59:23 +0000 (18:59 +0000)]
Add support for inline asm symbols to IRObjectFile.

This also enables it in llvm-nm so that it can be tested.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212282 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd the -U flag to llvm-nm as an alias to -defined-only
Kevin Enderby [Thu, 3 Jul 2014 18:18:50 +0000 (18:18 +0000)]
Add the -U flag to llvm-nm as an alias to -defined-only
as darwin’s nm(1) uses -U for this functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212280 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agofixed typo in comment
Sanjay Patel [Thu, 3 Jul 2014 16:17:20 +0000 (16:17 +0000)]
fixed typo in comment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212279 91177308-0d34-0410-b5e6-96231b3b80d8