Commit Graph

33023 Commits

Author SHA1 Message Date
Jim Grosbach
780d207d1c Add missing encoding bits to NLdSt class of instructions.
Patch by Johnny Chen.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84570 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 00:19:08 +00:00
Chris Lattner
af0df67d2b X86 should ignore implicit regs when lowering to MCInst also,
no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 23:35:57 +00:00
Chris Lattner
306d14f9aa handle addmode4 modifiers, fix a fixme in printRegisterList
by ignoring all implicit regs when lowering.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84566 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 23:31:43 +00:00
Chris Lattner
84d8bf9d28 simplify by using the twine form of GetOrCreateSymbol
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84565 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 23:05:23 +00:00
Jim Grosbach
6009751244 Enable allocation of R3 in Thumb1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:57:03 +00:00
Chris Lattner
5a207897bc use EmitLabel instead of text emission
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84562 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:51:16 +00:00
Chris Lattner
7c5b021793 add a twine version of MCContext::GetOrCreateSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84561 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:49:00 +00:00
Chris Lattner
a70e644820 lower the ARM::CONSTPOOL_ENTRY pseudo op, giving us constant pool entries
like:

@ BB#1:
	.align	2
LCPI1_0:
	.long	L_.str-(LPC0+8)

Note that proper indentation of the label :)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84558 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:33:05 +00:00
Jim Grosbach
d482f55af1 Adjust the scavenge register spilling to allow the target to choose an
appropriate restore location for the spill as well as perform the actual
save and restore.

The Thumb1 target uses this to make sure R12 is not clobbered while a spilled
scavenger register is live there.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:27:30 +00:00
Chris Lattner
4d15222341 add MCInstLower support for lowering ARM::PICADD, a pseudo op for pic stuffola.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:23:04 +00:00
Owen Anderson
d41ed4e2c4 Refactor lookup_or_add to contain _MUCH_ less duplicated code. Add support for
numbering first class aggregate instructions while we're at it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84547 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:14:22 +00:00
Chris Lattner
e306d8d6cc add register list and hacked up addrmode #4 support, we now get this:
_main:
	stmsp! sp!, {r7, lr}
	mov r7, sp
	sub sp, sp, #4
	mov r0, #0
	str r0, [sp]
	ldr r0, LCPI1_0
	bl _printf
	ldr r0, [sp]
	mov sp, r7
	ldmsp! sp!, {r7, pc}

Note the unhappy ldm/stm because of modifiers being ignored.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84546 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:09:23 +00:00
Chris Lattner
3310a963cf revert r84540, fixing build breakage I didn't see because of
broken makefile deps :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84544 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:59:25 +00:00
Chris Lattner
084f87d445 add addrmode2 support, getting us up to:
_main:
	stm , 
	mov r7, sp
	sub sp, sp, #4
	mov r0, #0
	str r0, [sp]
	ldr r0, LCPI1_0
	bl _printf
	ldr r0, [sp]
	mov sp, r7
	ldm , 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84543 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:57:05 +00:00
Chris Lattner
6f99776f6c add jump tables, constant pools and some trivial global
lowering stuff.  We can now compile hello world to:

_main:
	stm , 
	mov r7, sp
	sub sp, sp, #4
	mov r0, #0
	str r0, 
	ldr r0, 
	bl _printf
	ldr r0, 
	mov sp, r7
	ldm , 

Almost looks like arm code :)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:53:00 +00:00
Victor Hernandez
93bb60d379 Malloc calls are marked NoAlias, so the code below the isMalloc() check makes it redundant. Removing the isMalloc() check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84541 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:47:22 +00:00
Chris Lattner
83e43ca1b6 pass mangler in as a reference instead of a pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84540 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:45:31 +00:00
Chris Lattner
8514e21deb reduce #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84536 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:23:15 +00:00
Chris Lattner
61d35c273e add printing support for SOImm operands, getting us to:
_main:
	stm , 
	mov r7, sp
	sub sp, sp, #4
	mov r0, #0
	str r0, 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84535 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:21:39 +00:00
Owen Anderson
158d86e5b0 Simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:14:57 +00:00
Chris Lattner
8bc86cba60 wire up some basic printOperand goodness, giving us stuff like this before
we abort:

_main:
	stm , 
	mov r7, sp
	sub sp, sp, 
	mov r0, 
	str r0, 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 20:59:55 +00:00
