1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

93466 Commits

Author SHA1 Message Date
Joey Gouly
7a6dcc8db9 Add a V8FP instruction 'vcvt{b,t}' to convert between half and double precision.
llvm-svn: 185620
2013-07-04 10:04:08 +00:00
Jakob Stoklund Olesen
dfcec36661 Typo.
llvm-svn: 185618
2013-07-04 04:53:49 +00:00
Jakob Stoklund Olesen
26add346da Simplify landing pad lowering.
Stop using the ISD::EXCEPTIONADDR and ISD::EHSELECTION when lowering
landing pad arguments. These nodes were previously legalized into
CopyFromReg nodes, but that never worked properly because the
CopyFromReg node weren't guaranteed to be  scheduled at the top of the
basic block.

This meant the exception pointer and selector registers could be
clobbered before being copied to a virtual register.

This patch copies the two physical registers to virtual registers at
the beginning of the basic block, and lowers the landingpad instruction
directly to two CopyFromReg nodes reading the *virtual* registers. This
is safe because virtual registers don't get clobbered.

A future patch will remove the ISD::EXCEPTIONADDR and ISD::EHSELECTION
nodes.

llvm-svn: 185617
2013-07-04 04:53:45 +00:00
Jakob Stoklund Olesen
d2ddad598d FastISel can only apend to basic blocks.
Compute the insertion point from the end of the basic block instead of
skipping labels from the front.

This caused failures in landing pads when live-in copies where inserted
before instruction selection.

llvm-svn: 185616
2013-07-04 04:32:39 +00:00
Jakob Stoklund Olesen
7857a6e921 Live-in copies go *after* EH_LABELs.
This will soon be tested by exception handling working at all.

llvm-svn: 185615
2013-07-04 04:32:35 +00:00
Nick Lewycky
5b802270ae Tabs to spaces. No functionality change.
llvm-svn: 185612
2013-07-04 03:51:53 +00:00
Craig Topper
3cf1a91a4f Add a space between closing template '>' to unbreak build.
llvm-svn: 185607
2013-07-04 01:43:17 +00:00
Craig Topper
783617eba7 Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size.
llvm-svn: 185606
2013-07-04 01:31:24 +00:00
Eric Christopher
f5e8037cf3 Reapply r185601 with a fix for the cmake build.
llvm-svn: 185605
2013-07-04 01:10:38 +00:00
Eric Christopher
c31256808e Temporarily revert 185601 as it caused cmake build regressions.
llvm-svn: 185603
2013-07-04 00:51:26 +00:00
Eric Christopher
f92d25bdca Add support for futimens for platforms that don't support futimes.
Patch by pashev.igor.

llvm-svn: 185601
2013-07-04 00:47:09 +00:00
Jakob Stoklund Olesen
8099b21497 Revert r185595-185596 which broke buildbots.
Revert "Simplify landing pad lowering."
Revert "Remove the EXCEPTIONADDR, EHSELECTION, and LSDAADDR ISD opcodes."

llvm-svn: 185600
2013-07-04 00:26:30 +00:00
Jakob Stoklund Olesen
8bc33424b2 Remove the EXCEPTIONADDR, EHSELECTION, and LSDAADDR ISD opcodes.
These exception-related opcodes are not used any longer.

llvm-svn: 185596
2013-07-03 23:56:31 +00:00
Jakob Stoklund Olesen
62ea9eb287 Simplify landing pad lowering.
Stop using the ISD::EXCEPTIONADDR and ISD::EHSELECTION when lowering
landing pad arguments. These nodes were previously legalized into
CopyFromReg nodes, but that never worked properly because the
CopyFromReg node weren't guaranteed to be  scheduled at the top of the
basic block.

This meant the exception pointer and selector registers could be
clobbered before being copied to a virtual register.

This patch copies the two physical registers to virtual registers at
the beginning of the basic block, and lowers the landingpad instruction
directly to two CopyFromReg nodes reading the *virtual* registers. This
is safe because virtual registers don't get clobbered.

A future patch will remove the ISD::EXCEPTIONADDR and ISD::EHSELECTION
nodes.

