1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

12797 Commits

Author SHA1 Message Date
Eli Friedman
0aade63ca6 Add some potentially interesting transformations to README.
llvm-svn: 93797
2010-01-18 22:36:59 +00:00
Bill Wendling
58d26c105b - Add getLSDAEncoding to the PowerPC backend.
- Greatly improve the comments to the getLSDAEncoding method.

llvm-svn: 93796
2010-01-18 22:36:35 +00:00
Eric Christopher
f599e07003 Have FastISel handle llvm.trap().
llvm-svn: 93781
2010-01-18 22:11:29 +00:00
Jim Grosbach
27e064420b Minor cleanup for jump table printing. Need a reference, not a pointer, for
printing via <<. Otherwise we just print the pointer value.

llvm-svn: 93777
2010-01-18 22:01:39 +00:00
Johnny Chen
a5f79a6b93 The most significant encoding bit of GPR:$src or GPR:$dst was over-specified in
the various MOV (register) instructions (16-bit Thumb), including tBRIND (the
indirect branch).  Instead of '1', it should be specified as '?', because GPR
only specifies the register class, which includes both hi-and-lo registers.

llvm-svn: 93759
2010-01-18 20:15:56 +00:00
Jim Grosbach
70af2216fd Patch by David Conrad:
"On ARMv6T2 this turns cttz into rbit, clz instead of the 4 instruction
 sequence it is now."

llvm-svn: 93758
2010-01-18 19:58:49 +00:00
Bill Wendling
db47c10171 Add FIXME comment.
llvm-svn: 93755
2010-01-18 19:47:53 +00:00
Bill Wendling
5678a9711b - Add a comment to the callback indicating that it's *extremely* not a good
idea, but unfortunately necessary.
- Default to using 4-bytes for the LSDA pointer encoding to agree with the
  encoded value in the CIE.

llvm-svn: 93753
2010-01-18 19:36:27 +00:00
Bob Wilson
ac3735b7fb Emit spaces after commas in Neon register lists. This is more consistent
with the rest of the assembly output, is easier to read, and matches the
expected output for gcc's Neon tests.

llvm-svn: 93703
2010-01-18 01:24:43 +00:00
Chris Lattner
40f9b01ab5 switch x86 zerofill emission over to use MCStreamer.
llvm-svn: 93702
2010-01-18 01:21:08 +00:00
Chris Lattner
d7bd67fa61 Change CurrentFnSym to be a non-const pointer since asmprinter mutates it
as it emits code.  Switch .globl directives to use OutStreamer instead of
doing it textually (in x86)

llvm-svn: 93700
2010-01-18 00:59:24 +00:00
Chris Lattner
86287085ba remove the MAI argument to MCExpr::print and switch overthing to use << when printing them.
llvm-svn: 93699
2010-01-18 00:37:40 +00:00
Chris Lattner
a1bd99bd92 unbreak x86 jump tables with my previous patch.
llvm-svn: 93698
2010-01-18 00:21:06 +00:00
Chris Lattner
6f360c3c91 now that MCSymbol::print doesn't use it's MAI argument, we can
remove it and change all the code that prints MCSymbols to use 
<< instead, which is much simpler and cleaner.

llvm-svn: 93695
2010-01-17 21:43:43 +00:00
Chris Lattner
c2047ba3e4 stop the CBE from using Mangler::appendMangledName, which is a private function, it is mangling types, which don't matter how they are done.
llvm-svn: 93692
2010-01-17 19:32:29 +00:00
Chris Lattner
f7c6508544 Get MCSymbol out of the mangling business, and move all the logic
to Mangler.  Now MCSymbol just decides whether to slap quotes around
a symbol when printing it.

This also fixes some weirdness where two MCSymbols could be created
for the same symbol, if one needed to be mangled and got mangled to
the other one.

llvm-svn: 93690
2010-01-17 19:23:46 +00:00
Chris Lattner
ffa28b64e5 factor this code better how that the string version of getNameWithPrefix
takes a twine.

