Commit Graph

81342 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith
dfcac4b07a MC: Constify MCSubtargetInfo in getDeprecationInfo(), NFC
There's no reason to be able to mutate `MCSubtargetInfo` in
`getDeprecationInfo()`.  Constify the reference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241693 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 17:30:55 +00:00
Rafael Espindola
4ea795b15a Inline function into only use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241692 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 17:26:24 +00:00
Rafael Espindola
9ff2cd5417 Add a helper function to reduce a bit of code duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241691 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 17:08:26 +00:00
Eli Bendersky
e933e5bd08 Cosmetic cleanups - NFC
Remove commented lines, trailing whitespace, etc.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241687 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 16:33:21 +00:00
James Y Knight
8eb1aaac9c [SPARC] Cleanup handling of the Y/ASR registers.
- Implement copying ASR to/from GPR regs.
- Mark ASRs as non-allocatable, so it won't try to arbitrarily use
  them inappropriately.
- Instead of inserting explicit WRASR/RDASR nodes in the MUL/DIV
  routines, just do normal register copies.
- Also...mark div as using Y, not just writing it.

Added a test case with some code which previously died with an
assertion failure (with -O0), or produced wrong code (otherwise).

(Third time's the charm?)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241686 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 16:25:12 +00:00
Rafael Espindola
cf8f6a296f Use a range loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241685 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 16:16:15 +00:00
Krzysztof Parzyszek
e7f45f66a7 [Hexagon] Generate "insert" instructions more aggressively
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241683 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 14:47:34 +00:00
Krzysztof Parzyszek
5d447e9c2a Revert 241681: causes Windows builds to fail
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241682 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 14:34:13 +00:00
Krzysztof Parzyszek
ea2273d00c [Hexagon] Generate "insert" instructions more aggressively
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241681 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 14:22:27 +00:00
Silviu Baranga
8bde857088 [LAA] Merge memchecks for accesses separated by a constant offset
Summary:
Often filter-like loops will do memory accesses that are
separated by constant offsets. In these cases it is
common that we will exceed the threshold for the
allowable number of checks.

However, it should be possible to merge such checks,
sice a check of any interval againt two other intervals separated
by a constant offset (a,b), (a+c, b+c) will be equivalent with
a check againt (a, b+c), as long as (a,b) and (a+c, b+c) overlap.
Assuming the loop will be executed for a sufficient number of
iterations, this will be true. If not true, checking against
(a, b+c) is still safe (although not equivalent).

As long as there are no dependencies between two accesses,
we can merge their checks into a single one. We use this
technique to construct groups of accesses, and then check
the intervals associated with the groups instead of
checking the accesses directly.

Reviewers: anemet

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241673 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 09:16:33 +00:00
Simon Pilgrim
796a06d4eb [X86][SSE] Added (V)ROUNDSD + (V)ROUNDSS stack folding support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241671 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 08:07:57 +00:00
Karthik Bhat
d9dffa6b3c Allow constfolding of llvm.sin.* and llvm.cos.* intrinsics
This patch const folds llvm.sin.* and llvm.cos.* intrinsics whenever feasible.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241665 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 03:55:47 +00:00
Mehdi Amini
7bcdaa6978 Remove IsLittleEndian from TargetLowering and redirect to DataLayout
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: llvm-commits, rafael, yaron.keren

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241655 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 01:00:38 +00:00
Mehdi Amini
564bfad782 Redirect DataLayout from TargetMachine to Module in SjLjEHPrepare
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: yaron.keren, rafael, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241654 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 01:00:31 +00:00
Reid Kleckner
39ee70ca76 [WinEH] Make llvm.x86.seh.restoreframe work for stack realignment prologues
The incoming EBP value points to the end of a local stack allocation, so
we can use that to restore ESI, the base pointer. Once we do that, we
can use local stack allocations. If we know we need stack realignment,
spill the original frame pointer in the prologue and reload it after
restoring ESI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241648 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 23:45:58 +00:00
Mehdi Amini
c845b4d7be Redirect DataLayout from TargetMachine to Module in StackProtector
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: llvm-commits, rafael, yaron.keren

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241646 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 23:38:49 +00:00
Alex Lorenz
aa0d6db1e7 MIR Printer: Use a module slot tracker to print global address operands. NFC.
This commit adopts the 'ModuleSlotTracker' class, which was surfaced in r240842,
to print the global address operands. This change ensures that the slot tracker
won't have to be recreated every time a global address operand is printed,
making the MIR printing more efficient.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241645 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 23:27:53 +00:00
Reid Kleckner
4fe74caa61 [WinEH] Add localaddress intrinsic instead of using frameaddress
Clang uses this for SEH finally. The new intrinsic will produce the
right value when stack realignment is required.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241643 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 23:23:03 +00:00
Arnold Schwaighofer
39fe55270a Add more nvcasts
Tim Northover has told me that they can occur when the compiler cleverly
constructs constants - as demonstrated in the test case.

rdar://21703486

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241641 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 23:13:18 +00:00
Dan Gohman
8ef6f1e24b [WebAssembly] Set the scheduling preference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241637 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 22:38:06 +00:00
Reid Kleckner
8f32e5f0d6 Rename llvm.frameescape and llvm.framerecover to localescape and localrecover
Summary:
Initially, these intrinsics seemed like part of a family of "frame"
related intrinsics, but now I think that's more confusing than helpful.
Initially, the LangRef specified that this would create a new kind of
allocation that would be allocated at a fixed offset from the frame
pointer (EBP/RBP). We ended up dropping that design, and leaving the
stack frame layout alone.

These intrinsics are really about sharing local stack allocations, not
frame pointers. I intend to go further and add an `llvm.localaddress()`
intrinsic that returns whatever register (EBP, ESI, ESP, RBX) is being
used to address locals, which should not be confused with the frame
pointer.

Naming suggestions at this point are welcome, I'm happy to re-run sed.

Reviewers: majnemer, nicholas

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 22:25:32 +00:00
Sanjay Patel
dd5fd545b1 fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241629 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 21:31:54 +00:00
Alex Lorenz
78bc2545c9 MIR Serialization: Serialize the 'dead' register machine operand flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241624 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 20:34:53 +00:00
Mehdi Amini
298a718c94 Redirect DataLayout from TargetMachine to Module in SelectionDAG
Summary:
SelectionDAG itself is not invoking directly the DataLayout in the
TargetMachine, but the "TargetLowering" class is still using it. I'll
address it in a following commit.

This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241618 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 19:07:19 +00:00
David Majnemer
0148a4c854 Revert "Revert r241570, it caused PR24053"
This reverts commit r241602.  We had a latent bug in SCCP where we would
make a basic block empty and then proceed to ask questions about it's
terminator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241616 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 18:49:41 +00:00
Mehdi Amini
a77796487b Redirect DataLayout from TargetMachine to Module in GlobalMerge
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241615 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 18:49:25 +00:00
Mehdi Amini
d888ac430d Redirect DataLayout from TargetMachine to Module in CodeGen Prepare
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241614 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 18:45:17 +00:00
Mehdi Amini
26a2a4b4ed Redirect DataLayout from TargetMachine to Module in FastISel
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241613 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 18:39:02 +00:00
Arnold Schwaighofer
f869ca86f1 Add a pattern for a nvcast from v2f64 -> v4f32
Since the NvCast is generated by the selection process the concerns about
endianess and bit reversal don't apply.

rdar://21703486

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241611 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 18:31:55 +00:00
Mehdi Amini
33c4d685e3 Redirect DataLayout from TargetMachine to Module in MachineFunction
Summary:
This change is part of a series of commits dedicated to have a
single DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241610 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 18:20:57 +00:00
Reid Kleckner
d0c71cfdf6 Use default member initializers to deduplicate code in X86MachineFunctionInfo, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241609 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 18:12:06 +00:00
Rafael Espindola
51652580f4 Fix the -DBUILD_SHARED_LIBS=ON build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241608 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 17:48:00 +00:00
Alex Lorenz
ddc6f0a433 MIR Parser: wrap 'MBBSlots' from the MI parsing functions in a struct. NFC.
This commit modifies the interface for the machine instruction parsing
functions by wrapping the parameter 'MBBSlots' in a new structure called
'PerFunctionMIParsingState'. This change is useful as in the future I will be
able to pass new parameters to the machine instruction parser just by modifying
the 'PerFunctionMIParsingState' structure instead of adding a new parameter to
each function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241607 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 17:46:43 +00:00
Rafael Espindola
7b7c81cd35 Delete UnknownAddress. It is a perfectly valid symbol value.
getSymbolValue now returns a value that in convenient for most callers:
* 0 for undefined
* symbol size for common symbols
* offset/address for symbols the rest

Code that needs something more specific can check getSymbolFlags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241605 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 17:12:59 +00:00
Rafael Espindola
9327084f92 Simplify by passing in the section of the symbol. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241603 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 16:45:55 +00:00
Nico Weber
1a2abd4a90 Revert r241570, it caused PR24053
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241602 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 16:42:50 +00:00
Krzysztof Parzyszek
70bb40bd17 [Hexagon] Fix unused variable warnings in NDEBUG build caused by r241595
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241600 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 16:02:11 +00:00
Reid Kleckner
db38d7657a [WinEH] Add a report_fatal_error for 32-bit stack realignment
This type of prologue isn't supported yet. Implementing it should be a
matter of copying the adjusted incoming EBP into ESI (the base pointer)
instead of EBP.  The original EBP can be saved and restored from other
memory afterwards.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241597 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 15:47:29 +00:00
Krzysztof Parzyszek
41e59a6d7b [Hexagon] Implement bit-tracking facility with specifics for Hexagon
This includes code that is intended to be target-independent as well
as the Hexagon-specific details. This is just the framework without
any users.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241595 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 15:16:42 +00:00
Rafael Espindola
9ca3a03969 Common symbols don't have a value.
At least not in the interface exposed by ObjectFile. This matches what ELF and
COFF implement.

Adjust existing code that was expecting them to have values. No overall
functionality change intended.

Another option would be to change the interface and the ELF and COFF
implementations to say that the value of a common symbol is its size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241593 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 15:05:09 +00:00
Sanjay Patel
08c4cbeeae use range-based for loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241592 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 15:03:53 +00:00
Rafael Espindola
8b3aaabd30 Common symbols are not undefined, at least for ObjectFile.
They are implemented like that in some object formats, but for the interface
provided by lib/Object, SF_Undefined and SF_Common are different things.

This matches the ELF and COFF implementation and fixes llvm-nm for MachO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241587 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 14:26:39 +00:00
Rafael Espindola
6b24d0a9a7 Simplify, NFC.
In these two contexts we really just want the raw n_value. No need to use
getSymbolValue which checks for special cases where, semantically, the symbol
has no value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241584 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 13:58:32 +00:00
David Majnemer
2822246ece [IR] Make getFirstNonPHI return null if the BB is empty
getFirstNonPHI's documentation states that it returns null if there is
no non-PHI instruction.  However, it instead returns a pointer to the
end iterator.  The implementation of getFirstNonPHI claims that
dereferencing the iterator will result in an assertion failure but this
doesn't occur.  Instead, machinery like getFirstInsertionPt will attempt
to isa<> this invalid memory which results in unpredictable behavior.
Instead, make getFirst* return null if no such instruction exists.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241570 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 09:15:29 +00:00
Denis Protivensky
2b4a535b70 Fix gcc warnings of different enum and non-enum types in ternaries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241567 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 07:48:48 +00:00
Akira Hatanaka
a744879a65 [ARM] Define a subtarget feature and use it to decide whether long calls should
be emitted.

This is needed to enable ARM long calls for LTO and enable and disable it on a
per-function basis.

Out-of-tree projects currently using EnableARMLongCalls to emit long calls
should start passing "+long-calls" to the feature string (see the changes made
to clang in r241565).

rdar://problem/21529937

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241566 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 06:54:42 +00:00
Alex Lorenz
d0ef9f3115 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241537 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 02:08:46 +00:00
Juergen Ributzka
b062a9b411 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241536 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 02:05:18 +00:00
Juergen Ributzka
083b791eaf [StackMap Liveness] No need to cache the MachineFunction. NFC.
Don't cache the MachineFunction in the pass and range'ify some loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241535 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 02:05:15 +00:00
Benjamin Kramer
32f3dc455b [Triple] Add a helper to switch between big/little endian variants
This will be used from clang's driver.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241527 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 23:58:14 +00:00
Sanjoy Das
0b1bc70dbf [FaultMaps] Add statistic to count the # of implicit null checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241521 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 23:32:10 +00:00
Alex Lorenz
4ec0f60807 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241519 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 23:07:26 +00:00
Eric Christopher
ddf4c989ee Remove JumpInstrTableInfo.h as it is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241517 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 22:55:20 +00:00
Simon Pilgrim
315fd86400 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241516 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 22:46:46 +00:00
Sanjay Patel
75a2ce3271 [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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241515 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 22:35:29 +00:00
Simon Pilgrim
6970be03d1 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241514 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 22:35:19 +00:00
JF Bastien
610992baca WebAssembly: add some TODO
Reviewers: sunfish

Subscribers: llvm-commits, jfb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241513 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 21:41:59 +00:00
Reid Kleckner
e23370402c [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241509 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 21:13:43 +00:00
Simon Pilgrim
3ecdd44e5d [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241508 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 20:46:41 +00:00
Simon Pilgrim
ecb00f403c [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241506 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 20:30:47 +00:00
Quentin Colombet
4bde0fa367 [TwoAddressInstructionPass] Rename a variable to match the coding style.
Spot by Bruno.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241505 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 20:12:54 +00:00
Reid Kleckner
f0101b2d60 [llvm-extract] Drop comdats from declarations
The verifier rejects comdats on declarations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241483 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 18:48:02 +00:00
Alex Lorenz
edfa571cbd llc: Add a 'run-pass' option.
This commit adds a 'run-pass' option to llc, which instructs the compiler to run
one specific code generation pass only.

Llc already has the 'start-after' and the 'stop-after' options, and this new
option complements the other two by making it easier to write tests that want
to invoke a single pass only.

Reviewers: Duncan P. N. Exon Smith

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241476 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 17:44:26 +00:00
Matt Arsenault
b560f9ca2f AMDGPU: Run SIInsertWaits as pre-emit pass
Running this after the scheduler enables scheduling
waits later so other ALU instructions can run while
this would be waiting.

When combined with enabling the post-RA scheduler, this
gives about a ~20% improvement on sgemm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241473 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 17:02:20 +00:00
Daniel Sanders
96fe9196e9 Change the last few internal StringRef triples into Triple objects.
Summary:
This concludes the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

At this point, the StringRef-form of GNU Triples should only be used in the
public API (including IR serialization) and a couple objects that directly
interact with the API (most notably the Module class). The next step is to
replace these Triple objects with the TargetTuple object that will represent
our authoratative/unambiguous internal equivalent to GNU Triples.

Reviewers: rengolin

Subscribers: llvm-commits, jholewinski, ted, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241472 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 16:56:07 +00:00
Adrian Prantl
9d4ce7c110 DIBuilder: Don't rauw null pointers with empty arrays in finalize().
This makes the IR a little easier to read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241470 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 16:36:02 +00:00
Daniel Sanders
24a1fec2a7 Where Triple has a suitable predicate, use it rather than the enum values. NFC.
Reviewers: mcrosier

Subscribers: llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241469 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 16:33:18 +00:00
Sanjay Patel
a71390ff3b use range-based for loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241468 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 16:27:35 +00:00
Teresa Johnson
3d41fcb3da Resubmit "Add new EliminateAvailableExternally module pass" (r239480)
This change includes a fix for https://code.google.com/p/chromium/issues/detail?id=499508#c3,
which required updating the visibility for symbols with eliminated definitions.

--Original Commit Message--

Add new EliminateAvailableExternally module pass, which is performed in
O2 compiles just before GlobalDCE, unless we are preparing for LTO.

This pass eliminates available externally globals (turning them into
declarations), regardless of whether they are dead/unreferenced, since
we are guaranteed to have a copy available elsewhere at link time.
This enables additional opportunities for GlobalDCE.

If we are preparing for LTO (e.g. a -flto -c compile), the pass is not
included as we want to preserve available externally functions for possible
link time inlining. The FE indicates whether we are doing an -flto compile
via the new PrepareForLTO flag on the PassManagerBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241466 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 16:22:42 +00:00
Adrian Prantl
e91246ae8c Use an early exit in DIBuilder::finalize() to improve readability.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241465 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 16:22:12 +00:00
Sanjay Patel
98d447c206 use range-based for loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241463 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 16:19:14 +00:00
Matt Arsenault
6fe7acaaf8 AMDGPU/SI: Add debugging subtarget feature for DS offsets
We don't have a good way to detect most situations where
DS offsets are usable on SI, so add an option to force using
them even if unsafe for debugging performance problems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241462 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 16:01:58 +00:00
James Y Knight
067b86fcab [Sparc] Add more instruction aliases.
These are mostly from the chart in the SparcV8 spec, section "A.3
Synthetic Instructions".

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241461 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 16:01:07 +00:00
James Y Knight
d32974f9dc [Sparc] Add support for flush instruction.
Differential Revision: http://reviews.llvm.org/D9833

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241460 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 16:01:04 +00:00
Rafael Espindola
c2966a3ac7 Remove getRelocationAddress.
Originally added in r139314.

Back then it didn't actually get the address, it got whatever value the
relocation used: address or offset.

The values in different object formats are:

* MachO: Always an offset.
* COFF: Always an address, but when talking about the virtual address of
  sections it says: "for simplicity, compilers should set this to zero".
* ELF: An offset for .o files and and address for .so files. In the case of the
  .so, the relocation in not linked to any section (sh_info is 0). We can't
  really compute an offset.

Some API mappings would be:

* Use getAddress for everything. It would be quite cumbersome. To compute the
  address elf has to follow sh_info, which can be corrupted and therefore the
  method has to return an ErrorOr. The address of the section is also the same
  for every relocation in a section, so we shouldn't have to check the error
  and fetch the value for every relocation.

* Use a getValue and make it up to the user to know what it is getting.

* Use a getOffset and:
 * Assert for dynamic ELF objects. That is a very peculiar case and it is
   probably fair to ask any tool that wants to support it to use ELF.h. The
   only tool we have that reads those (llvm-readobj) already does that. The
   only other use case I can think of is a dynamic linker.
 * Check that COFF .obj files have sections with zero virtual address spaces. If
   it turns out that some assembler/compiler produces these, we can change
   COFFObjectFile::getRelocationOffset to subtract it. Given COFF format,
   this can be done without the need for ErrorOr.

The getRelocationAddress method was never implemented for COFF. It also
had exactly one use in a very peculiar case: a shortcut for adding the
section value to a pcrel reloc on MachO.

Given that, I don't expect that there is any use out there of the C API. If
that is not the case, let me know and I will add it back with the implementation
inlined and do a proper deprecation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241450 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 14:55:37 +00:00
Chad Rosier
ac244651b2 Fix a bug in the A57FPLoadBalancing register tracking/scavenger.
The code in AArch64A57FPLoadBalancing::scavengeRegister() to handle dead defs
was not correctly handling aliased registers.  E.g. if the dead def was of D2,
then S2 was not being marked as unavailable, so it could potentially be used
across a live-range in which it would be clobbered.

Patch by Geoff Berry <gberry@codeaurora.org>!
Phabricator: http://reviews.llvm.org/D10900


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241449 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 14:46:34 +00:00
Rafael Espindola
159946938f Check that COFF .obj files have sections with zero virtual address spaces.
When talking about the virtual address of sections the coff spec says:
  ... for simplicity, compilers should set this to zero. Otherwise, it is an
  arbitrary value that is subtracted from offsets during relocation.

We don't currently subtract it, so check that it is zero.

If some producer does create such files, we can change getRelocationOffset
instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241447 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 14:26:07 +00:00
Asaf Badouh
169ee3383c [X86][AVX512] Multiply Packed Unsigned Integers with Round and Scale
pmulhrsw

review:
http://reviews.llvm.org/D10948

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241443 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 14:03:40 +00:00
Petar Jovanovic
d095a756cc [Mips] Add support for MCJIT for MIPS32r6
Add support for resolving MIPS32r6 relocations in MCJIT.

Patch by Vladimir Radosavljevic.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241442 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 12:50:55 +00:00
Craig Topper
fade2f72b8 [TableGen] Change a couple methods to return an ArrayRef instead of a const std::vector reference. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241430 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 06:23:01 +00:00
Sanjay Patel
2a1f755c06 remove unnecessary temp variable; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241415 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-05 21:21:47 +00:00
Peter Collingbourne
cf47c180e1 Verifier: Forbid comdats on linker declarations.
Differential Revision: http://reviews.llvm.org/D10945

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241414 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-05 20:52:40 +00:00
Peter Collingbourne
ce2b45bd7d IR: Do not consider available_externally linkage to be linker-weak.
From the linker's perspective, an available_externally global is equivalent
to an external declaration (per isDeclarationForLinker()), so it is incorrect
to consider it to be a weak definition.

Also clean up some logic in the dead argument elimination pass and clarify
its comments to better explain how its behavior depends on linkage,
introduce GlobalValue::isStrongDefinitionForLinker() and start using
it throughout the optimizers and backend.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241413 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-05 20:52:35 +00:00
Sanjay Patel
3b19ca3a2e use range-based for loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241412 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-05 20:15:21 +00:00
Benjamin Kramer
54b3b4c15e [TargetLowering] StringRefize asm constraint getters.
There is some functional change here because it changes target code from
atoi(3) to StringRef::getAsInteger which has error checking. For valid
constraints there should be no difference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241411 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-05 19:29:18 +00:00
Asaf Badouh
5047893c31 [x86][AVX512] add Multiply High Op
include encoding and intrinsics tests.

review
http://reviews.llvm.org/D10896

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241406 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-05 12:23:20 +00:00
Michael Kuperstein
bb803fd76e [X86] Fix incorrect/inefficient pushw encodings for x86-64 targets
Correctly support assembling "pushw $imm8" on x86-64 targets. 
Also some cleanup of the PUSH instructions (PUSH64i16 and PUSHi16 actually
represent the same instruction)

This fixes PR23996

Patch by: david.l.kreitzer@intel.com
Differential Revision: http://reviews.llvm.org/D10878

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241404 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-05 10:25:41 +00:00
Nemanja Ivanovic
8be316bf23 Add missing builtins to the PPC back end for ABI compliance (vol. 2)
This patch corresponds to review:
http://reviews.llvm.org/D10874

Back end portion of the second round of additions to altivec.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241398 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-05 06:03:51 +00:00
Sanjay Patel
8720b26a58 use range-based for loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241395 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-04 19:38:52 +00:00
Simon Pilgrim
4606f6d8da [X86][SSE] Improved i8/i16 to f64 uint2fp vector conversions
Followup to D10433 and D10589 that fixes i8/i16 uint2fp vector conversions by zero extending to i32 and using the sint2fp path (unless the target does actually support uint2fp).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241394 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-04 15:33:34 +00:00
Sanjay Patel
2244d521c0 use valid bits to avoid unnecessary machine trace metric recomputations
Although this does cut the number of traces recomputed by ~10% for the
test case mentioned in http://reviews.llvm.org/D10460, it doesn't
make a dent in the overall performance. That example needs to be more
selective when invalidating traces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241393 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-04 15:00:28 +00:00
Yaron Keren
57dee47d17 Fix spelling, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241392 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-04 05:48:52 +00:00
Peter Collingbourne
dfe478600b LTO: expose LTO_SYMBOL_ALIAS, which indicates that the symbol is an alias.
This is needed for COFF linkers to distinguish between weak external aliases
and regular symbols with LLVM weak linkage, which are represented as strong
symbols in COFF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241389 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-04 03:42:35 +00:00
Rui Ueyama
392450ed6f Object/COFF: Do not rely on VirtualSize being 0 in object files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241387 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-04 03:25:51 +00:00
Lang Hames
b21c7647d8 [RuntimeDyld] Skip relocations for external symbols with 64-bit address ~0ULL.
Requested by Eugene Rozenfeld of the LLILC team, this feature allows JIT
clients to skip relocations for selected external symbols by returning ~0ULL
from their symbol resolver. If this value is returned for a given symbol,
RuntimeDyld will skip all relocations for that symbol. The client will be
responsible for applying the skipped relocations manually before the code
is executed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241383 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-04 01:35:26 +00:00
Craig Topper
9a9ee6f550 [X86] Add proper 64-bit mode checks to jrcxz and jcxz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241381 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-04 00:01:07 +00:00
Matt Arsenault
11528555b1 AMDGPU: Fix indentation of switch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241380 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 23:33:38 +00:00
Simon Atanasyan
afc0340d96 [ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj tools
SHT_NOBITS sections do not have content in an object file. Now the yaml2obj
tool does not accept `Content` field for such sections, and the obj2yaml
tool does not attempt to read the section content from a file.

Restore r241350 and r241352.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241377 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 23:00:54 +00:00
Rafael Espindola
b811509613 Use a continue to reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241375 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 22:02:28 +00:00
Rafael Espindola
5b685b0cf8 Use a continue to reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241374 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 21:57:41 +00:00
Rafael Espindola
75ad04a92a Context is allocated just a few lines above. Don't check if it is null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241373 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 21:54:41 +00:00
Rafael Espindola
643de689aa Fix build with -DLLVM_USE_INTEL_JITEVENTS=ON -DLLVM_USE_OPROFILE=ON.
Is anyone using those?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241372 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 21:47:00 +00:00
Filipe Cabecinhas
177fabfc30 Remove always-true comparison, NFC.
Summary:
Looking at r241279, I noticed that UpgradedIntrinsics only gets written
to in the following code:

    if (UpgradeIntrinsicFunction(&F, NewFn))
      UpgradedIntrinsics[&F] = NewFn;

Looking through UpgradeIntrinsicFunction, we always return false OR
NewFn will be set to a different function from our source.

This patch pulls the F != NewFn into UpgradeIntrinsicFunction as an
assert, and removes the check from callers of UpgradeIntrinsicFunction.

Reviewers: rafael, chandlerc

Subscribers: llvm-commits-list

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241369 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 20:12:01 +00:00
Rafael Espindola
5954faae4d Return ErrorOr from getSymbolAddress.
It can fail trying to get the section on ELF and COFF. This makes sure the
error is handled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241366 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 18:19:00 +00:00
Rafael Espindola
115b2eb8bf Replace a few more MachO only uses of getSymbolAddress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241365 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 18:02:36 +00:00
Rafael Espindola
e235dc4936 Use getValue instead of getAddress in a few MachO only cases.
In MachO the value of the symbol is always the address, so we can use the
simpler function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241364 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 17:44:18 +00:00
Rafael Espindola
a89ad42b36 This reverts commit r241350 and r241352.
r241350 broke lld tests.
r241352 depends on r241350.

Original messages:
"[ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj tools"
"[ELFYAML] Make the Size field for .bss section optional"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241354 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 14:54:02 +00:00
Simon Atanasyan
5f78433f81 [ELFYAML] Make the Size field for .bss section optional
It's a common case to have a zero-size .bss section in an object file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241352 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 14:19:06 +00:00
Simon Atanasyan
c97046c6e6 [ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj tools
SHT_NOBITS sections do not have content in an object file. Now yaml2obj
tool does not accept `Content` field for such sections, and obj2yaml
tool does not attempt to read the section content from a file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241350 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 14:07:06 +00:00
Rafael Espindola
21afba1004 Avoid a use after free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241345 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 12:20:34 +00:00
Simon Pilgrim
339c530319 [X86][SSE] Sign extension for target vector sizes less than 128 bits (pt2)
Add support for v2i8/v2i16 to v2f64 by using a sign extension to v2i32 before conversion to v2f64.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241325 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 08:01:36 +00:00
Yaron Keren
a450348ecc Initialize booleans CallsUnwindInit and CallsEHReturn with false instead of 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241324 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 07:56:24 +00:00
Simon Pilgrim
e3c6222c76 [X86][SSE] Sign extension for target vector sizes less than 128 bits (pt1)
This patch adds support for sign extension for sub 128-bit vectors, such as to v2i32. It concatenates with UNDEF subvectors up to 128-bits, performs the sign extension (i.e. as v4i32) and then extracts the target subvector.

Patch 1/2 of D10589 - the second patch covers the conversion of v2i8/v2i16 to v2f64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241323 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 07:51:01 +00:00
Nadav Rotem
6890be345e Fix an overly aggressive assertion in getCopyFromPartsVector.
The assertion in getCopyFromPartsVector assumed that the vector 'part' must
match the type of argument (arguments are potentially split into multiple
parts). However, in some cases the targets return a 'part' of the right size
but with a different type. We already handle this case correctly later on
and generate a bitcast. This commit just makes sure that we are actually
checking the property that we care about.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241312 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 23:23:52 +00:00
Adrian Prantl
c3d9cd3f73 DIBuilder: Now that DICompileUnit is distinct, stop using temporary nodes
for the arrays.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241308 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 22:32:52 +00:00
Akira Hatanaka
516286ff69 Use function attribute "trap-func-name" and remove TargetOptions::TrapFuncName.
This commit changes normal isel and fast isel to read the user-defined trap
function name from function attribute "trap-func-name" attached to llvm.trap or
llvm.debugtrap instead of from TargetOptions::TrapFuncName. This is needed to
use clang's command line option "-ftrap-function" for LTO and enable changing
the trap function name on a per-call-site basis.

Out-of-tree projects currently using TargetOptions::TrapFuncName to specify the
trap function name should attach attribute "trap-func-name" to the call sites
of llvm.trap and llvm.debugtrap instead.

rdar://problem/21225723

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241305 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 22:13:27 +00:00
Akira Hatanaka
7ef8957773 Add functions for adding and testing string attributes to CallInst. NFC.
This change is needed later when I make changes to attach string function
attributes to llvm.trap and llvm.debugtrap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241304 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 22:08:48 +00:00
Dan Gohman
44bc052f4d [WebAssembly] Set the HasFloatingPointExceptions flag for WebAssembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241302 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 21:36:25 +00:00
Rafael Espindola
c223f39fa7 Try to fix the build of IntelJITEventListener.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241301 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 21:24:12 +00:00
Rafael Espindola
8a80641a85 Return ErrorOr from SymbolRef::getName.
This function can really fail since the string table offset can be out of
bounds.

Using ErrorOr makes sure the error is checked.

Hopefully a lot of the boilerplate code in tools/* can go away once we have
a diagnostic manager in Object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241297 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 20:55:21 +00:00
Bill Schmidt
397fac95d5 [PPC64LE] Remove implicit-subreg restriction from VSX swap removal
In r241285, I removed the SUBREG_TO_REG restriction from VSX swap
removal, determining that this was overly conservative.  We have
another form of the same restriction in that we check for the presence
of implicit subregs in vector operations.  As with SUBREG_TO_REG for
partial register conversions, an implicit subreg is safe in and of
itself, provided no other operation makes a lane-sensitive assumption
about the result.  This patch removes that restriction, by removing
the HasImplicitSubreg flag and all code that relies on it.

I've added a test case that fails to optimize before this patch is
applied, and optimizes properly with the patch.  Test based on a
report from Anton Blanchard.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241290 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 19:01:22 +00:00
Bill Schmidt
a5a5a62fff [PPC64LE] Teach swap optimization about the doubleword splat idiom
With a previous patch, the VSX swap optimization is able to recognize
the doubleword load-splat idiom that can be implemented using lxvdsx.
However, that does not cover a doubleword splat where the source is a
register.  We can implement this using xxspltd (a special form of
xxpermdi).  This patch teaches the swap optimization pass about this
idiom.

As a prerequisite, it also permits swap optimization to succeed for
all forms of SUBREG_TO_REG.  Previously we were conservative and only
allowed SUBREG_TO_REG when it copied a full register.  However, on
reflection any form of SUBREG_TO_REG is safe in and of itself, so long
as an unsafe operation is not performed on its result.  In particular,
a widening SUBREG_TO_REG often occurs as an input to a doubleword
splat idiom, particularly in auto-vectorized code.

The doubleword splat idiom is an XXPERMDI operation where both source
registers are identical, and the selection mask is either 0 (splat the
first element) or 3 (splat the second element).  To determine whether
the registers are identical, we use the existing mechanism for looking
through "copy-like" operations.  That mechanism has a side effect of
marking the XXPERMDI operation as using a physical register, which
would invalidate its presence in a swap-optimized region.  This is
correct for the form of XXPERMDI that performs a swap and hence would
be removed, but is not what we want for a doubleword-splat variety of
XXPERMDI.  Therefore we reset the physical-register flag on the
XXPERMDI when it represents a splat.

A simple test case is added to verify that we generate the splat and
that we also remove the xxswapd instructions that would otherwise be
associated with the load and store of another operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241285 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 17:03:06 +00:00
Rafael Espindola
9561506e34 Convert a member variable to a local one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241284 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 16:59:57 +00:00
Rafael Espindola
9afb3a2589 Fix for PR23310: llvm-dis crashes when trying to upgrade an intrinsic.
When trying to upgrade @llvm.x86.sse2.psrl.dq while parsing a module,
BitcodeReader adds the function to its worklist twice, resulting in a
crash when accessing it the second time.

This patch replaces the worklist vector by a map.

Patch by Philip Pfaffe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241281 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 16:22:40 +00:00
Rafael Espindola
002ff89e22 Rangify some loops.
Patch by Philip Pfaffe!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241279 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 15:55:09 +00:00
Leny Kholodov
479dc2c0fe [Support] Lazy load of dbghlp.dll on Windows
This patch changes linkage with dbghlp.dll for clang from static (at load time)
to on demand (at the first use of required functions). Clang uses dbghlp.dll
only in minor use-cases. First of all in case of crash and in case of plugin load.
The dbghlp.dll library can be absent on system. In this case clang will fail
to load. With lazy load of dbghlp.dll clang can work even if dbghlp.dll
is not available.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241271 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 14:34:57 +00:00
Yaron Keren
8bbc5bbd34 Remove whitespace from start of line, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241268 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 14:25:09 +00:00
Yaron Keren
016970f468 Delete whitespace at start of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241265 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 14:17:12 +00:00
Pawel Bylica
074d71dea6 Reapply r240291: Fix shl folding in DAG combiner.
The code responsible for shl folding in the DAGCombiner was assuming incorrectly that all constants are less than 64 bits. This patch simply changes the way values are compared.

It has been reverted previously because of some problems with comparing APInt with raw uint64_t. That has been fixed/changed with r241204.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241254 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 11:44:54 +00:00
Charlie Turner
8992bae990 [GraphWriter] Don't wait on xdg-open when not on Apple.
By default, the GraphWriter code assumes that the generic file open
program (`open` on Apple, `xdg-open` on other systems) can wait on the
forked proces to complete. When the fork ends, the code would delete
the temporary dot files created, and return.

On GNU/Linux, the xdg-open program does not have a "wait for your fork
to complete before dying" option. So the behaviour was that xdg-open
would launch a process, quickly die itself, and then the GraphWriter
code would think its OK to quickly delete all the temporary files.
Once the temporary files were deleted, the dot viewers would get very
upset, and often give you weird errors.

This change only waits on the generic open program on Apple platforms.
Elsewhere, we don't wait on the process, and hence we don't try and
clean up the temporary files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241250 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 09:32:07 +00:00
Sanjoy Das
d0872b393c [NFC] Make the Statepoint class more like CallSite
Summary: Rename some methods to make Statepoint look more like CallSite.

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241235 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 02:53:45 +00:00
Eric Christopher
320404f134 Implement TargetTransformInfo::hasCompatibleFunctionAttributes for X86.
This checks subtarget feature compatibility for inlining by verifying
that the callee is a strict subset of the caller's features. This includes
the cpu as part of the subtarget we can get via the incoming functions as
the backend takes CPUs as feature sets.

This allows us to inline things like:

int foo() { return baz(); }

int __attribute__((target("sse4.2"))) bar() {
  return foo();
}

so that generic code can be inlined into specialized functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241221 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 01:11:50 +00:00
Eric Christopher
5d5b914c59 Add a routine to TargetTransformInfo that will allow targets to look
at the attributes on a function to determine whether or not to allow
inlining.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241220 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 01:11:47 +00:00
JF Bastien
1ff585db47 WebAssembly: start instructions
Summary:
* Add 64-bit address space feature.
* Rename SIMD feature to SIMD128.
* Handle single-thread model with an IR pass (same way ARM does).
* Rename generic processor to MVP, to follow design's lead.
* Add bleeding-edge processors, with all features included.
* Fix a few DEBUG_TYPE to match other backends.

Test Plan: ninja check

Reviewers: sunfish

Subscribers: jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241211 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 23:41:25 +00:00
Quentin Colombet
a1a323c637 [TwoAddressInstructionPass] Try 3 Addr Conversion After Commuting.
TwoAddressInstructionPass stops after a successful commuting but 3 Addr
conversion might be good for some cases.
 
Consider:

int foo(int a, int b) {
  return a + b;
}

Before this commit, we emit:

addl	%esi, %edi
movl	%edi, %eax
ret

After this commit, we try 3 Addr conversion:

leal	(%rsi,%rdi), %eax
ret

Patch by Volkan Keles <vkeles@apple.com>!

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241206 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 23:12:13 +00:00
Alexey Samsonov
739ded16a5 [LoopVectorize] Use ReplaceInstWithInst() helper where appropriate.
This is mostly an NFC, which increases code readability (instead of
saving old terminator, generating new one in front of old, and deleting
old, we just call a function). However, it would additionaly copy
the debug location from old instruction to replacement, which
would help PR23837.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241197 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 22:18:30 +00:00
Pete Cooper
f89e1bdc1a Pack MCSymbol::Flags in to the bitfield with other members. NFC.
All file formats only needed 16-bits right now which is enough to fit
in to the padding with other fields.

This reduces the size of MCSymbol to 24-bytes on a 64-bit system.  The
layout is now

   0 | class llvm::MCSymbol
   0 |   class llvm::PointerIntPair SectionOrFragmentAndHasName
   0 |     intptr_t Value
     |   [sizeof=8, dsize=8, align=8
     |    nvsize=8, nvalign=8]

   8 |   unsigned int IsTemporary
   8 |   unsigned int IsRedefinable
   8 |   unsigned int IsUsed
   8 |   _Bool IsRegistered
   8 |   unsigned int IsExternal
   8 |   unsigned int IsPrivateExtern
   8 |   unsigned int Kind
   9 |   unsigned int IsUsedInReloc
   9 |   unsigned int SymbolContents
   9 |   unsigned int CommonAlignLog2
  10 |   uint32_t Flags
  12 |   uint32_t Index
  16 |   union
  16 |     uint64_t Offset
  16 |     uint64_t CommonSize
  16 |     const class llvm::MCExpr * Value
     |   [sizeof=8, dsize=8, align=8
     |    nvsize=8, nvalign=8]

     | [sizeof=24, dsize=24, align=8
     |  nvsize=24, nvalign=8]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241196 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 21:57:51 +00:00
Dan Gohman
1efcdba0e2 [WebAssembly] Define separate Target instances for 32-bit and 64-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241193 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 21:42:34 +00:00
Jingyue Wu
e08f05f3a5 [NVPTX] expand extload/truncstore for vectors of floats
Summary:
According to PTX ISA:

For convenience, ld, st, and cvt instructions permit source and destination data operands to be wider than the instruction-type size, so that narrow values may be loaded, stored, and converted using regular-width registers. For example, 8-bit or 16-bit values may be held directly in 32-bit or 64-bit registers when being loaded, stored, or converted to other types and sizes. The operand type checking rules are relaxed for bit-size and integer (signed and unsigned) instruction types; floating-point instruction types still require that the operand type-size matches exactly, unless the operand is of bit-size type.

So, the ISA does not support load with extending/store with truncatation for floating numbers. This is reflected in setting the loadext/truncstore actions to expand in the code for floating numbers, but vectors of floating numbers are not taken care of.

As a result, loading a vector of floats followed by a fp_extend may be combined by DAGCombiner to a extload, and the extload may be lowered to NVPTXISD::LoadV2 with extending information. However, NVPTXISD::LoadV2 does not perform extending, and no extending instructions are inserted. Finally, PTX instructions with mismatched types are generated, like
ld.v2.f32 {%fd3, %fd4}, [%rd2]

This patch adds the correct actions for vectors of floats, so DAGCombiner would not create loads with extending, and correct code is generated.

Patched by Gang Hu. 

Test Plan: Test case attached.

Reviewers: jingyue

Reviewed By: jingyue

Subscribers: llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241191 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 21:32:42 +00:00
Pete Cooper
f77ca9f85f Encode MCSymbol alignment as log2(align).
Given that alignments are always powers of 2, just encode it this way.

This matches how we encode alignment on IR GlobalValue's for example.

This compresses the CommonAlign member down to 5 bits which allows it
to pack better with the surrounding fields.

Reviewed by Duncan Exon Smith.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241189 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 21:07:03 +00:00
Reid Kleckner
8a1df9b25f [WinEH] Use llvm.x86.seh.recoverfp in WinEHPrepare
Don't pattern match for frontend outlined finally calls on non-x64
platforms. The 32-bit runtime uses a different funclet prototype.  Now,
the frontend is pre-outlining the finally bodies so that it ends up
doing most of the heavy lifting for variable capturing. We're just
outlining the callsite, and adapting the frameaddress(0) call to line up
the frame pointer recovery.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 20:59:25 +00:00
Jingyue Wu
8f2981cb40 [NVPTX] Move NVPTXPeephole after NVPTXPrologEpilogPass
Summary:
Offset of frame index is calculated by NVPTXPrologEpilogPass. Before
that the correct offset of stack objects cannot be obtained, which
leads to wrong offset if there are more than 2 frame objects. This patch
move NVPTXPeephole after NVPTXPrologEpilogPass. Because the frame index
is already replaced by %VRFrame in NVPTXPrologEpilogPass, we check
VRFrame register instead, and try to remove the VRFrame if there
is no usage after NVPTXPeephole pass.

Patched by Xuetian Weng. 

Test Plan:
Strengthened test/CodeGen/NVPTX/local-stack-frame.ll to check the
offset calculation based on SP and SPL.

Reviewers: jholewinski, jingyue

Reviewed By: jingyue

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241185 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 20:08:06 +00:00
Bill Schmidt
9215b9ab25 [PPC64LE] Enable missing lxvdsx optimization, and related swap optimization
When adding little-endian vector support for PowerPC last year, I
inadvertently disabled an optimization that recognizes a load-splat
idiom and generates the lxvdsx instruction.  This patch moves the
offending logic so lxvdsx is once again generated.

This pattern is frequently generated by the vectorizer for scalar
loads of an effective constant.  Previously the lxvdsx instruction was
wrongly listed as lane-sensitive for the VSX swap optimization (since
both doublewords are identical, swaps are safe).  This patch fixes
this as well, so that vectorized code using lxvdsx can now have swaps
removed from the computation.

There is an existing test (@test50) in test/CodeGen/PowerPC/vsx.ll
that checks for the missing optimization.  However, vsx.ll was only
being tested for POWER7 with big-endian code generation.  I've added
a little-endian RUN statement and expected LE code generation for all
the tests in vsx.ll to give us a bit better VSX coverage, including
what's needed for this patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241183 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 19:40:07 +00:00
Sanjay Patel
7472456fe9 add a cl::opt override for TargetLoweringBase's JumpIsExpensive
This patch is not intended to change existing codegen behavior for any target. 
It just exposes the JumpIsExpensive setting on the command-line to allow for
easier testing and emergency overrides.

Also, change the existing regression test to use FileCheck, explicitly specify
the jump-is-expensive option, and use more precise checks.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241179 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 18:10:20 +00:00
David Blaikie
b99e0eb947 Revert "[DWARF] Fix debug info generation for function static variables, typedefs, and records"
Caused PR24008

This reverts commit 37cb5f1c2d.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241176 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 18:07:16 +00:00
Sanjay Patel
89ec7f0069 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241175 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 17:58:53 +00:00
Sanjay Patel
b3d73f5064 fix typos in comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241174 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 17:55:07 +00:00
Matthias Braun
08f65f9d69 LivePhysRegs: Add support to add pristine registers when populating with live-in/live-out registers.
Differential Revision: http://reviews.llvm.org/D10139

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241172 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 17:17:17 +00:00
Reid Kleckner
1804878f0c [SEH] Don't assert if the parent function lacks a personality
The EH code might have been deleted as unreachable and the personality
pruned while the filter is still present.  Currently I'm hitting this at
-O0 due to the clang bug PR24009.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241170 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 16:45:47 +00:00
Benjamin Kramer
a2b83fd687 [AsmPrinter] Hide implementation details
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241169 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 16:18:16 +00:00
Arnaud A. de Grandmaison
bdaa375556 [AArch64] Implement add/adds/sub/subs/cmp/cmn with negative immediate aliases
This patch teaches the AsmParser to accept add/adds/sub/subs/cmp/cmn
with a negative immediate operand and convert them as shown:

  add  Rd, Rn, -imm -> sub  Rd, Rn, imm
  sub  Rd, Rn, -imm -> add  Rd, Rn, imm
  adds Rd, Rn, -imm -> subs Rd, Rn, imm
  subs Rd, Rn, -imm -> adds Rd, Rn, imm
  cmp  Rn, -imm     -> cmn  Rn, imm
  cmn  Rn, -imm     -> cmp  Rn, imm

Those instructions are an alternate syntax available to assembly coders,
and are needed in order to support code already compiling with some other
assemblers (gas). They are documented in the "ARMv8 Instruction Set
Overview", in the "Arithmetic (immediate)" section. This makes llvm-mc
a programmer-friendly assembler !

This also fixes PR20978: "Assembly handling of adding negative numbers
not as smart as gas".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241166 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 15:05:58 +00:00
Benjamin Kramer
3690da1dfa [SDAG] Give InstrEmitter hidden visibility
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241165 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 14:55:10 +00:00
Benjamin Kramer
b453775cc2 [CodeGen] Reduce visibility of implementation details
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241164 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 14:47:39 +00:00
James Y Knight
bcc1a5c01a [Sparc] Rearrange SparcInstrInfo, no change.
Move some instructions into order of sections in the spec, as the rest
already were.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241163 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 14:38:07 +00:00
Igor Breger
2ae30810d8 AVX-512: Implemented missing encoding for FMA scalar instructions
Added tests for encoding

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241159 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 13:24:28 +00:00
Rafael Espindola
df3edb6d36 Return ErrorOr from getSection.
This also improves the logic of what is an error:

* getSection(uint_32): only return an error if the index is out of bounds. The
  index 0 corresponds to a perfectly valid entry.
* getSection(Elf_Sym): Returns null for symbols that normally don't have
  sections and error for out of bound indexes.

In many places this just moves the report_fatal_error up the stack, but those
can then be fixed in smaller patches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241156 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 12:56:27 +00:00
Michael Kuperstein
37cb5f1c2d [DWARF] Fix debug info generation for function static variables, typedefs, and records
Function static variables, typedefs and records (class, struct or union) declared inside
a lexical scope were associated with the function as their parent scope, rather than the
lexical scope they are defined or declared in.

This fixes PR19238

Patch by: amjad.aboud@intel.com
Differential Revision: http://reviews.llvm.org/D9758

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241153 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 12:33:11 +00:00
Michael Kuperstein
5020a9198d [X86] Avoid over-relaxation of 8-bit immediates in integer arithmetic instructions.
Only consider an instruction a candidate for relaxation if the last operand of the 
instruction is an expression. We previously checked whether any operand is an expression,
which is useless, since for all instructions concerned, the only operand that may be
affected by relaxation is the last one.
In addition, this removes the check for having RIP as an argument, since it was 
plain wrong - even when one of the arguments is RIP, relaxation may still be needed.

This fixes PR9807.

Patch by: david.l.kreitzer@intel.com
Differential Revision: http://reviews.llvm.org/D10766

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241152 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 10:54:42 +00:00
Zoran Jovanovic
627c5342b2 [mips][microMIPS] Implement SLL and NOP instructions
http://reviews.llvm.org/D10474


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241150 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 09:54:51 +00:00
Gabor Ballabas
9f9bf86ed5 Fix PR23872: Integrated assembler error message when using .type directive with @ in AArch32 assembly.
The AArch32 assembler parses the '@' as a comment symbol, so the error message shouldn't suggest
that '@<type>' is a valid replacement when assembling for AArch32 target.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241149 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 08:58:49 +00:00
David Majnemer
787b9b4e95 [LoopUnroll] Use undef for phis with no value live
We would create a phi node with a zero initialized operand instead of
undef in the case where no value was originally available.  This was
problematic for x86_mmx which has no null value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241143 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 05:38:07 +00:00
David Majnemer
284c49c36f [SCCP] Turn loads of null into undef instead of zero initialized values
Surprisingly, this is a correctness issue: the mmx type exists for
calling convention purposes, LLVM doesn't have a zero representation for
them.

This partially fixes PR23999.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241142 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 05:37:57 +00:00
Jingyue Wu
4015c5e2e4 [NaryReassociate] enhances nsw by leveraging @llvm.assume
Summary:
nsw are flaky and can often be removed by optimizations. This patch enhances
nsw by leveraging @llvm.assume in the IR. Specifically, NaryReassociate now
understands that

    assume(a + b >= 0) && assume(a >= 0) ==> a +nsw b

As a result, it can split more sext(a + b) into sext(a) + sext(b) for CSE.

Test Plan: nary-gep.ll

Reviewers: broune, meheff

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241139 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 03:38:49 +00:00
Alexey Samsonov
327cfdf4fe [SanitizerCoverage] Don't add instrumentation to unreachable blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241127 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 23:11:45 +00:00
Reid Kleckner
34c6bb0ef0 [SEH] Add new intrinsics for recovering and restoring parent frames
The incoming EBP value established by the runtime is actually a pointer
to the end of the EH registration object, and not the true parent
function frame pointer. Clang doesn't need llvm.x86.seh.exceptioninfo
anymore because we know that the exception info pointer is at a fixed
offset from this incoming EBP.

The llvm.x86.seh.recoverfp intrinsic takes an EBP value provided by the
EH runtime and returns a pointer that is usable with llvm.framerecover.

The llvm.x86.seh.restoreframe intrinsic is inserted by the 32-bit
specific preparation pass in blocks targetted by the EH runtime. It
re-establishes any physical registers used by the parent function to
address the stack, such as the frame, base, and stack pointers.

Neither of these intrinsics correctly handle stack realignment prologues
yet, but it's possible to add that later.

Reviewers: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241125 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 22:46:59 +00:00
David Majnemer
5ca5b0d9f4 [Cloning] Teach CloneModule about personality functions
CloneModule didn't take into account that it needed to remap the value
using values in the module.

This fixes PR23992.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241122 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 22:14:01 +00:00
Jingyue Wu
10a3a33df0 [NVPTX] cleanups and refacotring in NVPTXFrameLowering.cpp
Summary: NFC

Test Plan: no regression

Reviewers: wengxt

Reviewed By: wengxt

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241118 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 21:28:31 +00:00
Sanjoy Das
e1e95c11b8 [FaultMaps] Let the frontend pre-select implicit null check candidates.
Summary:
This change introduces a !make.implicit metadata that allows the
frontend to pre-select the set of explicit null checks that will be
considered for transformation into implicit null checks.

The reason for not using profiling data instead of !make.implicit is
explained in the change to `FaultMaps.rst`.

Reviewers: atrick, reames, pgavlin, JosephTremoulet

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241116 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 21:22:32 +00:00
Pete Cooper
8cdbab9dd6 Pack MCSymbol::HasName in to a spare bit in the section/fragment union.
This is part of an effort to pack the average MCSymbol down to 24 bytes.

The HasName bit was pushing the size of the bitfield over to another word,
so this change uses a PointerIntPair to fit in it to unused bits of a
PointerUnion.

Reviewed by Rafael Espíndola

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241115 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 20:54:21 +00:00
Rafael Espindola
28a83187a2 Use ErrorOr in getRelocationAdress.
We can probably do better in this method, but this is an improvement and
enables further ErrorOr cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241114 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 20:32:26 +00:00
Rafael Espindola
d231306ba8 Implement containsSymbol with other lower level methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241112 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 20:18:49 +00:00
Nemanja Ivanovic
ce772898d6 Modified a comment about the reason for the patch (removed commented code).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241110 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 20:01:16 +00:00
Nemanja Ivanovic
482f87058a Fixes a bug with __builtin_vsx_lxvdw4x on Little Endian systems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241108 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 19:45:45 +00:00
Peter Collingbourne
fd8c98591d COFF: Do not assign linker-weak symbols to selectany comdat sections.
It is mandatory to specify a comdat in order to receive comdat semantics
for a symbol. We were previously getting this wrong in -function-sections
mode; linker-weak symbols were being emitted in a selectany comdat. This
change causes such symbols to use a noduplicates comdat instead, fixing
the inconsistency.

Also correct an inaccuracy in the docs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241103 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 19:10:31 +00:00
Jingyue Wu
75cacfb490 [NVPTX] Fix issue introduced in D10321
Summary:
Really check if %SP is not used in other places, instead of checking only exact
one non-dbg use.

Patched by Xuetian Weng. 

Test Plan:
@foo4 in test/CodeGen/NVPTX/local-stack-frame.ll, create a case that
SP will appear twice.

Reviewers: jholewinski, jingyue

Reviewed By: jingyue

Subscribers: llvm-commits, sfantao, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241099 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 18:59:19 +00:00
Adrian Prantl
c408bc8e39 Fix a fixme and make DICompileUnit a distinct node. Tested via clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241097 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 18:32:18 +00:00
Alex Lorenz
eceef384d6 Fix compilation failure introduced in r241093.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241096 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 18:32:02 +00:00
Alex Lorenz
73d2cc5b8e MIR Serialization: Serialize MBB successors.
This commit implements serialization of the machine basic block successors. It
uses a YAML flow sequence that contains strings that have the MBB references.
The MBB references in those strings use the same syntax as the MBB machine
operands in the machine instruction strings.

Reviewers: Duncan P. N. Exon Smith

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241093 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 18:16:42 +00:00
Alex Lorenz
ba4660cb83 MIR Printer: extract the code that prints MBB references into a new method. NFC.
This commit enables the MIR printer to reuse the code that prints MBB
references.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241087 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 18:00:16 +00:00
Alex Lorenz
403c3312c3 MIR Parser: refactor error reporting for machine instruction parser errors. NFC.
This commit extracts the code that reports an error that's produced by the
machine instruction parser into a new method that can be reused in other places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241086 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 17:55:00 +00:00
Alex Lorenz
939f023bf9 MIR Parser: make the machine instruction parsing interface more consistent. NFC.
This commit refactors the interface for machine instruction parser. It adopts
the pattern of returning a bool and passing in the result in the first argument
that is used by the other parsing methods for the the method 'parse' and the
function 'parseMachineInstr'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241085 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 17:47:50 +00:00
Samuel Antao
8f1e30d67c Force relocation mode to be default, regardless of what is passed to the backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241081 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 17:18:00 +00:00
Alex Lorenz
1991c597a4 MIR Parser: adopt the 'maybeLex...' pattern. NFC.
This commit refactors the machine instruction lexer so that the lexing
functions use the 'maybeLex...' pattern, where they determine if they
can lex the current token by themselves.

Reviewers: Sean Silva

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241078 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 16:51:29 +00:00
Sanjay Patel
5601e30a77 use range-based for loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241076 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 16:30:22 +00:00
Michael Kuperstein
f8b3b92eb8 [X86] Fix a bug in WIN_FTOL_32/64 handling.
Duplicating an FP register "as itself" is a bad idea, since it violates the
invariant that every FP register is mapped to at most one FPU stack slot.
Use the scratch FP register instead.

This fixes PR23957.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241069 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 14:38:57 +00:00
Toma Tabacu
e143a3abc2 [mips] [IAS] Add support for the .module softfloat/hardfloat directives.
These directives are used to set the default value of the SoftFloat feature.
They have the same effect as setting -m{soft, hard}-float from the command line.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241066 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 13:46:03 +00:00
Toma Tabacu
dcec5265ae [mips] [IAS] Make .module directives change AssemblerOptions->front().
Differential Revision: http://reviews.llvm.org/D10643

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241062 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 12:41:33 +00:00
Ranjeet Singh
b0f7871d4e Reverting r241058 because it's causing buildbot failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241061 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 12:32:53 +00:00
Ranjeet Singh
a5106ca54d There are a few places where subtarget features are still
represented by uint64_t, this patch replaces these
usages with the FeatureBitset (std::bitset) type.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241058 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 11:30:42 +00:00
Toma Tabacu
5dee8da754 [mips] [IAS] Add support for the .set oddspreg/nooddspreg directives.
Differential Revision: http://reviews.llvm.org/D10657

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241052 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 09:36:50 +00:00
Michael Kuperstein
501cad951b [X86] Add FXSR intrinsics
Add intrinsics for the FXSR instructions (FXSAVE/FXSAVE64/FXRSTOR/FXRSTOR64)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241049 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 08:49:35 +00:00
Rafael Espindola
f8a35ff558 Don't return error_code from a function that doesn't fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241042 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 04:08:37 +00:00
Dan Gohman
06bc362502 Drop the OS from the WebAssembly target triple for now.
This unbreaks TripleTest.Normalization. We'll have to come up with a new
plan for the OS component of the target triple for WebAssembly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241041 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 03:52:25 +00:00
Rafael Espindola
09912eb9ec Move function to the only file that uses it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241040 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 03:41:26 +00:00
Rafael Espindola
9f2f3bba2b Don't return error_code from a function that doesn't fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241039 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 03:33:18 +00:00
Adrian Prantl
85cd16c88e Debug info: Add dwarf backend support for DIModule.
rdar://problem/20965932

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241034 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 02:13:04 +00:00
Rafael Espindola
7ede9649c1 Don't return error_code from a function that doesn't fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241033 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 01:53:01 +00:00
Rafael Espindola
de4d844704 Cleanup getRelocationAddend.
Realistically, this will be returning ErrorOr for some time as refactoring the
user code to check once per section will take some time.

Given that, use it for checking if a relocation has addend or not.

While at it, add ELFRelocationRef to simplify the users.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241028 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 00:33:59 +00:00
Matthias Braun
1a5b04c725 RegisterCoalescer: Cleanup empty subranges after shrinkToUses()
A call to removeEmptySubranges() is necessary after every operation that
potentially removes all segments from a subregister range; this case in
the register coalescer was missing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241027 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 00:33:44 +00:00
Rui Ueyama
13b58ec74a Object/COFF: Define coff_symbol_generic.
If you only need Name and Value fields in the COFF symbol,
you don't need to distinguish 32 bit and 64 bit COFF symbols.
These fields start at the same offsets and have the same size.

This data strucutre is one pointer smaller than COFFSymbolRef
thus slightly efficient. I'll use this class in LLD as we create
millions of LLD symbol objects that currently contain COFFSymbolRef.
Shaving off 8 byte (or 4 byte on 32 bit) from that class actually
matters becasue of the number of objects we create in LLD.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241024 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 00:03:56 +00:00
Dan Gohman
a74341308f [WebAssembly] Initial WebAssembly backend
This WebAssembly backend is just a skeleton at this time and is not yet
functional.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241022 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 23:51:55 +00:00
Rafael Espindola
ff67629985 Don't return error_code from function that never fails.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241021 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 23:29:12 +00:00
Adrian Prantl
717764717b Add a DIModule metadata node to the IR.
It is meant to be used to record modules @imported by the current
compile unit, so a debugger an import the same modules to replicate this
environment before dropping into the expression evaluator.

DIModule is a sibling to DINamespace and behaves quite similarly.
In addition to the name of the module it also records the module
configuration details that are necessary to uniquely identify the module.
This includes the configuration macros (e.g., -DNDEBUG), the include path
where the module.map file is to be found, and the isysroot.

The idea is that the backend will turn this into a DW_TAG_module.

http://reviews.llvm.org/D9614
rdar://problem/20965932

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241017 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 23:03:47 +00:00
Ben Langmuir
fce3cfb784 Reapply "Use gethostuuid() on Mac to identify hosts for LockFileManager"
Reapplies r241005 after fixing the build on non-Mac platforms. Original
commit message below.

The hostname can be very unstable when there are many machines on the
network competing for the same name. Using the hardware UUID makes it
less likely to have collisions or to consider files written by the
current host to be owned by a different one at a later time.

rdar://problem/21512307

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241012 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 22:16:39 +00:00
Peter Collingbourne
a6367d9136 Teach LTOModule to emit linker flags for dllexported symbols, plus interface cleanup.
This change unifies how LTOModule and the backend obtain linker flags
for globals: via a new TargetLoweringObjectFile member function named
emitLinkerFlagsForGlobal. A new function LTOModule::getLinkerOpts() returns
the list of linker flags as a single concatenated string.

This change affects the C libLTO API: the function lto_module_get_*deplibs now
exposes an empty list, and lto_module_get_*linkeropts exposes a single element
which combines the contents of all observed flags. libLTO should never have
tried to parse the linker flags; it is the linker's job to do so. Because
linkers will need to be able to parse flags in regular object files, it
makes little sense for libLTO to have a redundant mechanism for doing so.

The new API is compatible with the old one. It is valid for a user to specify
multiple linker flags in a single pragma directive like this:

 #pragma comment(linker, "/defaultlib:foo /defaultlib:bar")

The previous implementation would not have exposed
either flag via lto_module_get_*deplibs (as the test in
TargetLoweringObjectFileCOFF::getDepLibFromLinkerOpt was case sensitive)
and would have exposed "/defaultlib:foo /defaultlib:bar" as a single flag via
lto_module_get_*linkeropts. This may have been a bug in the implementation,
but it does give us a chance to fix the interface.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241010 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 22:04:09 +00:00
Ben Langmuir
cb936df2a9 Revert "Use gethostuuid() on Mac to identify hosts for LockFileManager"
Broke non-Mac builds.

This reverts commit r241005.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241007 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 21:56:03 +00:00
Ben Langmuir
d5c333b731 Use gethostuuid() on Mac to identify hosts for LockFileManager
The hostname can be very unstable when there are many machines on the
network competing for the same name. Using the hardware UUID makes it
less likely to have collisions or to consider files written by the
current host to be owned by a different one at a later time.

rdar://problem/21512307

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241005 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 21:47:44 +00:00
Tim Northover
9cbdfb5c05 ARM: add correct kill flags when combining stm instructions
When the store sequence being combined actually stores the base register, we
should not mark it as killed until the end.

rdar://21504262

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241003 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 21:42:16 +00:00
Matthias Braun
7839b00d43 X86: Rework inline asm integer register specification.
This is a new version of http://reviews.llvm.org/D10260.

It turned out that when you specify an integer register in inline asm on
x86 you get the register of the required type size back. That means that
X86TargetLowering::getRegForInlineAsmConstraint() has to accept any of
the integer registers and adapt its size to the given target size which
may be any 8/16/32/64 bit sized type. Surprisingly that means given a
constraint of "{ax}" and a type of MVT::F32 we need to return X86::EAX.

This change makes this face explicit, the previous code seemed like
working by accident because there it never returned an error once a
register was found. On the other hand this rewrite allows to actually
return errors for invalid situations like requesting an integer register
for an i128 type.

Related to rdar://21042280

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241002 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 21:35:51 +00:00
Alexey Samsonov
93dd711033 [LoopSimplify] Set proper debug location in loop backedge blocks.
Set debug location for terminator instruction in loop backedge block
(which is an unconditional jump to loop header). We can't copy debug
location from original backedges, as there can be several of them,
with different debug info locations. So, we follow the approach of
SplitBlockPredecessors, and copy the debug info from first non-PHI
instruction in the header (i.e. destination block).

This is yet another change for PR23837.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240999 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 21:30:14 +00:00
Pawel Bylica
4c81aa2602 [DAGCombiner] Fix & simplify constant folding of sext/zext.
Summary: This patch fixes the cases of sext/zext constant folding in DAG combiner where constans do not fit 64 bits. The fix simply removes un$

Test Plan: New regression test included.

Reviewers: RKSimon

Reviewed By: RKSimon

Subscribers: RKSimon, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240991 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 20:28:47 +00:00
Benjamin Kramer
17d7215661 [MMI] Use TinyPtrVector instead of PointerUnion with vector.
Also simplify duplicated code a bit. No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240990 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 20:21:55 +00:00
Diego Novillo
a8db479240 Tidy comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240987 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 20:03:46 +00:00
Ben Langmuir
4081538b2e Clean up unique lock files on signal and always release the lock
Make sure to remove the unique lock file, which is what the .lock
symlink points to, if there is a signal while the lock is held. This
will release the lock, since the symlink will point to nothing (already
tested in unit tests). For good measure, also clean up the unique lock
file if there is an error or signal before the lock is acquired.

I will add a clang test.

rdar://problem/21512307

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240967 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 17:08:41 +00:00
Alex Lorenz
1a4def3d97 MIR Serialization: Serialize the register mask machine operands.
This commit implements serialization of the register mask machine
operands. This commit serializes only the call preserved register
masks that are defined by a target, it doesn't serialize arbitrary
register masks.

This commit also extends the TargetRegisterInfo class and TableGen so that
the users of TRI can get the list of all the call preserved register masks and
their names.

Reviewers: Duncan P. N. Exon Smith

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240966 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 16:57:06 +00:00
Benjamin Kramer
59a20ece84 [SymbolSize] Skip sorting by index, just assign by index.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240961 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 16:05:00 +00:00
Benjamin Kramer
4c6f0a7bc9 Upgrade JIT listeners for changes in the libObject API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240956 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 15:18:48 +00:00
Tobias Grosser
032d56baf2 Move delinearization from SCEVAddRecExpr to ScalarEvolution
The expressions we delinearize do not necessarily have to have a SCEVAddRecExpr
at the outermost level. At this moment, the additional flexibility  is not
exploited in LLVM itself, but in Polly we will soon soonish use this
functionality. For LLVM, this change should not affect existing functionality
(which is covered by test/Analysis/Delinearization/)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240952 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 14:42:48 +00:00
Rafael Espindola
9a6c902332 Factor out the checking of string tables.
This moves the error checking for string tables to getStringTable which returns
an ErrorOr<StringRef>.

This improves error checking, makes it uniform across all string tables and
makes it possible to check them once instead of once per name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240950 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 14:39:25 +00:00
Elena Demikhovsky
546178bfe5 AVX-512: all forms of SCATTER instruction on SKX,
encoding, intrinsics and tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240936 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 12:14:24 +00:00
Javed Absar
23fd3d6afc [ARM]: Extend -mfpu options for half-precision and vfpv3xd
removing default label in switch as it results.
This is part of earlier commit http://reviews.llvm.org/D1064

Subscribers: llvm-commits



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240932 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 09:53:33 +00:00
Javed Absar
263dd533ee [ARM]: Extend -mfpu options for half-precision and vfpv3xd
Some of the the permissible ARM -mfpu options, which are supported in GCC,
are currently not present in llvm/clang.This patch adds the options:
'neon-fp16', 'vfpv3-fp16', 'vfpv3-d16-fp16', 'vfpv3xd' and 'vfpv3xd-fp16.
These are related to half-precision floating-point and single precision.

Reviewers: rengolin, ranjeet.singh

Subscribers: llvm-commits

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240930 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 09:32:29 +00:00
Igor Breger
048a1eb977 AVX-512: Implemented missing encoding and intrinsics for FMA instructions
Added tests for DAG lowering ,encoding and intrinsics

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240926 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 09:10:00 +00:00
NAKAMURA Takumi
85c698064c Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240924 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 04:50:09 +00:00
Matt Arsenault
8be74e16ef AMDGPU/SI: Fix extra space when printing v_div_fmas_*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240911 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-28 18:16:14 +00:00
Jingyue Wu
62bdd72542 [SLSR] S's basis must have the same type as S
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240910 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-28 17:45:05 +00:00
Asaf Badouh
13ce163855 [x86][AVX512]
Add vscalef support
include encoding and intrinsics


review:
http://reviews.llvm.org/D10730

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240906 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-28 14:30:39 +00:00
Elena Demikhovsky
b23b2fbd3a AVX-512: Added all SKX forms of GATHER instructions.
Added intrinsics.
Added encoding and tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240905 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-28 10:53:29 +00:00
Adrian Prantl
1e7ecc8e57 Revert "Debug Info: One more bitfield bugfix. While yesterday's r240853 fixed"
This reverts commit 240890. Breaking the gdb buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240893 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-27 21:55:00 +00:00
Benjamin Kramer
45b5f7e457 [SDAG] Now that we have a way to communicate the exact bit on sdiv use it to simplify sdiv by a constant.
We had a hack in SDAGBuilder in place to work around this but now we
can avoid that. Call BuildExactSDIV from BuildSDIV so DAGCombiner can
perform this trick automatically.

The added check in DAGCombiner is necessary to prevent exact sdiv by pow2
from regressing as the target-specific pow2 lowering is not aware of
exact bits yet.

This is mostly covered by existing tests. One side effect is that we
get the better lowering for exact vector sdivs now too :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240891 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-27 20:33:26 +00:00
Adrian Prantl
6b2ae13ea3 Debug Info: One more bitfield bugfix. While yesterday's r240853 fixed
the DW_AT_bit_offset computation, the byte offset is in fact also
endian-dependent as it needs to point to the storage unit containing the
most-significant bit of the the bitfield.
I'm so looking forward to emitting the endian-agnostic DWARF 3 version
instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240890 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-27 20:12:43 +00:00
Daniel Sanders
817cbdeae6 [mips] Add COP0 register class and use it in M[FT]C0/DM[FT]C0.
Summary:
Previously it (incorrectly) used GPR's.

Patch by Simon Dardis. A couple small corrections by myself.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240883 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-27 15:39:19 +00:00
David Majnemer
8a8d8b3e59 [LoopVectorize] Pointer indicies may be wider than the pointer
If we are dealing with a pointer induction variable, isInductionPHI
gives back a step value of Stride / size of pointer.  However, we might
be indexing with a legal type wider than the pointer width.
Handle this by inserting casts where appropriate instead of crashing.

This fixes PR23954.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240877 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-27 08:38:17 +00:00
David Majnemer
1166ce2460 [PruneEH] A naked, noinline function can return via InlineAsm
The PruneEH pass tries to annotate functions as 'noreturn' if it doesn't
see a ReturnInst.  However, a naked function containing inline assembly
can contain control flow leaving the function.

This fixes PR23971.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240876 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-27 07:52:53 +00:00
Petr Hosek
bc245c01bf [MC] Ensure that pending labels are flushed when -mc-relax-all flag is used
Summary:
The current implementation doesn't always flush all pending labels
beforeemitting data which can result in an incorrectly placed labels in
case when when instruction bundling is enabled and -mc-relax-all flag is
being used. To address this issue, we always flush pending labels before
emitting data.

The change was tested by running PNaCl toolchain trybots with
-mc-relax-all flag set.

Fixes https://code.google.com/p/nativeclient/issues/detail?id=4063

Test Plan: Regression test attached

Reviewers: mseaborn

Subscribers: jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240870 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-27 01:54:17 +00:00
Petr Hosek
0aaf3287e3 [MC] Align fragments when -mc-relax-all flag is used
Summary:
Ensure that fragments are bundle aligned when instruction bundling
is enabled and the -mc-relax-all flag is set. This is implicitly
assumed by the bundle padding implementation but this assumption
does not hold when custom alignment is being used.

The change was tested by running PNaCl toolchain trybots with
-mc-relax-all flag set.

Fixes https://code.google.com/p/nativeclient/issues/detail?id=4063

Test Plan: Regression test attached

Reviewers: mseaborn

Subscribers: jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240869 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-27 01:49:53 +00:00
Duncan P. N. Exon Smith
2a5fda92b4 IR: Expose ModuleSlotTracker in Value::print()
Allow callers of `Value::print()` and `Metadata::print()` to pass in a
`ModuleSlotTracker`.  This allows them to pay only once for calculating
module-level slots (such as Metadata).

This is related to PR23865, where there was a huge cost for
`MachineFunction::print()`.  Although I don't have a *particular* user
in mind for this new code, I have hit big slowdowns before when running
`opt -debug`, and I think this will be useful.  Going forward, if
someone hits a big slowdown with `print()` statements, they can create a
`ModuleSlotTracker` and send it through.  Similarly, adding support to
`Value::dump()` and `Metadata::dump()` should be trivial.

I added unit tests to be sure the `print()` functions actually behave
the same way with and without the slot tracker.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240867 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-27 00:38:26 +00:00
Peter Collingbourne
e92934e078 LowerBitSets: Ignore bitset entries that do not directly refer to a global.
It is possible for a global to be substituted with another global of a
different type or a different kind (i.e. an alias) at IR link time. One
example of this scenario is when a Microsoft ABI vtable is substituted with
an alias referring to a larger vtable containing an RTTI reference.

This will cause the global to be RAUW'd with a possibly bitcasted reference
to the other global. This will of course also affect any references to the
global in bitset metadata.

The right way to handle such metadata is simply to ignore it. This is sound
because the linked module should contain another copy of the bitset entries as
applied to the new global.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240866 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-27 00:17:51 +00:00
Duncan P. N. Exon Smith
4f95bcc836 Plug a leak introduced by r240848
Apparently this obvious leak was never exercised before, but r240848
exposed it.  Plug it.

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/5075

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240865 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-27 00:15:32 +00:00
Adrian Prantl
60bd365f59 Debug Info: Fix a bug in the DW_AT_bit_offset calculation that would
result in negative offsets and attempt a better job at documenting
the algorithm.

rdar://21082998

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240853 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 23:31:27 +00:00
Duncan P. N. Exon Smith
340d78d52d CodeGen: Create a proper ModuleSlotTracker for MachineInstr
Another follow-up related to r240848: try a little harder to share slot
tracking calculations within a single `MachineInstr` dump.  This is
unrelated to `MachineFunction::print()`, since that should be passing
through the function's `ModuleSlotTracker` by now, but could affect the
speed of dumping from a debugger if there is more than one IR-level
operand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240852 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 23:18:44 +00:00
Alex Lorenz
d986612a1a MIR Serialization: Serialize global address machine operands.
This commit serializes the global address machine operands.
This commit doesn't serialize the operand's offset and target
flags, it serializes only the global value reference.

Reviewers: Duncan P. N. Exon Smith

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240851 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 22:56:48 +00:00
Philip Reames
60d74b7101 [RewriteStatepointsForGC] Generalized vector phi/select handling for base pointers
This change extends the detection of base pointers for vector constructs to handle arbitrary phi and select nodes. The existing non-vector code already handles those, so this is basically just extending the vector special case to be less special cased. It still isn't generalized vector handling since we can't handle arbitrary vector instructions (e.g. shufflevectors), but it's a lot closer.

The general structure of the change is as follows:
 * Extend the base defining value relation over a subset of vector instructions and vector typed phi & select instructions.
 * Move scalarization from before base pointer rewriting to after base pointer rewriting. The extension of the BDV relation is sufficient to find vector base phis for vector inputs.
 * Preserve the existing special case logic for when the base of a vector element is locally obvious. This general idea could be extended to the scalar case as well.

Differential Revision: http://reviews.llvm.org/D10461#inline-84275



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240850 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 22:47:37 +00:00
Jingyue Wu
a70d990f47 [NVPTX] noop when kernel pointers are already global
Summary:
Some front ends make kernel pointers global already. In that case,
handlePointerParams does nothing.

Test Plan: more tests in lower-kernel-ptr-arg.ll

Reviewers: grosser

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240849 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 22:35:43 +00:00
Duncan P. N. Exon Smith
8266df7f7f CodeGen: Push the ModuleSlotTracker through Metadata
For another 1% speedup on the testcase in PR23865, push the
`ModuleSlotTracker` through to metadata-related printing in
`MachineBasicBlock::print()`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240848 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 22:28:47 +00:00
Philip Reames
bb8cc2f850 Minor style cleanup after 240843 [NFC]
Use a for-each loop in one case and rename the function to reflect it's new usage.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240847 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 22:21:52 +00:00
Duncan P. N. Exon Smith
a08efbfc8e CodeGen: Push the ModuleSlotTracker through MachineOperands
Push `ModuleSlotTracker` through `MachineOperand`s, dropping the time
for `llc -print-machineinstrs` on the testcase in PR23865 from ~13
seconds to ~9 seconds.  Now `SlotTracker::processFunctionMetadata()`
accounts for only 8% of the runtime, which seems reasonable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240845 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 22:06:47 +00:00
Philip Reames
982139fde2 [Verifier] Follow on to 240836
Address one missed review comment and do the rename I left out of that patch to make it reviewable.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240843 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 22:04:34 +00:00
Duncan P. N. Exon Smith
9a61a42713 CodeGen: Use a single SlotTracker in MachineFunction::print()
Expose enough of the IR-level `SlotTracker` so that
`MachineFunction::print()` can use a single one for printing
`BasicBlock`s.  Next step would be to lift this through a few more APIs
so that we can make other print methods faster.

Fixes PR23865, changing the runtime of `llc -print-machineinstrs` from
many minutes (killed after 3 minutes, but it wasn't very close) to
13 seconds for a 502185 line dump.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240842 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 22:04:20 +00:00
Tom Stellard
0be7d0cf17 AMDPGU/SI: Use correct resource descriptors for VI on HSA
Summary: We need to set MTYPE = 2 for VI shaders when targeting the HSA runtime.

Reviewers: arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240841 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-26 21:58:42 +00:00