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

8764 Commits

Author SHA1 Message Date
Evan Cheng
c674548602 Allow some automatic tailcall optimization without changing ABI.
llvm-svn: 94611
2010-01-26 23:13:04 +00:00
Chris Lattner
ee2b6b1cc5 emit jump table an alias ".set" directives through MCStreamer as
assignments.

.set x, a-b

is the same as:

x = a-b

llvm-svn: 94596
2010-01-26 21:53:08 +00:00
Devang Patel
4563d073d3 Use AssertingVH, just to be paranoid.
llvm-svn: 94593
2010-01-26 21:39:14 +00:00
Devang Patel
84b21559f8 Emit DW_AT_containing_type attribute for a class if containing type is known.
llvm-svn: 94587
2010-01-26 21:16:06 +00:00
Chris Lattner
325a36c358 Eliminate SetDirective, and replace it with HasSetDirective.
Default HasSetDirective to true, since most targets have it.

The targets that claim to not have it probably do, or it is
spelled differently. These include Blackfin, Mips, Alpha, and
PIC16.  All of these except pic16 are normal ELF targets, so
they almost certainly have it.

llvm-svn: 94585
2010-01-26 20:40:54 +00:00
Chris Lattner
044439c9bc eliminate MCAsmInfo::NeedsSet: we now just use .set on any platform
that has it.

llvm-svn: 94581
2010-01-26 20:20:43 +00:00
Chris Lattner
967a37fb26 eliminate the TargetLowering::UsesGlobalOffsetTable bool, which is
subsumed by TargetLowering::getJumpTableEncoding().  Change uses of
it to be more specific.

llvm-svn: 94529
2010-01-26 06:53:37 +00:00
Chris Lattner
b711ded671 Now that printPICJumpTableSetLabel is not overloaded,
inline it into its only caller, allowing us to simplify it
and hoist bits out of the loop.

llvm-svn: 94528
2010-01-26 06:42:44 +00:00
Chris Lattner
d87c50833a Move getJTISymbol from MachineJumpTableInfo to MachineFunction,
which is more convenient, and change getPICJumpTableRelocBaseExpr
to take a MachineFunction to match.

Next, move the X86 code that create a PICBase symbol to
X86TargetLowering::getPICBaseSymbol from 
X86MCInstLower::GetPICBaseSymbol, which was an asmprinter specific 
library.  This eliminates a 'gross hack', and allows us to
implement X86ISelLowering::getPICJumpTableRelocBaseExpr which now
calls it.

This in turn allows us to eliminate the 
X86AsmPrinter::printPICJumpTableSetLabel method, which was the
only overload of printPICJumpTableSetLabel.

llvm-svn: 94526
2010-01-26 06:28:43 +00:00
Chris Lattner
a9b1ea03e9 add a new MachineJumpTableInfo::getJTISymbol method,
use it to implement the default TargetLowering::getPICJumpTableRelocBaseExpr

llvm-svn: 94523
2010-01-26 05:58:28 +00:00
Chris Lattner
3b2bf7ab66 stub out a new target hook, need some refactoring before I can
implement it.

llvm-svn: 94521
2010-01-26 05:30:30 +00:00
Chris Lattner
b020478ce5 simplify asmprinter: only emit .set directives when entries have
EK_LabelDifference32 kind and the target has .set support.  Simplify
X86AsmPrinter::printPICJumpTableSetLabel to make use of recent helpers.

llvm-svn: 94518
2010-01-26 05:15:20 +00:00
Chris Lattner
945bbf606f rename printPICJumpTableEntry -> EmitJumpTableEntry,
make it private and non-virtual.  It handles the non-pic
case too, so just use it, simplifying EmitJumpTableInfo.

llvm-svn: 94517
2010-01-26 05:10:10 +00:00
Chris Lattner
b4a5d00176 add a new MachineBasicBlock::getSymbol method, replacing
the AsmPrinter::GetMBBSymbol.

llvm-svn: 94515
2010-01-26 04:55:51 +00:00
Lang Hames
91856859d6 New PBQP solver.
* Fixed a reduction bug which occasionally led to infinite-cost (invalid)
  register allocation solutions despite the existence finite-cost solutions.