llvm-svn: 93687
2010-01-17 18:52:16 +00:00
Chris Lattner
57ac0be2b5 now that mangler is in libtarget, it can use MCAsmInfo instead of clients
having to pass various fields from it in.  Simplify.

llvm-svn: 93686
2010-01-17 18:22:35 +00:00
Bob Wilson
72cf548263 The Neon "vtst" instruction takes a suffix that is the element size alone --
adding an "i" to the suffix, indicating that the elements are integers, is
accepted but not part of the standard syntax.  This helps us pass a few more
of the Neon tests from gcc.

llvm-svn: 93677
2010-01-17 06:35:17 +00:00
Bob Wilson
b4c16ab0b3 Fix an off-by-one error that caused the chain operand to be dropped from Neon
vector load-lane and store-lane instructions.

llvm-svn: 93673
2010-01-17 05:58:23 +00:00
Benjamin Kramer
58787e4d0b Update CMake files for Mangler move.
llvm-svn: 93665
2010-01-16 22:23:09 +00:00
Chris Lattner
51e8abe640 move the mangler into libtarget from vmcore.
llvm-svn: 93664
2010-01-16 21:57:06 +00:00
Chris Lattner
31aea3db21 rename GetPrivateGlobalValueSymbolStub -> GetSymbolWithGlobalValueBase,
and add an explicit ForcePrivate argument.

Switch FunctionEHFrameInfo to be MCSymbol based instead of string based.

llvm-svn: 93646
2010-01-16 18:37:32 +00:00
Devang Patel
3bbca51dcd Replace DebugLocTuple with DILocation.
llvm-svn: 93630
2010-01-16 06:09:35 +00:00
Chris Lattner
e4a8737985 fix build failure.
llvm-svn: 93628
2010-01-16 03:38:27 +00:00
Chris Lattner
a00f220023 remove a couple of actively incorrect uses of getMangledName.
llvm-svn: 93627
2010-01-16 02:16:09 +00:00
Chris Lattner
33ba751c32 this doesn't need the mangler.
llvm-svn: 93626
2010-01-16 02:15:38 +00:00
Chris Lattner
8955452658 more string -> sym, getMangledName is now gone from this file.
llvm-svn: 93624
2010-01-16 02:09:06 +00:00
Chris Lattner
1ca411ee68 use symbols instead of strings, eliminating a bunch of getMangledName
calls.  Add FIXMEs about a bunch of nondeterminism in stub output.

llvm-svn: 93621
2010-01-16 02:00:23 +00:00
Chris Lattner
f227cb9fe7 simplify some code.
llvm-svn: 93619
2010-01-16 01:45:47 +00:00
Bill Wendling
d78fcdd332 Retrying r91337:
The CIE says that the LSDA point in the FDE section is an "sdata4". That's fine,
but we need it to actually be 4-bytes in the FDE for some platforms. Allow
individual platforms to decide for themselves.

llvm-svn: 93616
2010-01-16 01:40:55 +00:00
Chris Lattner
ea72cfbd42 eliminate uses of mangler and simplify code.
llvm-svn: 93615
2010-01-16 01:40:07 +00:00
Chris Lattner
bda0bbf7f9 get pic16 off CurrentFnName
llvm-svn: 93610
2010-01-16 01:21:04 +00:00
Chris Lattner
bb21a20f24 remove the string form of printVisibility.
llvm-svn: 93609
2010-01-16 01:17:26 +00:00
Chris Lattner
ef45b87192 switch more stuff onto MCSymbols
llvm-svn: 93608
2010-01-16 01:12:01 +00:00
Chris Lattner
ff1a508835 eliminate uses of deprecated mangler apis
llvm-svn: 93605
2010-01-16 01:00:27 +00:00
Chris Lattner
cbe9fe90bd switch X86 target off CurFunctionName and MCIze more.
Note that the code wasn't calling DecorateCygMingName
when emitting the ".ascii -export" stuff at the end of
file for DLLExported functions.  I don't know if it should
or not, but I'm preserving behavior.