llvm-svn: 185595
2013-07-03 23:56:24 +00:00
Jakob Stoklund Olesen
131f26f3e2 Add MachineBasicBlock::addLiveIn().
This function adds a live-in physical register to an MBB and ensures
that it is copied to a virtual register immediately.

llvm-svn: 185594
2013-07-03 23:56:20 +00:00
Stephen Lin
6aa0eb5922 Have ARMBaseRegisterInfo::getCallPreservedMask return the 'correct' mask for the GHC calling convention.
This is purely academic because GHC calls are always tail calls so the register mask will never be used; however, this change makes the code clearer and brings the ARM implementation of the GHC calling convention in line with the X86 implementation. Also, it might save someone else some time trying to figuring out what is happening...

llvm-svn: 185592
2013-07-03 23:39:13 +00:00
Eric Christopher
62eb870be4 Hoist all of the Entry.getLoc() calls int a single variable.
llvm-svn: 185589
2013-07-03 22:40:21 +00:00
Eric Christopher
ca3c4f4738 Make DotDebugLocEntry a class, reorder the members along with comments
for them and update all uses.

llvm-svn: 185588
2013-07-03 22:40:18 +00:00
Quentin Colombet
49190aa8d1 [ARM] Improve the instruction selection of vector loads.
In the ARM back-end, build_vector nodes are lowered to a target specific
build_vector that uses floating point type. 
This works well, unless the inserted bitcasts survive until instruction
selection. In that case, they incur moves between integer unit and floating
point unit that may result in inefficient code.

In other words, this conversion may introduce artificial dependencies when the
code leading to the build vector cannot be completed with a floating point type.

In particular, this happens when loads are not aligned.

Before this patch, in that case, the compiler generates general purpose loads
and creates the floating point vector from them, instead of directly using the
vector unit.

The patch uses a vector friendly sequence of code when the inserted bitcasts to
floating point survived DAGCombine.

This is done by a target specific DAGCombine that changes the target specific
build_vector into a sequence of insert_vector_elt that get rid of the bitcasts.

<rdar://problem/14170854>

llvm-svn: 185587
2013-07-03 21:42:57 +00:00
Eric Christopher
57e6ad0eb6 Elaborate on comment.
llvm-svn: 185586
2013-07-03 21:37:03 +00:00
Eric Christopher
656b62afda Add names to the header file since they help in documenting the API
(and for consistency).

llvm-svn: 185585
2013-07-03 21:23:59 +00:00
Bill Schmidt
4a8c7e0dd6 [PowerPC] FreeBSD does not require f128 in its data layout string.
Long double is 64 bits on FreeBSD PPC, so the f128 entry is superfluous.

llvm-svn: 185583
2013-07-03 21:03:35 +00:00
Renato Golin
01d859312e Add platform specific tests doc
llvm-svn: 185581
2013-07-03 20:56:33 +00:00
Tilmann Scheller
07e970a22d ARM: Prevent ARMAsmParser::shouldOmitCCOutOperand() from misidentifying certain Thumb2 add immediate T3 encodings.
Before the fix Thumb2 instructions of type "add rD, rN, #imm" (T3 encoding, see ARM ARM A8.8.4) with rD and rN both being low registers (r0-r7) were classified as having the T4 encoding.

The T4 encoding doesn't have a cc_out operand so for above instructions the operand gets erroneously removed, corrupting the token stream and leading to parse errors later in the process.

This bug prevented "add r1, r7, #0xcbcbcbcb" from being assembled correctly.

Fixes <rdar://problem/14224440>.

llvm-svn: 185575
2013-07-03 20:38:01 +00:00
Eric Christopher
18d59bdefb Move typedefs inside the class that they belong to.
llvm-svn: 185573
2013-07-03 20:36:36 +00:00
Chad Rosier
13dd68f55a Use an RWMutex instead of a Mutex in PassRegistry.
Patch by Alex Crichton <alex@crichton.co>.  Approved by Chris Lattner.

llvm-svn: 185566
2013-07-03 18:38:08 +00:00
Ulrich Weigand
db2c0d673b [PowerPC] Support lmw/stmw in the asm parser
This adds support for the load/store multiple instructions,
currently used by the asm parser only.

