Commit Graph

94398 Commits

Author SHA1 Message Date
Rafael Espindola
6fccaafd8b Remove the mblaze backend from llvm.
Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187145 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 18:55:05 +00:00
Andrew Trick
bef4c3e069 RegAllocGreedy comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187141 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 18:35:22 +00:00
Andrew Trick
8adae96fd9 Evict local live ranges if they can be reassigned.
The previous change to local live range allocation also suppressed
eviction of local ranges. In rare cases, this could result in more
expensive register choices. This commit actually revives a feature
that I added long ago: check if live ranges can be reassigned before
eviction. But now it only happens in rare cases of evicting a local
live range because another local live range wants a cheaper register.

The benefit is improved code size for some benchmarks on x86 and armv7.

I measured no significant compile time increase and performance
changes are noise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187140 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 18:35:19 +00:00
Andrew Trick
6ea2b9608a Allocate local registers in order for optimal coloring.
Also avoid locals evicting locals just because they want a cheaper register.

Problem: MI Sched knows exactly how many registers we have and assumes
they can be colored. In cases where we have large blocks, usually from
unrolled loops, greedy coloring fails. This is a source of
"regressions" from the MI Scheduler on x86. I noticed this issue on
x86 where we have long chains of two-address defs in the same live
range. It's easy to see this in matrix multiplication benchmarks like
IRSmk and even the unit test misched-matmul.ll.

A fundamental difference between the LLVM register allocator and
conventional graph coloring is that in our model a live range can't
discover its neighbors, it can only verify its neighbors. That's why
we initially went for greedy coloring and added eviction to deal with
the hard cases. However, for singly defined and two-address live
ranges, we can optimally color without visiting neighbors simply by
processing the live ranges in instruction order.

Other beneficial side effects:

It is much easier to understand and debug regalloc for large blocks
when the live ranges are allocated in order. Yes, global allocation is
still very confusing, but it's nice to be able to comprehend what
happened locally.

Heuristics could be added to bias register assignment based on
instruction locality (think late register pairing, banks...).

Intuituvely this will make some test cases that are on the threshold
of register pressure more stable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187139 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 18:35:14 +00:00
Bill Wendling
9e2ef7780b Add a way to add a kind-value string pair to an attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187138 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 18:34:24 +00:00
Adrian Prantl
4c9d299d80 typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187135 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 17:52:30 +00:00
Rafael Espindola
f204228b78 Current batch of -disable-debug-info-verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187130 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 17:16:05 +00:00
Tim Northover
c34cb8a0f2 AArch64: add llc-based tests for previous commit.
Better to have tests run even on non-AArch64 platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187128 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 16:23:55 +00:00
Tim Northover
4632e31f51 AArch64: fix even more JIT failures
The last patch corrected some issues, but constant-pool entries had actual
codegen bugs in the large memory model (which MCJIT uses).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187126 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 16:03:54 +00:00
Rafael Espindola
268f400c57 Don't end a file name with a dot. It looks odd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187124 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 15:00:17 +00:00
Tim Northover
107b2f26aa AArch64: don't mask off shift bits when processing JIT relocations.
This should actually make the MCJIT tests pass again on AArch64. I don't know
how I missed their failure before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187120 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 12:42:52 +00:00
Justin Holewinski
563a9cf7ba Fix a bug in TableGen where the intrinsic function name recognizer could mis-identify names if one was a prefix substring of the other
For two intrinsics 'llvm.nvvm.texsurf.handle' and 'llvm.nvvm.texsurf.handle.internal',
TableGen was emitting matching code like:

  if (Name.startswith("llvm.nvvm.texsurf.handle")) ...
  if (Name.startswith("llvm.nvvm.texsurf.handle.internal")) ...

We can never match "llvm.nvvm.texsurf.handle.internal" here because it will
always be erroneously matched by the first condition.

The fix is to sort the intrinsic names and emit them in reverse order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187119 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 12:32:00 +00:00
Richard Sandiford
c572005d7b Fix a comment cut-&-pasto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187117 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 10:53:02 +00:00
Richard Sandiford
ea14085be5 [SystemZ] Rework compare and branch support
Before the patch we took advantage of the fact that the compare and
branch are glued together in the selection DAG and fused them together
(where possible) while emitting them.  This seemed to work well in practice.
However, fusing the compare so early makes it harder to remove redundant
compares in cases where CC already has a suitable value.  This patch
therefore uses the peephole analyzeCompare/optimizeCompareInstr pair of
functions instead.