llvm-svn: 93603
2010-01-16 00:51:39 +00:00
Chris Lattner
0bb1df70ef MCize tis, and make it keep CurrentFnSym up to date with CurrentFnName.
llvm-svn: 93598
2010-01-16 00:32:38 +00:00
Chris Lattner
e76d575ca2 revert the x86 part of my last patch, cygwin is mutating CurrentFnName!
llvm-svn: 93595
2010-01-16 00:24:20 +00:00
Chris Lattner
40eb58664f MCize a bunch more stuff, eliminating a lot of uses of the mangler
and CurrentFnName.

llvm-svn: 93594
2010-01-16 00:21:18 +00:00
Chris Lattner
9103a49143 remove two write-only sets.
llvm-svn: 93590
2010-01-15 23:56:03 +00:00
Chris Lattner
b1b91d11db supplement CurrentFnName with CurrentFnSym, which will eventually
replace it.  Upgrade Alpha, Blackfin, and part of CellSPU to not
use mangler anymore.  CellSPU needs more invasive surgery.

llvm-svn: 93589
2010-01-15 23:55:16 +00:00
Chris Lattner
5f4c482b72 add a version of AsmPrinter::printVisibility that takes an MCSymbol.
llvm-svn: 93587
2010-01-15 23:38:51 +00:00
Chris Lattner
8511f8cc1e use MCSymbol instead of getMangledName() in all cases except one.
llvm-svn: 93582
2010-01-15 23:31:55 +00:00
Dale Johannesen
9f30926cb7 Adjust some comments per review.
llvm-svn: 93580
2010-01-15 23:29:29 +00:00
Chris Lattner
000ca8fe0c mc'ize a bunch of symbol stuff, eliminating std::strings.
llvm-svn: 93578
2010-01-15 23:26:49 +00:00
David Greene
e52529d7cb Fix PR6019. A load has more than one use if it feeds a bitconvert that
has more than one use.

llvm-svn: 93576
2010-01-15 23:23:41 +00:00
Chris Lattner
ea4d444561 add a AsmPrinter::GetGlobalValueSymbol and GetExternalSymbolSymbol
helper method, use it to simplify some code.

llvm-svn: 93575
2010-01-15 23:18:17 +00:00
Ted Kremenek
89fb514857 Update CMake build.
llvm-svn: 93570
2010-01-15 22:59:11 +00:00
Dale Johannesen
7a3b1c5ffc DEBUG_VALUE is now variable sized, as it has a
target-dependent memory address representation in it.
Restore X86 printing of DEBUG_VALUE; lowering is
done in X86RegisterInfo using the normal algorithm.

llvm-svn: 93565
2010-01-15 22:22:35 +00:00
Jim Grosbach
5a66487dfd Update Thumb1 storeRegToStackSlot() and loadRegFromStackSlot() to properly
handle physical registers R0-R7 when described as having a non-tGPR register
class.

llvm-svn: 93564
2010-01-15 22:21:03 +00:00
Dan Gohman
7b9900094e Fix a typo that Anton noticed.
llvm-svn: 93563
2010-01-15 22:18:15 +00:00
Eric Christopher
3c5d9dc0e3 Remove the InlineHint attribute. There are no current or planned
users.

llvm-svn: 93558
2010-01-15 21:36:30 +00:00
Anton Korobeynikov
8d5197ab8a zext / truncate is free on msp430. Inform codegen about this.
llvm-svn: 93556
2010-01-15 21:19:43 +00:00
Anton Korobeynikov
f1080f2bbe Add branch relaxation pass (shamelessly stolen from PPC).
llvm-svn: 93554
2010-01-15 21:19:05 +00:00
Anton Korobeynikov
75c93b4ec3 Provide instruction sizes & encoding. No opcodes yet (but not needed so far).
llvm-svn: 93553
2010-01-15 21:18:39 +00:00
Anton Korobeynikov
719dd1465f Enable bit tests and setcc stuff.
llvm-svn: 93552
2010-01-15 21:18:18 +00:00
Anton Korobeynikov
aaed919671 Add micro-optimization which allows us to fold imm into cmp. This allows us to save 1 word (sometimes) and reduce register pressure.
llvm-svn: 93551
2010-01-15 21:18:02 +00:00
Anton Korobeynikov
0ca5fcdfaa Add instruction formats & support stuff
llvm-svn: 93550
2010-01-15 21:17:13 +00:00
Chris Lattner
d6b351119b fix a bug in range information for $42, eliminate an
unneeded argument from ParseExpression.