llvm-svn: 185564
2013-07-03 18:29:47 +00:00
Ulrich Weigand
a5490843a1 [PowerPC] Use mtocrf when available
Just as with mfocrf, it is also preferable to use mtocrf instead of
mtcrf when only a single CR register is to be written.

Current code however always emits mtcrf.  This probably does not matter
when using an external assembler, since the GNU assembler will in fact
automatically replace mtcrf with mtocrf when possible.  It does create
inefficient code with the integrated assembler, however.

To fix this, this patch adds MTOCRF/MTOCRF8 instruction patterns and
uses those instead of MTCRF/MTCRF8 everything.  Just as done in the
MFOCRF patch committed as 185556, these patterns will be converted
back to MTCRF if MTOCRF is not available on the machine.

As a side effect, this allows to modify the MTCRF pattern to accept
the full range of mask operands for the benefit of the asm parser.

llvm-svn: 185561
2013-07-03 17:59:07 +00:00
Ulrich Weigand
3a4efe4cac [PowerPC] Always use mfocrf if available
When accessing just a single CR register, it is always preferable to
use mfocrf instead of mfcr, if the former is available on the CPU.

Current code makes that distinction in many, but not all places
where a single CR register value is retrieved.  One missing
location is PPCRegisterInfo::lowerCRSpilling.

To fix this and make this simpler in the future, this patch changes
the bulk of the back-end to always assume mfocrf is available and
simply generate it when needed.

On machines that actually do not support mfocrf, the instruction
is replaced by mfcr at the very end, in EmitInstruction.

This has the additional benefit that we no longer need the
MFCRpseud hack, since before EmitInstruction we always have
a MFOCRF instruction pattern, which already models data flow
as required.

The patch also adds the MFOCRF8 version of the instruction,
which was missing so far.

Except for the PPCRegisterInfo::lowerCRSpilling case, no change
in generated code intended.

llvm-svn: 185556
2013-07-03 17:05:42 +00:00
Rafael Espindola
006ee945bb Prefix failing commands with not to make clear they are expected to fail.
llvm-svn: 185554
2013-07-03 16:41:29 +00:00
Rafael Espindola
4af20b9fde Remove another old test.
It was only passing because 'grep andpd' was not finding any andpd, but
we don't fail if part of a pipe fails.

llvm-svn: 185552
2013-07-03 16:35:26 +00:00
Rafael Espindola
6cccbc7b17 Remove test for the old EH system. It doesn't parse anymore.
llvm-svn: 185551
2013-07-03 16:30:01 +00:00
Rafael Espindola
497f51e1cb Fix test: It was missing run lines and llvm-dis has no -disable-verify option.
llvm-svn: 185550
2013-07-03 16:27:55 +00:00
Rafael Espindola
4f28e3be09 Add support for gnu archives with a string table and no symtab.
While there, use early returns to reduce nesting.

llvm-svn: 185547
2013-07-03 15:57:14 +00:00
Rafael Espindola
69d633e340 Make llvm-nm return 1 on error.
This is a small compatibility improvement with gnu nm and makes llvm-nm more
useful as a testing tool.

llvm-svn: 185546
2013-07-03 15:46:03 +00:00
Ulrich Weigand
ab82d5ed81 [PowerPC] Remove dead code from PPCDAGToDAGISel::SelectSETCC
The subroutine getCRIdxForSetCC has a parameter "Other" and comment:

  If this returns with Other != -1, then the returned comparison
  is an or of two simpler comparisons.

However for at least the last five years this routine has never
returned a value of Other != -1; these cases are now handled
differently to begin with.

This patch removes the parameter and the code in SelectSETCC that
attempted to handle the Other != -1 case.

llvm-svn: 185541
2013-07-03 15:13:30 +00:00
Craig Topper
9729e843cb Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size.
llvm-svn: 185540
2013-07-03 15:07:05 +00:00
Craig Topper
785d969b01 Fix regular expression used by 'make update' to only look for 'I' and '?' at the start of svn info results and to check for spaces after 'I' instead of just after '?'.
Previously it was able to match 'I' anywhere in the filenames of the svn info results instead of just files that where ignored or unknown to svn. This would cause 'make update' to infinitely recurse if a file was modified with I anywhere in its name since svn info would return a Path pointing to the llvm root for those files.

