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

1650 Commits

Author SHA1 Message Date
Jim Grosbach
2c211c7bfe Clarify comment phrasing.
llvm-svn: 83148
2009-09-30 15:23:38 +00:00
Evan Cheng
86bd5c3ae1 Add a option which would move ld/st multiple pass before post-alloc scheduling.
llvm-svn: 83145
2009-09-30 08:53:01 +00:00
Jim Grosbach
9655673c95 When checking whether we need to reserve a register for the scavenger,
the size of the saved frame pointer needs to be taken into account.

llvm-svn: 83136
2009-09-30 01:43:29 +00:00
Jim Grosbach
2d057f09e8 Add "isBarrier = 1" to return instructions.
Patch by Sylvere Teissier.

llvm-svn: 83135
2009-09-30 01:35:11 +00:00
Bob Wilson
48f9855607 For Darwin, emit all the text section directives together before the dwarf
section directives.  This causes the assembler to put the text sections at
the beginning of the object file, which helps work around a limitation of the
Darwin ARM relocations.  Radar 7255355.

llvm-svn: 83127
2009-09-30 00:23:42 +00:00
David Goodwin
a282690f82 Remove -post-RA-schedule flag and add a TargetSubtarget method to enable post-register-allocation scheduling. By default it is off. For ARM, enable/disable with -mattr=+/-postrasched. Enable by default for cortex-a8.
llvm-svn: 83122
2009-09-30 00:10:16 +00:00
Jim Grosbach
278d0d5b3d minor cleanup and add clarifying comment
llvm-svn: 83117
2009-09-29 23:17:20 +00:00
Evan Cheng
d2bf81c7af Fix PR4687. Pre ARMv5te does not support ldrd / strd. Patch by John Tytgat.
llvm-svn: 83058
2009-09-29 07:07:30 +00:00
Jim Grosbach
9cb82ce219 Adjust processFunctionBeforeCalleeSavedScan() to correctly reserve a stack
slot for the register scavenger when compiling Thumb1 functions.

llvm-svn: 83023
2009-09-28 22:08:06 +00:00
Evan Cheng
c15ba1de94 Fix Thumb2 IT block pass bug. t2MOVi32imm may not be the start of a IT block.
llvm-svn: 83008
2009-09-28 20:47:15 +00:00
Jakob Stoklund Olesen
31fcbdefbb Introduce the TargetInstrInfo::KILL machine instruction and get rid of the
unused DECLARE instruction.

KILL is not yet used anywhere, it will replace TargetInstrInfo::IMPLICIT_DEF
in the places where IMPLICIT_DEF is just used to alter liveness of physical
registers.

llvm-svn: 83006
2009-09-28 20:32:26 +00:00
Bob Wilson
bbcf30c05c Pass the optimization level when constructing the ARM instruction selector.
Otherwise, it is always set to "default", which prevents debug info from
even being generated during isel.  Radar 7250345.

llvm-svn: 82988
2009-09-28 14:30:20 +00:00
Evan Cheng
54a1a87862 Make ARM and Thumb2 32-bit immediate materialization into a single 32-bit pseudo
instruction. This makes it re-materializable.

Thumb2 will split it back out into two instructions so IT pass will generate the
right mask. Also, this expose opportunies to optimize the movw to a 16-bit move.

llvm-svn: 82982
2009-09-28 09:14:39 +00:00
Anton Korobeynikov
2e54b03741 Fix thinko in my recent movt commit: it's not safe to remat movt, since it has input reg argument.
Disable rematting of it for now.

llvm-svn: 82975
2009-09-28 07:26:46 +00:00
Anton Korobeynikov
189ce11684 Use movt/movw pair to materialize 32 bit constants on ARMv6T2+.
This should be better than single load from constpool.