llvm-svn: 93536
2010-01-15 19:39:23 +00:00
Chris Lattner
e18762283a add range information for mem X86Operand's, now all
X86Operand's have range info.

llvm-svn: 93535
2010-01-15 19:33:43 +00:00
Chris Lattner
836cf5d129 extend MCAsmParser::ParseExpression and ParseParenExpression
to return range information for subexpressions.  Use this to
provide range info for several new X86Operands.

llvm-svn: 93534
2010-01-15 19:28:38 +00:00
Chris Lattner
fba7cf4b44 give X86Operand a ctor and start passing SMLoc's into it.
llvm-svn: 93532
2010-01-15 19:06:59 +00:00
Dale Johannesen
e3562c3fa2 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.

llvm-svn: 93530
2010-01-15 18:58:14 +00:00
Chris Lattner
618f75b46e add range location info for registers, change
X86Operand::Create* implementations to avoid
copy ctor use.

llvm-svn: 93528
2010-01-15 18:51:29 +00:00
Chris Lattner
5d30d26a5d clean up the memory management of the operands.
llvm-svn: 93526
2010-01-15 18:44:13 +00:00
Chris Lattner
b032dc1768 refactor ParseRegister to avoid using X86Operand as a temporary
datastructure when parsing a mem operand.

llvm-svn: 93521
2010-01-15 18:27:19 +00:00
Dale Johannesen
12ae1f52c2 Lower FrameIndex operand of DEBUG_VALUE (specially) and
print it as a comment on X86.

llvm-svn: 93499
2010-01-15 01:54:55 +00:00
Anton Korobeynikov
fb1954f28d Fix cmp emission on msp430: we definitely should turn stuff like
"icmp lhs, rhs" into "cmp rhs, lhs". This should fix PR5979.

llvm-svn: 93496
2010-01-15 01:29:49 +00:00
Jim Grosbach
36c7973e76 Name change for consistency. No functional change.
llvm-svn: 93480
2010-01-15 00:22:18 +00:00
Jim Grosbach
ca3006c171 EmitAtomicCmpSwap() custome inserter needs to delete the MI passed in. EmitAtomicBinary() already does this.
llvm-svn: 93479
2010-01-15 00:18:34 +00:00
Jeffrey Yasskin
7a710b57f5 Teach PPC how to replaceMachineCodeForFunction correctly. (Fixes
JITTest.FunctionIsRecompiledAndRelinked.)

llvm-svn: 93475
2010-01-14 23:15:26 +00:00
Johnny Chen
a5f2e84b0c Added 16-bit Thumb Load/Store immediate instructions with encoding bits so that
the disassembler can properly decode Load/Store register/immediate instructions.

llvm-svn: 93471
2010-01-14 22:42:17 +00:00
Chris Lattner
882cb240a6 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. 

llvm-svn: 93469
2010-01-14 22:21:20 +00:00
Anton Korobeynikov
5eb86c0b47 Remove pseudo-MI in custom inserter.
llvm-svn: 93467
2010-01-14 22:09:11 +00:00
Chris Lattner
ceabb11a5e prune #includes in TargetAsmParser.h
Pass in SMLoc of instr opcode into ParseInstruction.
Make AsmToken be a class, not a struct.