* Significantly reduced memory usage (>50% reduction).
* Simplified a lot of the solver code.

llvm-svn: 94514
2010-01-26 04:49:58 +00:00
Chris Lattner
d25ec1b3bd make MachineFunction keep track of its ID and make
MachineFunctionAnalysis dole them out, instead of having
AsmPrinter do both.  Have the AsmPrinter::SetupMachineFunction
method set the 'AsmPrinter::MF' variable.

llvm-svn: 94509
2010-01-26 04:35:26 +00:00
Chris Lattner
5ee5b62838 Add support for target-specific 32-bit custom-lowered
jump table entries.

llvm-svn: 94505
2010-01-26 04:05:28 +00:00
Chris Lattner
d0c077cef7 switch jump table entry emission to be based on EntryKind
instead of magic variables.

llvm-svn: 94500
2010-01-26 03:43:22 +00:00
Evan Cheng
548d00d77c Implement cond ? -1 : 0 with sbb.
llvm-svn: 94490
2010-01-26 02:00:44 +00:00
Dale Johannesen
d75f9dc3ff Generate DEBUG_VALUE comments on x86. The (limited)
dbg.declare's we currently generate go through both
register allocators without perturbing the results.

llvm-svn: 94480
2010-01-26 00:09:58 +00:00
Chris Lattner
efdc572e44 Rearrange handling of jump tables. Highlights:
1. MachineJumpTableInfo is now created lazily for a function the first time
   it actually makes a jump table instead of for every function.
2. The encoding of jump table entries is now described by the
   MachineJumpTableInfo::JTEntryKind enum.  This enum is determined by the
   TLI::getJumpTableEncoding() hook, instead of by lots of code scattered
   throughout the compiler that "knows" that jump table entries are always
   32-bits in pic mode (for example).
3. The size and alignment of jump table entries is now calculated based on
   their kind, instead of at machinefunction creation time.

Future work includes using the EntryKind in more places in the compiler,
eliminating other logic that "knows" the layout of jump tables in various
situations.

llvm-svn: 94470
2010-01-25 23:26:13 +00:00
Chris Lattner
e3f214b438 prep work to support a future where getJumpTableInfo will return
a null pointer for functions with no jump tables.  No functionality
change.

llvm-svn: 94469
2010-01-25 23:22:00 +00:00
Chris Lattner
1e05dd3446 eliminate redundant argument to EmitJumpTableInfo
llvm-svn: 94464
2010-01-25 22:41:33 +00:00
Chris Lattner
3559d9a38a mcstreamerize gprel32 emission.
llvm-svn: 94452
2010-01-25 21:28:50 +00:00
Chris Lattner
151c0e8669 mcize the non-gprel cases of AsmPrinter::printPICJumpTableEntry
llvm-svn: 94450
2010-01-25 21:22:22 +00:00
Chris Lattner
27d1a6fed5 handle the _set_ symbol with an MCSymbol.
llvm-svn: 94449
2010-01-25 21:17:10 +00:00
Chris Lattner
ac1144c110 rename MAI::PICJumpTableDirective to MAI::GPRel32Directive to
make it clear what it is, instead of how it is used.

llvm-svn: 94448
2010-01-25 21:10:10 +00:00
Chris Lattner
ee2163758e pull the non-pic jump table case out of printPICJumpTableEntry
and MCize the non-pic case.  Now printPICJumpTableEntry really
is just about printing PIC entries.

llvm-svn: 94446
2010-01-25 21:01:58 +00:00
Chris Lattner
fafb52a75a remove JumpTableDirective, it is always null.
llvm-svn: 94445
2010-01-25 20:52:54 +00:00
Chris Lattner
1cd2ba1c3a sink an arm specific method out of asmprinter into the ARMAsmPrinter and
rename it to avoid shadowing.

llvm-svn: 94440
2010-01-25 19:39:52 +00:00
Chris Lattner
20d89c382c mcstreamerize .file and .file. This also fixes an issue where the
normal form of .file would fail if the filename had a weird character
in it.