No behavioral change intended, but it paves the way for a later patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187116 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 09:34:38 +00:00
Richard Sandiford
bf99364f81 [SystemZ] Add LOCR and LOCGR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187113 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 09:11:15 +00:00
Richard Sandiford
cf20e45cc4 [SystemZ] Add LOC and LOCG
As with the stores, these instructions can trap when the condition is false,
so they are only used for things like (cond ? x : *ptr).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187112 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 09:04:52 +00:00
Richard Sandiford
b284e1bf08 [SystemZ] Add STOC and STOCG
These instructions are allowed to trap even if the condition is false,
so for now they are only used for "*ptr = (cond ? x : *ptr)"-style
constructs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187111 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 08:57:02 +00:00
Andrew Trick
13372886a6 MI Sched: Register pressure heuristics.
Consider which set is being increased or decreased before comparing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187110 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 07:26:35 +00:00
Andrew Trick
4b43ed53b6 MI Sched: track register pressure by importance of the set, not weight of the units.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187109 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 07:26:32 +00:00
Andrew Trick
bba663e30a RegPressure: Order the "pressure sets" by number of regunits per set.
This lets heuristics easily pick the most important set to follow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187108 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 07:26:29 +00:00
Andrew Trick
5dca613978 Dump LIS before regalloc. MI sched changes them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187107 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 07:26:26 +00:00
Manman Ren
27ce44d3b4 Debug Info: improve the verifier to check field types.
Make sure the context and type fields are MDNodes. We will generate
verification errors if those fields are non-empty strings.
Fix testing cases to make them pass the verifier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187106 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 06:43:01 +00:00
Rafael Espindola
4ef7eafa3f Respect llvm.used in Internalize.
The language reference says that:

"If a symbol appears in the @llvm.used list, then the compiler,
assembler, and linker are required to treat the symbol as if there is
a reference to the symbol that it cannot see"

