Commit Graph

101630 Commits

Author SHA1 Message Date
Juergen Ributzka
62f4b48fc1 [Constant Hoisting] Erase dead cast instructions.
The cleanup code that removes dead cast instructions only removed them from the
basic block, but didn't delete them. This fix erases them now too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204538 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-22 01:49:30 +00:00
Juergen Ributzka
5cfc91c9a5 [Constant Hoisting] Fix multiple entries for the same basic block in PHI nodes.
A PHI node usually has only one value/basic block pair per incoming basic block.
In the case of a switch statement it is possible that a following PHI node may
have more than one such pair per incoming basic block. E.g.:
%0 = phi i64 [ 123456, %case2 ], [ 654321, %Entry ], [ 654321, %Entry ]
This is valid and the verfier doesn't complain, because both values are the
same.

Constant hoisting materializes the constant for each operand separately and the
value is still the same, but the variable names have changed. As a result the
verfier can't recognize anymore that they are the same value and complains.

This fix adds special update code for PHI node in constant hoisting to prevent
this corner case.

This fixes <rdar://problem/16394449>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204537 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-22 01:49:27 +00:00
Andrea Di Biagio
d47cb57ab8 [DAG] Fix an assertion failure caused by an invalid cast in method 'BuildVectorSDNode::isConstantSplat'
This patch renames method 'isConstantSplat' as 'getConstantSplatValue'
(mainly for consistency reasons), and rewrites its logic to ensure
that we always perform a legal 'cast<ConstantSDNode>'.

Added test shift-combine-crash.ll to verify that DAGCombiner no longer crashes with an assertion failure in the attempt to simplify a vector shift by a vector of all undef counts.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204536 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-22 01:47:22 +00:00
NAKAMURA Takumi
4696def45d Suppress SupportTests.LockFileManagerTest on win32 for investigating.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204533 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-22 00:27:17 +00:00
Adrian Prantl
e25ab8e305 Delete stale comment. Thanks, Eric!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204530 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 22:58:25 +00:00
Adrian Prantl
0fb178b831 Dwarf Debug: Remove some cargo-cult type uniquing. Scopes do not have
an ID, so this is a noop.
Thanks Manman for catching this!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204528 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 22:16:32 +00:00
Rafael Espindola
a60f719c8d Fix the value computation in
sym_a:
sym_d = sym_a + 1

This is the smallest fix I was able to extract from what got reverted in
r204203.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204527 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 22:00:29 +00:00
Arnaud A. de Grandmaison
96c049d56d Remove some dead assignements found by scan-build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204526 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 21:54:46 +00:00
Manman Ren
8dbd561a88 Register allocator: add condition to hoist a spill to outer loop.
We make sure a spill is not hoisted to a hotter outer loop by adding
a condition. Hoist a spill to outer loop if there are multiple dependents
(it can be beneficial if more than one dependents are hoisted) or
if DepSV (the hoisting source) is hotter than SV (the hoisting destination).

rdar://16268194


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204522 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 21:46:24 +00:00
Argyrios Kyrtzidis
c1011e635c [Support] Follow up to r204426, for LockFileManager, make the given path absolute so relative paths are properly handled in both Windows and Unix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204520 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 21:45:07 +00:00
Duncan P. N. Exon Smith
aa4135aa7f InstrProf: Cleanup binary profdata testcase
Cleanup the current binary testcase for profile data.

  - Rename it to something more specific.
  - Remove the text comparison.
  - Check the output of llvm-profdata show.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204518 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 21:20:35 +00:00
Duncan P. N. Exon Smith
50f9696f1d InstrProf: Move constructor to the header
Fixes 80-column violation at the same time.

<rdar://problem/15950346>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204516 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 20:59:19 +00:00
Duncan P. N. Exon Smith
813d0a2761 InstrProf: Change magic number to have non-text characters
Include non-text characters in the magic number so that text files can't
match.

<rdar://problem/15950346>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204513 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 20:42:37 +00:00
Duncan P. N. Exon Smith
bc2740a598 InstrProf: Use move semantics with unique_ptr
<rdar://problem/15950346>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204512 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 20:42:34 +00:00
Duncan P. N. Exon Smith
bb56c4808e InstrProf: Detect magic numbers in a more scalable way
No functionality change.