llvm-svn: 185539
2013-07-03 14:48:37 +00:00
Evgeniy Stepanov
c7afcedd2c [msan] Unpoison stack allocations and undef values in blacklisted functions.
This changes behavior of -msan-poison-stack=0 flag from not poisoning stack
allocations to actively unpoisoning them.

llvm-svn: 185538
2013-07-03 14:39:14 +00:00
Ulrich Weigand
a57564917e [PowerPC] Make specialized AltiVec patterns isCodeGenOnly
A couple of AltiVec patterns are just specialized forms of the
generic instruction pattern, and should therefore be marked
isCodeGenOnly to avoid confusing the asm parser:
VCFSX_0, VCTUXS_0, VCFUX_0, VCTSXS_0, and V_SETALLONES.

Noticed by inspection of the generated PPCGenAsmMatcher.inc.

llvm-svn: 185533
2013-07-03 12:51:09 +00:00
Ulrich Weigand
33ba896ad1 [PowerPC] Support mtspr/mfspr in the asm parser
This adds support for the generic forms of mtspr/mfspr
for the asm parser.  The compiler will continue to use
the specialized patters for mtlr etc. since those are
needed to correctly describe data flow.

llvm-svn: 185532
2013-07-03 12:32:41 +00:00
Richard Sandiford
c7495a0fca [SystemZ] Fold more spills
Add a mapping from register-based <INSN>R instructions to the corresponding
memory-based <INSN>.  Use it to cut down on the number of spill loads.

Some instructions extend their operands from smaller fields, so this
required a new TSFlags field to say how big the unextended operand is.

This optimisation doesn't trigger for C(G)R and CL(G)R because in practice
we always combine those instructions with a branch.  Adding a test for every
other case probably seems excessive, but it did catch a missed optimisation
for DSGF (fixed in r185435).

llvm-svn: 185529
2013-07-03 10:10:02 +00:00
Mihai Popa
2403cfc9a6 This corrects the implementation of Thumb ADR instruction. There are three issues:
1. it should accept only 4-byte aligned addresses
2. the maximum offset should be 1020
3. it should be encoded with the offset scaled by two bits

llvm-svn: 185528
2013-07-03 09:21:44 +00:00
Tim Northover
f4b07c69d1 ARM: relax the atomic release barrier to "dmb ishst" on Swift
Swift cores implement store barriers that are stronger than the ARM
specification but weaker than general barriers. They are, in fact, just about
enough to provide the ordering needed for atomic operations with release
semantics.

This patch makes use of that quirk.

llvm-svn: 185527
2013-07-03 09:20:36 +00:00
Richard Sandiford
d9f42b4f28 [SystemZ] Rename mapping table fields
Rename Function->DispKey and PairType->DispSize.  I'd originally used
"Function" because I thought it might be useful for other InstMappings.
However, it turns out that having two very similar instructions with the
same Function makes it pretty useless for anything other than the displacement
size key.  Other InstMappings will want the key to be defined for only one
instruction in the pair.

No behavioural change intended.

llvm-svn: 185526
2013-07-03 09:19:58 +00:00
Richard Sandiford
69fb47f374 [SystemZ] Fix caller-allocated save slot FIXME
Get rid of some old code (and associated FIXME) for handling the
caller-allocated register save area.  No behavioural change intended.

llvm-svn: 185525
2013-07-03 09:11:00 +00:00
Eric Christopher
ca56a2549b Remove unused field.
llvm-svn: 185523
2013-07-03 08:26:07 +00:00
Eric Christopher
73d58b6c4d Constify a few functions.
llvm-svn: 185520
2013-07-03 08:13:55 +00:00
Richard Osborne
c817e9456e [XCore] Whitespace fixes, no functionality change.
llvm-svn: 185519
2013-07-03 07:49:03 +00:00
Richard Osborne
207824e7f8 [XCore] Add ISel pattern for LDWCP
Patch by Robert Lytton.

llvm-svn: 185518
2013-07-03 07:48:50 +00:00