Chris Lattner
9cf0eb5e58 add the files that go with the previous rev
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84531 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 20:21:05 +00:00
Chris Lattner
97f0693744 wire up skeletal support for having llc print instructions
through mcinst lowering -> mcinstprinter, when llc is passed
the -enable-arm-mcinst-printer flag.  Currently this
is very "aborty".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 20:20:46 +00:00
Owen Anderson
59d5aac0b4 Banish ConstantsLock. It's serving no purpose other than slowing things down
at the moment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 20:11:52 +00:00
Chris Lattner
6a71afaec1 wire up ARM's printMCInst method. Now llvm-mc should be able to produce
"something" when printing MCInsts, it will just be missing all the 
operand info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84528 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 19:59:05 +00:00
Chris Lattner
fd60382e75 stub out a minimal ARMInstPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84527 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 19:56:26 +00:00
Chris Lattner
172862a2a7 remove strings from instructions who are never asmprinted.
All of these "subreg32" modifier instructions are handled
explicitly by the MCInst lowering phase.  If they got to
the asmprinter, they would explode.  They should eventually
be replace with correct use of subregs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84526 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 19:51:42 +00:00
Jeffrey Yasskin
ebbcef945d Clean up the JITResolver stub/callsite<->function maps.
The JITResolver maps Functions to their canonical stubs and all callsites for
lazily-compiled functions to their target Functions. To make Function
destruction work, I'm going to need to remove all callsites on destruction, so
this patch also adds the reverse mapping for that.

There was an incorrect assumption in here that the only stub for a function
would be the one caused by needing to lazily compile it, while x86-64 far calls
and dlsym-stubs could also cause such stubs, but I didn't look for a test case
that the assumption broke.

This also adds DenseMapInfo<AssertingVH> so I can use DenseMaps instead of
std::maps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 18:49:59 +00:00
Chris Lattner
b8f64a72d8 simplify code, reducing string thrashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 18:49:14 +00:00
Chris Lattner
e4d9ea83c0 switch hidden gv stubs to use MachineModuleInfoMachO instead of a custom map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 18:44:38 +00:00
Chris Lattner
b0f294c14b use MachineModuleInfoMachO for non-lazy gv stubs instead of a private map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84519 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 18:38:33 +00:00
Anton Korobeynikov
766fc1db16 Revert r84295, this unbreaks llvm-gcc bootstrap on x86-64/linux
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 18:21:09 +00:00
Chris Lattner
ee8b32981e remove dead map
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84513 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 18:11:25 +00:00
Chris Lattner
a10343f039 don't bother trying to avoid emitting redundant constant pool alignment directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84512 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 18:08:02 +00:00
Chris Lattner
fc5451e82f remove accidental comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 18:03:41 +00:00
Chris Lattner
74cd3b7ceb emit .subsections_via_symbols through MCStreamer instead of textually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84509 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 18:03:08 +00:00
Chris Lattner
4a071d667d cleanup doFinalization -> EmitEndOfAsmFile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84508 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 17:59:19 +00:00
Nate Begeman
ed748a0677 PR 5245 - The imediate size target flag was not set on 3A-prefixed SSSE3 instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84506 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 17:31:16 +00:00
Dan Gohman
841a147531 Fix SplitBlockPredecessors' LoopInfo updating code to handle the case
where a loop's header is being split and it has predecessors which are not
contained by the most-nested loop which contains the loop.
This fixes PR5235.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84505 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 16:04:50 +00:00
Dan Gohman
dfffba6a83 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 14:56:05 +00:00
Dan Gohman
4e9785ed8a Change a few instance variables to be local variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84503 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 14:52:05 +00:00
Dan Gohman
e02a698acf Change instnamer to name arguments "arg" instead of "tmp" for clarity, and
to name basic blocks "bb" instead of "BB", for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84502 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 14:47:32 +00:00
Torok Edwin
6602922878 Fix PR5247, "lock addq" pattern (and other atomics), it DOES modify EFLAGS.
LLC was scheduling compares before the adds causing wrong branches to be taken
in programs, resulting in misoptimized code wherever atomic adds where used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84485 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 11:00:58 +00:00
Chris Lattner
b2a33b4646 various cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84471 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 07:10:59 +00:00
Chris Lattner
12f031d005 simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84465 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 05:51:03 +00:00
Chris Lattner
52e2031d4a clean up after metadata changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84463 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 05:31:10 +00:00
Nate Begeman
a09008bf6d Add support for matching shuffle patterns with palignr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84459 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 02:17:23 +00:00
Evan Cheng
38bdfc69cb Spill slots cannot alias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 19:58:47 +00:00
Evan Cheng
d36076e4a3 Turn on post-alloc scheduling for x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84431 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 19:57:27 +00:00
Evan Cheng
eb6e1daa43 Oops. I forgot to change the tests first. Disable post-alloc scheduling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 18:31:31 +00:00