<rdar://problem/15950346>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204511 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 20:42:31 +00:00
Duncan P. N. Exon Smith
ebaeaa934e InstrProf: Actually detect bad headers
<rdar://problem/15950346>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204510 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 20:42:28 +00:00
Juergen Ributzka
56db3a97cd [RuntimeDyld] Fix comment for previous commit (r204439)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204508 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 20:38:46 +00:00
Juergen Ributzka
b0e33fdcd0 [RuntimeDyld] clang-format files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204507 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 20:28:42 +00:00
David Blaikie
4d221b3e89 DebugInfo: Omit DW_AT_addr_base from skeletal type units.
Type units have no addresses, so there's no need for DW_AT_addr_base.
This removes another relocation from every skeletal type unit and brings
LLVM's skeletal type units in line with GCC's (containing only
GNU_dwo_name (strp), comp_dir (strp), and GNU_pubnames (flag_present)).

Cary's got some ideas about using str_index in the .o file to reduce
those last two relocations (well, replace two relocations with one
relocation (pointing to the string index) and two indicies)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204506 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 20:27:21 +00:00
Chad Rosier
1eb67a4f84 [AArch64] Add SchedRW lists to NEON instructions.
Previously, only regular AArch64 instructions were annotated with SchedRW lists.
This patch does the same for NEON enabling these instructions to be scheduled by
the MIScheduler. Additionally, store operations are now modeled and a few
SchedRW lists were updated for bug fixes (e.g. multiple def operands).

Reviewers: apazos, mcrosier, atrick
Patch by Dave Estes <cestes@codeaurora.org>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204505 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 19:34:41 +00:00
Justin Bogner
218c7c821b ProfileData: Avoid double underscores in header guards
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204501 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 18:46:29 +00:00
Duncan P. N. Exon Smith
ddfcb21b3f InstrProf: Read raw binary profile in llvm-profdata
Read a raw binary profile that corresponds to a memory dump from the
runtime profile.

The test is a binary file generated from
cfe/trunk/test/Profile/c-general.c with the new compiler-rt runtime and
the matching text version of the input.  It includes instructions on how
to regenerate.

<rdar://problem/15950346>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204496 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 18:26:05 +00:00
Justin Bogner
c61e1f53d9 ProfileData: Avoid brace initialization, windows doesn't like it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204494 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 18:22:16 +00:00
Matt Arsenault
55d17f4842 R600/SI: Move instruction patterns to scalar versions.
Some of them also had the pattern on both, so this removes the
duplication.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204492 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 18:01:18 +00:00
Rafael Espindola
d38fea31a5 Remove redundant test.
This is tested from MC already.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204491 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 18:00:51 +00:00
Rafael Espindola
3f687d350c Move codegen test over to MC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204490 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 17:55:34 +00:00
Justin Bogner
496d7f66a0 ProfileData: Introduce InstrProfWriter using the naive text format
This isn't a format we'll want to write out in practice, but moving it
to the writer library simplifies llvm-profdata and isolates it from
further changes to the format.

This also allows us to update the tests to not rely on the text output
format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204489 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 17:46:22 +00:00
Rafael Espindola
469198f995 Convert test to using cfi.
An unnamed global in llvm still produces a regular symbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204488 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 17:38:01 +00:00
Paul Robinson
b9d6263053 Refactor llvm/test/lit.cfg to use lit.util.which.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204486 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 17:31:35 +00:00
Justin Bogner
60bc906724 llvm-profdata: Implement show command
The `llvm-profdata show` command summarizes a profdata file's contents
in a human readable format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204485 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 17:29:44 +00:00
Rafael Espindola
0b50368e68 Remove redundant test.
The production of the .eh symbols is done from MC now and we already have tests
for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204483 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 17:26:35 +00:00
Justin Bogner
c0f3b72555 ProfileData: Introduce the InstrProfReader interface and a text reader
This introduces the ProfileData library and updates llvm-profdata to
use this library for reading profiles. InstrProfReader is an abstract
base class that will be subclassed for both the raw instrprof data
from compiler-rt and the efficient instrprof format that will be used
for PGO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204482 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 17:24:48 +00:00
Rafael Espindola
6c22b041da Split out the MC part of this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204481 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 17:16:11 +00:00
Daniel Sanders
e85dd7c26d [mips] Correct lowering of VECTOR_SHUFFLE to VSHF.
Summary:
VECTOR_SHUFFLE concatenates the vectors in an vectorwise fashion.
  <0b00, 0b01> + <0b10, 0b11> -> <0b00, 0b01, 0b10, 0b11>
VSHF concatenates the vectors in a bitwise fashion:
  <0b00, 0b01> + <0b10, 0b11> ->
  0b0100       + 0b1110       -> 0b01001110
                                 <0b10, 0b11, 0b00, 0b01>
We must therefore swap the operands to get the correct result.