llvm-svn: 94437
2010-01-25 18:58:59 +00:00
Chris Lattner
4746185ef2 emit ELF .type directives through MCStreamer instead of doing it textually.
llvm-svn: 94436
2010-01-25 18:33:40 +00:00
Chris Lattner
30a253067e add a comment
llvm-svn: 94417
2010-01-25 07:53:05 +00:00
Chris Lattner
9834b7f300 emit the .size directive for global variables on ELF through
mcstreamer.

llvm-svn: 94416
2010-01-25 07:52:13 +00:00
Chris Lattner
5a57121631 make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
llvm-svn: 94378
2010-01-24 20:43:08 +00:00
Chris Lattner
0dde21dba4 fix some issues where we weren't emitting enough newlines.
llvm-svn: 94370
2010-01-24 19:01:06 +00:00
Chris Lattner
c0ac5c1d3b when emitting DIEs, emit the comment on the same line as the directive.
This fixes FrontendObjC/2009-11-30-Objc-ID.m

llvm-svn: 94369
2010-01-24 18:54:17 +00:00
Mon P Wang
d4d1cbb72b It seems better to scalarize vectors of size 1 instead of widening them.
Add support to widen SETCC.

llvm-svn: 94342
2010-01-24 00:24:43 +00:00
Mon P Wang
871ea08e40 Improved widening loads by adding support for wider loads if
the alignment allows.  Fixed a bug where we didn't use a
vector load/store for PR5626.

llvm-svn: 94338
2010-01-24 00:05:03 +00:00
Bill Wendling
7449bb010b Remove the '-disable-scheduling' flag and replace it with the 'source' option of
the '-pre-RA-sched' flag. It actually makes more sense to do it this way. Also,
keep track of the SDNode ordering by default. Eventually, we would like to make
this ordering a way to break a "tie" in the scheduler. However, doing that now
breaks the "CodeGen/X86/abi-isel.ll" test for 32-bit Linux.

llvm-svn: 94308
2010-01-23 10:26:57 +00:00
Chris Lattner
617e6fb889 mcize lcomm, simplify .comm, extend both to support 64-bit sizes.
llvm-svn: 94299
2010-01-23 07:47:02 +00:00
Chris Lattner
7e1fa376cc resolve a fixme: the "nonexecutable stack directive" is actually
a .section.  Switch to it with SwitchSection.

However, I think that this directive should be safe on any ELF target.
If so, we should hoist it up out of the X86 and SystemZ targets.

llvm-svn: 94298
2010-01-23 07:21:06 +00:00
Chris Lattner
7fe6265555 remove a dead call.
llvm-svn: 94297
2010-01-23 07:17:54 +00:00
Chris Lattner
56c318f344 mcize visibility directives.
llvm-svn: 94295
2010-01-23 06:53:23 +00:00
Chris Lattner
60edc92e39 move the various directive enums out of the MCStreamer class
into a new MCDirectives.h file.

llvm-svn: 94294
2010-01-23 06:39:22 +00:00
Chris Lattner
1b7c00a4f2 Change constantexpr global variable initializers to convert the constants
to MCExpr then emit them through MCStreamer with EmitValue.  I think all
global variable initializers are now going through mcstreamer.

llvm-svn: 94293
2010-01-23 06:17:14 +00:00
Chris Lattner
62d08f5577 mcstreamerize .no_dead_strip and .reference for static ctors/dtors.
llvm-svn: 94290
2010-01-23 05:51:36 +00:00
Chris Lattner
2ee0376c42 mcize jump table and constant pool entry labels, .local on elf,
and some .weak directives.

llvm-svn: 94284
2010-01-23 05:19:23 +00:00
Chris Lattner
20a336f1df emit .ascii and .asciz through MCStreamer.
llvm-svn: 94282
2010-01-23 04:54:10 +00:00
Chris Lattner
e6801b7c24 remove one form of EmitString, just use EmitBytes instead. We must
be careful to add a \0 at the end though, because EmitString didn't
do this.

llvm-svn: 94277
2010-01-23 03:11:46 +00:00