llvm-svn: 82948
2009-09-27 23:52:58 +00:00
Evan Cheng
ffe6da0734 Enable pre-regalloc load / store multiple pass for Thumb2.
llvm-svn: 82893
2009-09-27 09:46:04 +00:00
Evan Cheng
48479d0c8f Really remove this option.
llvm-svn: 82838
2009-09-26 02:49:49 +00:00
Evan Cheng
1088c37212 Remove a couple of unused command line options.
llvm-svn: 82837
2009-09-26 02:45:45 +00:00
Evan Cheng
c4e3168b65 Add comment.
llvm-svn: 82836
2009-09-26 02:43:36 +00:00
Anton Korobeynikov
35078c311e Regenerate
llvm-svn: 82814
2009-09-25 22:53:17 +00:00
Evan Cheng
c0edc5ee28 Code clean up and prepare for Thumb2 support. No functionality changes.
llvm-svn: 82805
2009-09-25 21:44:53 +00:00
Dan Gohman
0ac693a89e Improve MachineMemOperand handling.
- Allocate MachineMemOperands and MachineMemOperand lists in MachineFunctions.
   This eliminates MachineInstr's std::list member and allows the data to be
   created by isel and live for the remainder of codegen, avoiding a lot of
   copying and unnecessary translation. This also shrinks MemSDNode.
 - Delete MemOperandSDNode. Introduce MachineSDNode which has dedicated
   fields for MachineMemOperands.
 - Change MemSDNode to have a MachineMemOperand member instead of its own
   fields with the same information. This introduces some redundancy, but
   it's more consistent with what MachineInstr will eventually want.
 - Ignore alignment when searching for redundant loads for CSE, but remember
   the greatest alignment.

Target-specific code which previously used MemOperandSDNodes with generic
SDNodes now use MemIntrinsicSDNodes, with opcodes in a designated range
so that the SelectionDAG framework knows that MachineMemOperand information
is available.

llvm-svn: 82794
2009-09-25 20:36:54 +00:00
Dan Gohman
0c4e55a2f8 Rename getTargetNode to getMachineNode, for consistency with the
naming scheme used in SelectionDAG, where there are multiple kinds
of "target" nodes, but "machine" nodes are nodes which represent
a MachineInstr.

llvm-svn: 82790
2009-09-25 18:54:59 +00:00
David Goodwin
89f5854ddd Finish scheduling itineraries for NEON.
llvm-svn: 82788
2009-09-25 18:38:29 +00:00
Bob Wilson
c5784025af Add some comments to clarify things that I discovered this week.
llvm-svn: 82773
2009-09-25 16:34:46 +00:00
Bob Wilson
94e29af5ac pr4926: ARM requires the stack pointer to be aligned, even for leaf functions.
For the AAPCS ABI, SP must always be 4-byte aligned, and at any "public
interface" it must be 8-byte aligned.  For the older ARM APCS ABI, the stack
alignment is just always 4 bytes.  For X86, we currently align SP at
entry to a function (e.g., to 16 bytes for Darwin), but no stack alignment
is needed at other times, such as for a leaf function.

After discussing this with Dan, I decided to go with the approach of adding
a new "TransientStackAlignment" field to TargetFrameInfo.  This value
specifies the stack alignment that must be maintained even in between calls.
It defaults to 1 except for ARM, where it is 4.  (Some other targets may
also want to set this if they have similar stack requirements. It's not
currently required for PPC because it sets targetHandlesStackFrameRounding
and handles the alignment in target-specific code.) The existing StackAlignment
value specifies the alignment upon entry to a function, which is how we've
been using it anyway.

llvm-svn: 82767
2009-09-25 14:41:49 +00:00
Jim Grosbach
3d527ff081 Start of revamping the register scavenging in PEI. ARM Thumb1 is the driving
interest for this, as it currently reserves a register rather than using
the scavenger for matierializing constants as needed.

Instead of scavenging registers on the fly while eliminating frame indices,
new virtual registers are created, and then a scavenged collectively in a
post-pass over the function. This isolates the bits that need to interact
with the scavenger, and sets the stage for more intelligent use, and reuse,
of scavenged registers.