Since even the linker cannot see the reference, we must assume that
the reference can be using the symbol table. For example, a user can add
__attribute__((used)) to a debug helper function like dump and use it from
a debugger.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187103 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 03:23:25 +00:00
Nick Lewycky
b97b162731 Check that TD isn't NULL before dereferencing it down this path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187099 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 02:55:14 +00:00
Rafael Espindola
2d680824e3 Make these methods const correct.
Thanks to Nick Lewycky for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187098 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 02:50:08 +00:00
Bill Wendling
f245ae5a4a Replace the "NoFramePointerElimNonLeaf" target option with a function attribute.
There's no need to specify a flag to omit frame pointer elimination on non-leaf
nodes...(Honestly, I can't parse that option out.) Use the function attribute
stuff instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187093 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 00:34:29 +00:00
Bill Wendling
9b344d920f Add helpful accessor methods to get the specified function attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187088 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 23:45:00 +00:00
Manman Ren
a280a839f5 Update testing cases to pass debug info verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187083 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 22:23:00 +00:00
Jakob Stoklund Olesen
4e9d45e0aa Speling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187076 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 20:47:57 +00:00
Quentin Colombet
e644b7743b Fix a bug in IfConverter with nested predicates.
Prior to this patch, IfConverter may widen the cases where a sequence of
instructions were executed because of the way it uses nested predicates. This
result in incorrect execution.

For instance, Let A be a basic block that flows conditionally into B and B be a
predicated block.
B can be predicated with A.BrToBPredicate into A iff B.Predicate is less
"permissive" than A.BrToBPredicate, i.e., iff A.BrToBPredicate subsumes
B.Predicate.

The IfConverter was checking the opposite: B.Predicate subsumes
A.BrToBPredicate.

<rdar://problem/14379453>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187071 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 20:20:37 +00:00
Manman Ren
6482427926 Update testing cases to pass debug info verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187066 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 18:56:43 +00:00
Rafael Espindola
094597171a add -disable-debug-info-verifier to 3 test to fix tests with pipefail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187064 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 18:44:10 +00:00
Akira Hatanaka
94ce6dadd1 [mips] Make MipsAsmParser::parseCCRRegs return NoMatch instead of ParseFail
when there wasn't a match. This behavior is consistent with other register
parsing methods.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187063 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 18:43:52 +00:00
Jakob Stoklund Olesen
f32ec17b9f Update old llc documentation.
Patch by Hafiz Abid!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187056 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 17:45:11 +00:00
Petar Jovanovic
f0639501ea [mips] Remove XFAIL from test-ptr-reloc-remote.ll
The change r187019 has fixed multiple relocations in dynamic linker for
MIPS, so now this test passes for MIPS.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187053 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 17:14:05 +00:00
Manman Ren
504a7fb8f9 Debug Info: improve the Finder.
Improve the Finder to handle context of a DIVariable used by DbgValueInst.
Fix testing cases to make them pass the verifier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187052 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 17:10:09 +00:00
Benjamin Kramer
6a565e5be6 TRE: Move class into anonymous namespace.
While there shrink a dangerously large SmallPtrSet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187050 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 16:12:08 +00:00
Manman Ren
3a0a4d0c5c Update testing cases to pass debug info verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187049 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 15:55:41 +00:00
Rafael Espindola
e9bff745a8 Add -disable-debug-info-verifier to a RUN line.
Found by running the test with pipefail enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187046 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 14:56:31 +00:00
Rafael Espindola
1e3c0a4c77 Don't leak when expanding response files.
Before this patch we would strdup each argument. If one was a response file,
we would replace it with the response file contents, leaking the original
strdup result.

We now don't strdup the originals and let StringSaver free any memory it
allocated. This also saves a bit of malloc traffic when response files are
not used.

Leak found by the valgrind build bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187042 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 14:32:01 +00:00
Rafael Espindola
7976842791 Delete the buffer in createObjectFile if it fails.
The Binary constructor takes ownership of the memory buffer. This is a fairly
unfortunate interface, but for now make createObjectFile consistent with it
by also deleting the buffer if it fails.

Fixes a leak in llvm-ar found by the valgrind bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187039 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 14:00:26 +00:00
Rafael Espindola
36f5ac198f llvm-ar is far closer to being a regular ar implementation now. Update the docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187034 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 13:13:24 +00:00
Petar Jovanovic
959d2f70fb [test commit] Minor comment change.
Testing commit access credentials.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187032 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 13:02:35 +00:00
Chandler Carruth
b7f27824fb Fix a problem I introduced in r187029 where we would over-eagerly
schedule an alloca for another iteration in SROA. This only showed up
with a mixture of promotable and unpromotable selects and phis. Added
a test case for this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187031 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 12:12:17 +00:00
Elena Demikhovsky
e3809eed34 I'm starting to commit KNL backend. I'll push patches one-by-one. This patch includes support for the extended register set XMM16-31, YMM16-31, ZMM0-31.
The full ISA you can see here: http://software.intel.com/en-us/intel-isa-extensions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187030 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 11:02:47 +00:00
Chandler Carruth
9b3b286247 Fix PR16687 where we were incorrectly promoting an alloca that had
pending speculation for a phi node. The problem here is that we were
using growth of the specluation set as an indicator of whether
speculation would occur, and if the phi node is already in the set we
don't see it grow. This is a symptom of the fact that this signal is
a total hack.

Unfortunately, I couldn't really come up with a non-hacky way of
signaling that promotion remains valid *after* speculation occurs, such
that we only speculate when all else looks good for promotion. In the
end, I went with at least a much more explicit approach of doing the
work of queuing inside the phi and select processing and setting
a preposterously named flag to convey that we're in the special state of
requiring speculating before promotion.

Thanks to Richard Trieu and Nick Lewycky for the excellent work reducing
a testcase for this from a pretty giant, nasty assert in a big
application. =] The testcase was excellent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187029 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 09:47:28 +00:00
David Fang
ef540b194f allow tests to run on powerpc-darwin8 again, checking for __ppc__
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187027 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 07:52:16 +00:00
Craig Topper
f63ef914b6 Split generated asm mnemonic matching table into a separate table for each asm variant.
This removes the need to store the asm variant in each row of the single table that existed before. Shaves ~16K off the size of X86AsmParser.o.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187026 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 07:33:14 +00:00
Craig Topper
8d5a10fe60 Revert accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187021 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 04:52:55 +00:00
Craig Topper
f7beb2cc1f Fix aliases for shrd/shld to handle Intel syntax properly. Also suppress them from being used by the asm printer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187020 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 04:38:13 +00:00