llvm-svn: 93457
2010-01-14 21:32:45 +00:00
Chris Lattner
c0321eb1aa introduce MCParsedAsmOperand
llvm-svn: 93455
2010-01-14 21:21:40 +00:00
Chris Lattner
001a94a0e3 introduce the MCParsedAsmOperand class.
llvm-svn: 93454
2010-01-14 21:20:55 +00:00
Jakob Stoklund Olesen
97a8d154fb 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.

llvm-svn: 93436
2010-01-14 18:19:56 +00:00
Jakob Stoklund Olesen
5fdcc970a2 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.

llvm-svn: 93393
2010-01-14 00:54:10 +00:00
Chris Lattner
72a06499b3 this is an SSE-specific issue.
llvm-svn: 93373
2010-01-13 23:29:11 +00:00
Chris Lattner
0aa093dbdf X86 if conversion + tail merging issues from PR6032.
llvm-svn: 93372
2010-01-13 23:28:40 +00:00
Chris Lattner
4ce6464609 fix ELF section mangling stuff for weak symbols to not use
obsolete Mangler interfaces.

llvm-svn: 93356
2010-01-13 21:29:21 +00:00
Chris Lattner
4dcb71cc65 reduce duplicate mangling logic by using MCSymbol::printMangledName.
llvm-svn: 93351
2010-01-13 21:12:34 +00:00
Johnny Chen
08c211683b Fixed a couple of places for Thumb MOV where encoding bits are underspecified.
llvm-svn: 93349
2010-01-13 21:00:26 +00:00
Jakob Stoklund Olesen
27e36e52f5 Fix pasto
llvm-svn: 93342
2010-01-13 19:54:39 +00:00
Chris Lattner
6d1ddfeff2 stop the CBE from using deprecated Mangler stuff.
llvm-svn: 93341
2010-01-13 19:54:07 +00:00
Chris Lattner
b255aee77a Use the GV version of getNameWithPrefix in TargetLoweringObjectFileCOFF::
SelectSectionForGlobal, unbreaking weak globals with no-name.

llvm-svn: 93336
2010-01-13 19:19:17 +00:00
Chris Lattner
10021a1e25 just finish MCizing FnStubInfo which cleans it up and simplifies it.
llvm-svn: 93334
2010-01-13 19:13:16 +00:00
Chris Lattner
5c38b08b40 don't call getNameWithPrefix repeatedly and unnecesarily.
llvm-svn: 93333
2010-01-13 19:05:36 +00:00
Chris Lattner
6b0af1d420 properly use MCSymbol to print the strings aquired from getNameWithPrefix.
llvm-svn: 93332
2010-01-13 19:00:57 +00:00
Chris Lattner
d63a5fea41 upgrade and MC'ize a few uses of makeNameProper.
llvm-svn: 93310
2010-01-13 08:08:33 +00:00
Chris Lattner
34047fe59f MC'ize this a bit and upgrade APIs
llvm-svn: 93309
2010-01-13 08:04:24 +00:00
Chris Lattner
29a0ff2e70 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).

llvm-svn: 93308
2010-01-13 08:02:14 +00:00
Evan Cheng
98af245e5f For now, avoid issuing extract_subreg to reuse lower 8-bit, it's not safe in 32-bit.
llvm-svn: 93307
2010-01-13 08:01:32 +00:00
Chris Lattner
f2090cf7fd eliminate some uses of Mangler::makeNameProper.
llvm-svn: 93305
2010-01-13 07:56:59 +00:00
Chris Lattner
3c2fad1fc6 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.

llvm-svn: 93298
2010-01-13 06:38:18 +00:00
Jakob Stoklund Olesen
2d819b93a2 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.

llvm-svn: 93280
2010-01-13 00:43:06 +00:00
Evan Cheng
76db3bb18e 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.

llvm-svn: 93278
2010-01-13 00:30:23 +00:00
Evan Cheng
bc0b06fb16 Eliminate or_not_add and just use AddedComplexity so isel tries or_is_add patterns first.
llvm-svn: 93245
2010-01-12 18:31:19 +00:00