The test case that discovered the issue was MultiSource/Benchmarks/nbench.

Reviewers: matheusalmeida

Reviewed By: matheusalmeida

Differential Revision: http://llvm-reviews.chandlerc.com/D3142

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204480 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 16:56:51 +00:00
Renato Golin
ec15d70712 Add overall description, file comments, some structure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204479 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 16:49:43 +00:00
Tom Stellard
a1d28f6dd7 R600/SI: Handle MUBUF instructions in SIInstrInfo::moveToVALU()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204476 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 15:51:57 +00:00
Tom Stellard
1f1c0495d0 R600/SI: Handle S_MOV_B64 in SIInstrInfo::moveToVALU()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204475 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 15:51:54 +00:00
Tom Stellard
af4c7da306 R600/SI: Use SGPR_(32|64) reg clases when lowering SI_ADDR64_RSRC
The SReg_(32|64) register classes contain special registers in addition
to the numbered SGPRs.  This can lead to machine verifier errors when
these register classes are used as sub-registers for SReg_128, since
SReg_128 only uses the numbered SGPRs.

Replacing SReg_(32|64) with SGPR_(32|64) fixes this problem, since
the SGPR_(32|64) register classes contain only numbered SGPRs.

Tests cases for this are comming in a later commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204474 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 15:51:53 +00:00
Tom Stellard
1b05bb2900 Sink: Don't sink static allocas from the entry block
CodeGen treats allocas outside the entry block as dynamically sized
stack objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204473 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 15:51:51 +00:00
Richard Sandiford
20115c69f5 [SystemZ] Use "let Predicates =" for blocks of new instructions
...instead of a separate Requires for each one.  This style was already
used in some places and seems more compact.

No behavioral change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204452 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 11:04:54 +00:00
Richard Sandiford
6b6889d87b [SystemZ] Add support for z196 float<->unsigned conversions
These complement the older float<->signed instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204451 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 10:56:30 +00:00
Matheus Almeida
d09863076a [mips] Update namespace.
We should be using the llvm namespace and not an anonymous namespace
in a header file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204450 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 10:35:14 +00:00
Juergen Ributzka
4923eea4f6 [RuntimeDyld] Allow processRelocationRef to process more than one relocation entry at a time.
Some targets require more than one relocation entry to perform a relocation.
This change allows processRelocationRef to process more than one relocation
entry at a time by passing the relocation iterator itself instead of just
the relocation entry.

Related to <rdar://problem/16199095>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204439 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 07:26:41 +00:00
Kevin Qin
fc029f2983 Fix test command line to avoid generating output file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204437 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 07:20:29 +00:00
Juergen Ributzka
d3cf783ed1 [Constant Hoisting] Make the constant materialization cost operand dependent
Extend the target hook to take also the operand index into account when
calculating the cost of the constant materialization.

Related to <rdar://problem/16381500>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204435 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 06:04:45 +00:00
Juergen Ributzka
337eb3adbe [Constant Hoisting] Lazily compute the idom and cache the result.
Related to <rdar://problem/16381500>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204434 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 06:04:39 +00:00
Juergen Ributzka
8ebaf63750 [Constant Hoisting] Change the algorithm to only track constants for instructions.
Originally the algorithm would search for expensive constants and track their
users, which could be instructions and constant expressions. This change only
tracks the constants for instructions, but constant expressions are indirectly
covered too. If an operand is an constant expression, then we look through the
expression to find anny expensive constants.

The algorithm keep now track of the instruction and the operand index where the
constant is used. This allows more precise hoisting of constant materialization
code for PHI instructions, because we only hoist to the basic block of the
incoming operand. Before we had to find the idom of all PHI operands and hoist
the materialization code there.

This also makes updating of instructions easier. Before we had to keep track of
the original constant, find it in the instructions, and then replace it. Now we
can just simply update the operand.

Related to <rdar://problem/16381500>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204433 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 06:04:36 +00:00
Juergen Ributzka
032dafd64a [Constant Hoisting] Fix capitalization of function names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204432 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 06:04:33 +00:00
Juergen Ributzka
4cd215229d [Constant Hoisting] Replace the MapVector with a separate Map and Vector to keep track of constant candidates.
This simplifies working with the constant candidates and removes the tight
coupling between the map and the vector.

Related to <rdar://problem/16381500>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204431 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 06:04:30 +00:00
Saleem Abdulrasool
6785cf007c MCParser: add an assertion
Add an assertion that the section is not NULL.  Potential NULL pointer
dereference identified by clang static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204429 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 05:13:23 +00:00