Commit Graph

13310 Commits

Author SHA1 Message Date
Anton Korobeynikov
9afb7c5fb3 zext / truncate is free on msp430. Inform codegen about this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93556 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 21:19:43 +00:00
Anton Korobeynikov
702adaba6d Add branch relaxation pass (shamelessly stolen from PPC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93554 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 21:19:05 +00:00
Anton Korobeynikov
05011a8aba Provide instruction sizes & encoding. No opcodes yet (but not needed so far).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 21:18:39 +00:00
Anton Korobeynikov
cb50e0bd60 Enable bit tests and setcc stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93552 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 21:18:18 +00:00
Anton Korobeynikov
0c1ba91a54 Add micro-optimization which allows us to fold imm into cmp. This allows us to save 1 word (sometimes) and reduce register pressure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93551 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 21:18:02 +00:00
Anton Korobeynikov
3af4a0b4cb Add instruction formats & support stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 21:17:13 +00:00
Chris Lattner
54482b472a fix a bug in range information for $42, eliminate an
unneeded argument from ParseExpression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93536 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:39:23 +00:00
Chris Lattner
0a3c5a54a1 add range information for mem X86Operand's, now all
X86Operand's have range info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:33:43 +00:00
Chris Lattner
b4307b3370 extend MCAsmParser::ParseExpression and ParseParenExpression
to return range information for subexpressions.  Use this to
provide range info for several new X86Operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93534 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:28:38 +00:00
Chris Lattner
1f19f0f31d give X86Operand a ctor and start passing SMLoc's into it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93532 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:06:59 +00:00
Dale Johannesen
3752d2fe34 Revert 93499. After discussion with Chris we agreed
FrameIndexes should be lowered, but the same way as
everything else (target dependent) rather than in a
special hacked way.  The lowering needs to be done
for eventual purposes of Dwarf generation.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93530 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 18:58:14 +00:00
Chris Lattner
29ef9a21dd add range location info for registers, change
X86Operand::Create* implementations to avoid
copy ctor use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93528 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 18:51:29 +00:00
Chris Lattner
309264d1e4 clean up the memory management of the operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93526 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 18:44:13 +00:00
Chris Lattner
23075746a1 refactor ParseRegister to avoid using X86Operand as a temporary
datastructure when parsing a mem operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93521 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 18:27:19 +00:00
Dale Johannesen
bc971c1575 Lower FrameIndex operand of DEBUG_VALUE (specially) and
print it as a comment on X86.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93499 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 01:54:55 +00:00
Anton Korobeynikov
f7ed979257 Fix cmp emission on msp430: we definitely should turn stuff like
"icmp lhs, rhs" into "cmp rhs, lhs". This should fix PR5979.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93496 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 01:29:49 +00:00
Jim Grosbach
867bbbfff7 Name change for consistency. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 00:22:18 +00:00
Jim Grosbach
5efaed3bf4 EmitAtomicCmpSwap() custome inserter needs to delete the MI passed in. EmitAtomicBinary() already does this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93479 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 00:18:34 +00:00
Jeffrey Yasskin
13c10c4e49 Teach PPC how to replaceMachineCodeForFunction correctly. (Fixes
JITTest.FunctionIsRecompiledAndRelinked.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93475 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 23:15:26 +00:00
Johnny Chen
51bc5612b3 Added 16-bit Thumb Load/Store immediate instructions with encoding bits so that
the disassembler can properly decode Load/Store register/immediate instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93471 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 22:42:17 +00:00
Chris Lattner
9898671a74 Split the TargetAsmParser "ParseInstruction" interface in half:
the new ParseInstruction method just parses and returns a list of
target operands.  A new MatchInstruction interface is used to
turn the operand list into an MCInst.

This requires new/deleting all the operands, but it also gives 
targets the ability to use polymorphic operands if they want to. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 22:21:20 +00:00
Anton Korobeynikov
5fcf52ccf3 Remove pseudo-MI in custom inserter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93467 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 22:09:11 +00:00
Chris Lattner
f007e853e2 prune #includes in TargetAsmParser.h
Pass in SMLoc of instr opcode into ParseInstruction.
Make AsmToken be a class, not a struct.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 21:32:45 +00:00
Chris Lattner
7659389d0d introduce MCParsedAsmOperand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93455 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 21:21:40 +00:00
Chris Lattner
45220a8439 introduce the MCParsedAsmOperand class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 21:20:55 +00:00
Jakob Stoklund Olesen
09bf003983 ARM "l" constraint for inline asm means R0-R7, also for Thumb2.
This is consistent with llvm-gcc's arm/constraints.md.

Certain instructions (e.g. CBZ, CBNZ) require a low register, even in Thumb2
mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 18:19:56 +00:00
Jakob Stoklund Olesen
069e100f9a Don't fold insufficiently aligned ldr/str into ldm/stm instructions.
An unaligned ldr causes a trap, and is then emulated by the kernel with
awesome performance. The darwin kernel does not emulate unaligned ldm/stm
Thumb2 instructions, so don't generate them.

This fixes the miscompilation of Multisource/Applications/JM/lencod for Thumb2.

Generating unaligned ldr/str pairs from a 16-bit aligned memcpy is probably
also a bad idea, but that is beyond the scope of this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93393 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 00:54:10 +00:00
Chris Lattner
5350f78323 this is an SSE-specific issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93373 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 23:29:11 +00:00
Chris Lattner
689339c50f X86 if conversion + tail merging issues from PR6032.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93372 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 23:28:40 +00:00
Chris Lattner
8da8d4b12a fix ELF section mangling stuff for weak symbols to not use
obsolete Mangler interfaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93356 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 21:29:21 +00:00
Chris Lattner
a46a34431c reduce duplicate mangling logic by using MCSymbol::printMangledName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93351 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 21:12:34 +00:00
Johnny Chen
12360917ef Fixed a couple of places for Thumb MOV where encoding bits are underspecified.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 21:00:26 +00:00
Jakob Stoklund Olesen
15913c999e Fix pasto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93342 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 19:54:39 +00:00
Chris Lattner
471f1e9dc0 stop the CBE from using deprecated Mangler stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93341 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 19:54:07 +00:00
Chris Lattner
cab16cc9a3 Use the GV version of getNameWithPrefix in TargetLoweringObjectFileCOFF::
SelectSectionForGlobal, unbreaking weak globals with no-name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 19:19:17 +00:00
Chris Lattner
656bb20d61 just finish MCizing FnStubInfo which cleans it up and simplifies it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 19:13:16 +00:00
Chris Lattner
59b34fe55f don't call getNameWithPrefix repeatedly and unnecesarily.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93333 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 19:05:36 +00:00
Chris Lattner
0b4bad54f6 properly use MCSymbol to print the strings aquired from getNameWithPrefix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93332 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 19:00:57 +00:00
Chris Lattner
09533a404c upgrade and MC'ize a few uses of makeNameProper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 08:08:33 +00:00
Chris Lattner
13b1e92e6c MC'ize this a bit and upgrade APIs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93309 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 08:04:24 +00:00
Chris Lattner
4d5f06fbe5 add a fixme, ELF MCSection isn't quite right and weak unnamed globals are broken
on linux (even though they are pointless, they shouldn't ICE).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93308 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 08:02:14 +00:00
Evan Cheng
57d1d936fc For now, avoid issuing extract_subreg to reuse lower 8-bit, it's not safe in 32-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93307 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 08:01:32 +00:00
Chris Lattner
ee9250bb4f eliminate some uses of Mangler::makeNameProper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93305 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 07:56:59 +00:00
Chris Lattner
4813035b72 change Mangler::makeNameProper to return its result in a SmallVector
instead of returning it in an std::string.  Based on this change:

1. Change TargetLoweringObjectFileCOFF::getCOFFSection to take a StringRef
2. Change a bunch of targets to call makeNameProper with a smallstring,
   making several of them *much* more efficient.
3. Rewrite Mangler::makeNameProper to not build names and then prepend
   prefixes, not use temporary std::strings, and to avoid other crimes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 06:38:18 +00:00
Jakob Stoklund Olesen
c5b7ef1519 Remove the JustSP single-register regclass.
It was only being used by instructions with the t_addrmode_sp addressing mode,
and that is pattern matched in a way that guarantees SP is used. There is
never any register allocation done from this class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93280 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:43:06 +00:00
Evan Cheng
7da9ecf967 Add a quick pass to optimize sign / zero extension instructions. For targets where the pre-extension values are available in the subreg of the result of the extension, replace the uses of the pre-extension value with the result + extract_subreg.
For now, this pass is fairly conservative. It only perform the replacement when both the pre- and post- extension values are used in the block. It will miss cases where the post-extension values are live, but not used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93278 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:30:23 +00:00
Evan Cheng
3bda20112e Eliminate or_not_add and just use AddedComplexity so isel tries or_is_add patterns first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93245 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 18:31:19 +00:00
Duncan Sands
796248fdb1 Revert commit 93204, since it causes the assembler to barf
on x86-64 linux with messages like this:
Error: Incorrect register `%r14' used with `l' suffix


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93242 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 17:46:16 +00:00
Duncan Sands
990c4b87e3 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93235 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 08:30:46 +00:00
Duncan Sands
e2de606e0b Tweak commit 91745, which changed target data for both Mingw and Cygwin,
to not touch Cygwin: the change caused llvm-gcc build failures due to
long double getting the wrong size.  Patch by Aaron Gray.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93234 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 08:21:07 +00:00