For the time being, this is disabled by default. Once the bugs are worked out,
the current scavenging calls in replaceFrameIndices() will be removed and
the post-pass scavenging will be the default. Until then,
-enable-frame-index-scavenging enables the new code. Currently, only the
Thumb1 back end is set up to use it.

llvm-svn: 82734
2009-09-24 23:52:18 +00:00
David Goodwin
3ac3dcacc7 Make the end-of-itinerary mark explicit. Some cleanup.
llvm-svn: 82709
2009-09-24 20:22:50 +00:00
David Goodwin
1d72b88015 Checkpoint NEON scheduling itineraries.
llvm-svn: 82657
2009-09-23 21:38:08 +00:00
Anton Korobeynikov
829a3a18d2 ARM does not support offset folding (yet). Disable it for now.
This fixes PR5031. Unfortunately, there is no small testcase :(

llvm-svn: 82643
2009-09-23 19:04:09 +00:00
David Goodwin
0db84be1dc Add Cortex-A8 VFP model.
llvm-svn: 82483
2009-09-21 20:52:17 +00:00
Daniel Dunbar
db16b2c6bb Register the MachineModuleInfo for the ARM JIT, and update JITDwarfEmitter to
assert if the setModuleInfo hasn't been called.

llvm-svn: 82441
2009-09-21 05:58:35 +00:00
Evan Cheng
7714c8412d Fix PR4926. When target hook EmitInstrWithCustomInserter() insert new basic blocks and update CFG, it should also inform sdisel of the changes so the phi source operands will come from the right basic blocks.
llvm-svn: 82311
2009-09-19 09:51:03 +00:00
Bob Wilson
1b311a6a9b Fix a typo in an assertion message.
llvm-svn: 82284
2009-09-18 21:42:44 +00:00
Evan Cheng
7cb9c456e5 Enhance EmitInstrWithCustomInserter() so target can specify CFG changes that sdisel will use to properly complete phi nodes.
Not functionality change yet.

llvm-svn: 82273
2009-09-18 21:02:19 +00:00
Bob Wilson
989568d935 Expand vector floating-point conversions not supported by NEON.
llvm-svn: 82074
2009-09-16 20:20:44 +00:00
Bob Wilson
8770c809c2 Expand some more vector operations not supported by Neon.
llvm-svn: 81969
2009-09-16 00:32:15 +00:00
Bob Wilson
c01a94dad0 Neon does not support vector divide or remainder. Expand them.
llvm-svn: 81966
2009-09-16 00:17:28 +00:00
Bob Wilson
f091792f40 Expand all v2f64 arithmetic operations for Neon.
Radar 7200803.  (This should also fix the
SingleSource/UnitTests/Vector/sumarray-dbl test.)

llvm-svn: 81959
2009-09-15 23:55:57 +00:00
Bob Wilson
a42ff3190c Handle AddrMode4 for Thumb2 in rewriteT2FrameIndex. This occurs for
VLDM/VSTM instructions, and without this check, the code assumes that an
offset is allowed, as it would be with VLDR/VSTR.  The asm printer,
however, silently drops the offset, producing incorrect code.  Since the
address register in this case is either the stack or frame pointer, the
spill location ends up conflicting with some other stack slot or with
outgoing arguments on the stack.

llvm-svn: 81879
2009-09-15 17:56:18 +00:00
Sandeep Patel
7727a68464 Fix superreg use in ARMAsmPrinter. Approved by Anton Korobeynikov.
llvm-svn: 81878
2009-09-15 17:53:11 +00:00
Ted Kremenek
477a21a996 Remove invalid add_dependencies line to unbreak the CMake build.
llvm-svn: 81827
2009-09-15 04:06:36 +00:00
Kevin Enderby
da3290e68c Added the first bits of the ARM target assembler to llvm-mc. For now it only
parses the .word directive as 4 bytes and ARMAsmParser::ParseInstruction will
give an error is called.  Broke out the test of the .word directive into two
different test cases, one for x86 and one for arm.

llvm-svn: 81817
2009-09-15 00:27:25 +00:00
Jim Grosbach
5f662f31bc trivial whitespace cleanup
llvm-svn: 81773
2009-09-14 17:27:35 +00:00
Chris Lattner
334aa7a1d4 remove all but one reference to TargetRegisterDesc::AsmName.
llvm-svn: 81714
2009-09-13 20:31:40 +00:00
Chris Lattner
20b7392123 the tblgen produced 'getRegisterName' method does not access
the object, make it static instead of const.

llvm-svn: 81711
2009-09-13 20:19:22 +00:00
Chris Lattner
0cde5283e3 make tblgen produce a function that returns the name for a physreg.
Nothing is using this info yet.

llvm-svn: 81707
2009-09-13 20:08:00 +00:00
Chris Lattner
cbcbedf254 replace printBasicBlockLabel with EmitBasicBlockStart,
now that printBasicBlockLabel is only used for starting
a MBB.  This allows elimination of a bunch of arguments.

llvm-svn: 81684
2009-09-13 18:25:37 +00:00
Chris Lattner
de1324146e convert some uses of printBasicBlockLabel to use GetMBBSymbol
instead.

llvm-svn: 81677
2009-09-13 17:14:04 +00:00
Anton Korobeynikov
b5e56d0937 Fix merge problem
llvm-svn: 81658
2009-09-13 01:12:15 +00:00
Anton Korobeynikov
fa4c7562d5 Define proper subreg sets for arm - this should fix bunch of subtle problems
with subreg - superreg mapping and also fix PR4965.

llvm-svn: 81657
2009-09-13 00:59:43 +00:00
Anton Korobeynikov
267bd0c577 Add QPR_VFP2 regclass and add copy_to_regclass nodes, where needed to
constraint the register usage.

llvm-svn: 81635
2009-09-12 22:21:08 +00:00
Jim Grosbach
932453f233 Revert array initialization regclass change so that the initialization stays static, not runtime.
llvm-svn: 81560
2009-09-11 20:13:17 +00:00
Jim Grosbach
6293edbcbf Update register class references to use the global constant ARM::*RegisterClass names.
llvm-svn: 81556
2009-09-11 19:49:06 +00:00
Evan Cheng
0e0590db1b Proper support of non-lazy indirect symbols.
llvm-svn: 81422
2009-09-10 01:23:53 +00:00
Evan Cheng
7f25e554e4 Fix double load / store multiple encoding.
llvm-svn: 81403
2009-09-09 23:55:03 +00:00
Bob Wilson
877a857b4b Fix pr4939: Change FPCCToARMCC to translate SETOLE to ARMCC::LS.
See the bug report for details.

llvm-svn: 81397
2009-09-09 23:14:54 +00:00
Chris Lattner
b9aca1a178 remove DebugLoc from MCInst and eliminate "Comment printing" from
the MCInst path of the asmprinter.  Instead, pull comment printing
out of the autogenerated asmprinter into each target that uses the
autogenerated asmprinter.  This causes code duplication into each
target, but in a way that will be easier to clean up later when more
asmprinter stuff is commonized into the base AsmPrinter class.

This also fixes an xcore strangeness where it inserted two tabs
before every instruction.

llvm-svn: 81396
2009-09-09 23:14:36 +00:00
Chris Lattner
52651f7623 hoist the call to processDebugLoc out of the generated
asm printer into the "printInstruction" routine.  This
fixes a problem where the experimental asmprinter would
drop debug labels in some cases, and fixes issues on ppc/xcore
where pseudo instructions like "mr" didn't get debug locs properly.

It is annoying that this moves the call from one place into each
target, but a future set of more invasive refactorings will fix
that problem.

llvm-svn: 81377
2009-09-09 20:34:59 +00:00
Evan Cheng
91e719a6a1 Cast MO.getImm() to unsigned before comparing with an unsigned limit.
llvm-svn: 81318
2009-09-09 06:05:16 +00:00
Evan Cheng
95597cedfe Make sure to make stub region writable before emission, executable after emission.
llvm-svn: 81311
2009-09-09 01:56:29 +00:00
Evan Cheng
a0bf864b0e Fix arm jit encoding bug introduced by 75048. Some instructions', e.g. MOVi, bit 25 should be set.
llvm-svn: 81310
2009-09-09 01:47:07 +00:00
Evan Cheng
6c89bc0472 Remove comments which don't add much to .s readibility.
llvm-svn: 81306
2009-09-09 01:38:23 +00:00
Anton Korobeynikov
2b6ef7724e Unbreak getOnesVector() / getZeroVector() to use valid ARM extended imm's.
llvm-svn: 81262
2009-09-08 22:51:43 +00:00
Anton Korobeynikov
0b3a620d60 Add NEON 'laned' operations. This fixes another bunch of gcc testsuite fails and
makes the code faster.

llvm-svn: 81220
2009-09-08 15:22:32 +00:00
Duncan Sands
598fe699d0 Remove some not-really-used variables, as warned
about by icc (#593, partial).  Patch by Erick Tryzelaar.

llvm-svn: 81115
2009-09-06 12:41:19 +00:00
Duncan Sands
10c1356bad Remove some unused variables and methods warned about by
icc (#177, partial).  Patch by Erick Tryzelaar.

llvm-svn: 81106
2009-09-06 08:33:48 +00:00
Jim Grosbach
5a21028ece Whitespace cleanup
llvm-svn: 80978
2009-09-04 01:38:51 +00:00
David Goodwin
0dd9e9edb4 Calls clobber FPSCR.
llvm-svn: 80956
2009-09-03 22:12:28 +00:00
Evan Cheng
41e87f2f13 Reference to hidden symbols do not have to go through non-lazy pointer in non-pic mode. rdar://7187172.
llvm-svn: 80904
2009-09-03 07:04:02 +00:00
Anton Korobeynikov
7125d63acf More missed vdup patterns
llvm-svn: 80838
2009-09-02 21:21:28 +00:00
Sandeep Patel
9c4e094e2a Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.
llvm-svn: 80773
2009-09-02 08:44:58 +00:00
Jim Grosbach
d0f70494f5 reduce size of SmallString to something more reasonable
llvm-svn: 80710
2009-09-01 18:55:08 +00:00
Bob Wilson
6972a16bbc Add support for generating code for vst{234}lane intrinsics.
llvm-svn: 80707
2009-09-01 18:51:56 +00:00
Jim Grosbach
38fc5b0277 Use raw_ostream instead of sstream
llvm-svn: 80704
2009-09-01 18:49:12 +00:00
David Goodwin
70557af33a RRX reads CPSR.
llvm-svn: 80699
2009-09-01 18:32:09 +00:00
Bob Wilson
bebadd11e4 Generate code for vld{234}_lane intrinsics.
llvm-svn: 80656
2009-09-01 04:26:28 +00:00
Jim Grosbach
b3c318b9d8 Fix compiler warnings
llvm-svn: 80650
2009-09-01 02:05:03 +00:00
Jim Grosbach
9a220088ac Clean up LSDA name generation and use for SJLJ exception handling. This
makes an eggregious hack somewhat more palatable. Bringing the LSDA forward
and making it a GV available for reference would be even better, but is
beyond the scope of what I'm looking to solve at this point.

Objective C++ code could generate function names that broke the previous
scheme. This fixes that.

llvm-svn: 80649
2009-09-01 01:57:56 +00:00
Evan Cheng
493eee1fc7 Remove .n suffix for some 16-bit opcodes now that Darwin assembler is fixed.
llvm-svn: 80615
2009-08-31 20:14:07 +00:00
Benjamin Kramer
61232721d9 Normalize makefile comments and sort cmake file lists.
llvm-svn: 80584
2009-08-31 13:05:24 +00:00
Anton Korobeynikov
17529667db Add missed pattern
llvm-svn: 80502
2009-08-30 19:06:39 +00:00
Anton Korobeynikov
a261afbf14 EXTRACT_VECTOR_ELEMENT can have result type different from element type.
Remove the assertion and generalize the code for ARM NEON stuff.

llvm-svn: 80498
2009-08-30 17:14:54 +00:00
Anton Korobeynikov
b2e6f5eed4 Do not assert on too wide splats we don't support.
llvm-svn: 80409
2009-08-29 00:08:18 +00:00
Anton Korobeynikov
9fd6082c10 Add missed extract_element pattern
llvm-svn: 80408
2009-08-28 23:41:26 +00:00
Evan Cheng
d7a07ab112 Let Darwin linker auto-synthesize stubs and lazy-pointers. This deletes a bunch of nasty code in ARM asm printer.
llvm-svn: 80404
2009-08-28 23:18:09 +00:00
Daniel Dunbar
0fa09bbe95 Fix -Asserts warning, round two.
llvm-svn: 80354
2009-08-28 08:08:22 +00:00
Evan Cheng
d53546a6cd Print a nl before pic labels so they start at a new line. This makes assembly more readable.
llvm-svn: 80350
2009-08-28 06:59:37 +00:00
Daniel Dunbar
1b35869d3d Fix -Asserts warning.
llvm-svn: 80338
2009-08-28 05:47:56 +00:00
Evan Cheng
2d5d3700e9 v4, v5 does not support sxtb / sxth.
llvm-svn: 80322
2009-08-28 00:31:43 +00:00
Anton Korobeynikov
c1e6083cb8 Hopefully the final missing part :(
scalar_to_vector is fully legal now

llvm-svn: 80251
2009-08-27 16:25:49 +00:00
Anton Korobeynikov
3aec90b4d6 Forgot about actual change :)
llvm-svn: 80250
2009-08-27 16:10:17 +00:00
Anton Korobeynikov
33d151e85e Transform float scalar_to_vector into subreg accesses.
No idea whether this is profitable or not.

llvm-svn: 80245
2009-08-27 14:38:44 +00:00
Misha Brukman
25e2b59ec6 STRD and LDRD require ARMv5TE, not just ARMv5T.
See http://llvm.org/PR4687 for more info and links.

llvm-svn: 80244
2009-08-27 14:14:21 +00:00
Evan Cheng
984f8efcaa Fix PR4789. Teach eliminateFrameIndex how to handle VLDRQ and VSTRQ which cannot fold any immediate offset.
llvm-svn: 80191
2009-08-27 01:23:50 +00:00
Bob Wilson
5240e9de02 Remove unneeded ARM-specific DAG nodes for VLD* and VST* Neon operations.
The instructions can be selected directly from the intrinsics.  We will need
to add some ARM-specific nodes for VLD/VST of 3 and 4 128-bit vectors, but
those are not yet implemented.

llvm-svn: 80117
2009-08-26 17:39:53 +00:00
Anton Korobeynikov
1c904039ce Expand scalar_to_vector - we don't have any isel logic for it now
llvm-svn: 80107
2009-08-26 16:26:09 +00:00
Bob Wilson
02f907f33e Remove some unused SDNode definitions.
llvm-svn: 80015
2009-08-25 17:52:39 +00:00
Bob Wilson
d4fbf1f70a Expose the instruction contraint string as an argument to the NLdSt class.
llvm-svn: 80011
2009-08-25 17:46:06 +00:00
Dale Johannesen
3a5e5c7edd Make linkerprivate work for ARM and PPC. Testcase covers
all Darwin targets; could be split into separate tests for
the chip subdirectories, but from Chris' last mail on testing
I assume he'd rather have only one test.  Generic seems to be
the best available, maybe there should be a Darwin subdirectory?

llvm-svn: 79877
2009-08-24 01:03:42 +00:00