Commit Graph

2653 Commits

Author SHA1 Message Date
Daniel Dunbar fed917e078 TargetRegistry: Fix create{AsmInfo,MCDisassembler} to return non-const objects.
llvm-svn: 99097
2010-03-20 22:36:22 +00:00
Chris Lattner 0433699ef0 set SDNPVariadic on nodes throughout the rest of the targets that
need them.

llvm-svn: 98937
2010-03-19 05:33:51 +00:00
Bill Wendling bbcaa40227 Now that the default for Darwin platforms is to place the LSDA into the TEXT
section, remove the target-specific code that performs this.

llvm-svn: 98580
2010-03-15 21:09:38 +00:00
Chris Lattner 9fa851b9d4 tidy indentation
llvm-svn: 98523
2010-03-14 22:44:11 +00:00
Chris Lattner 6e52e9db31 get MMI out of the label uniquing business, just go to MCContext
to get unique assembler temporary labels.

llvm-svn: 98489
2010-03-14 08:36:50 +00:00
Chris Lattner d5e8d9f29a Now that DBG_LABEL is updated, we can finally make MachineMove
contain an MCSymbol instead of a label index.

llvm-svn: 98482
2010-03-14 08:12:40 +00:00
Chris Lattner c26f44fb07 change the DBG_LABEL MachineInstr to always be created
with an MCSymbol instead of an immediate.

llvm-svn: 98481
2010-03-14 07:56:48 +00:00
Chris Lattner ee2fbbc978 change the LabelSDNode to be EHLabelSDNode and make it hold
an MCSymbol.  Make the EH_LABEL MachineInstr hold its label
with an MCSymbol instead of ID.  Fix a bug in MMI.cpp which
would return labels named "Label4" instead of "label4".

llvm-svn: 98463
2010-03-14 02:33:54 +00:00
Chris Lattner 34adc8d225 change EH related stuff (other than EH_LABEL) to use MCSymbol
instead of label ID's.  This cleans up and regularizes a bunch 
of code and makes way for future progress.

Unfortunately, this pointed out to me that JITDwarfEmitter.cpp
is largely copy and paste from DwarfException/MachineModuleInfo
and other places.  This is very sad and disturbing. :(

One major change here is that TidyLandingPads moved from being
called in DwarfException::BeginFunction to being called in
DwarfException::EndFunction.  There should not be any 
functionality change from doing this, but I'm not an EH expert.

llvm-svn: 98459
2010-03-14 01:41:15 +00:00
Chris Lattner 29bdac4928 eliminate the now-unneeded context argument of MBB::getSymbol()
llvm-svn: 98451
2010-03-13 21:04:28 +00:00
Chris Lattner e468f88b26 rearrange MCContext ownership. Before LLVMTargetMachine created it
and passing off ownership to AsmPrinter.  Now MachineModuleInfo
creates it and owns it by value.  This allows us to use MCSymbols
more consistently throughout the rest of the code generator, and
simplifies a bit of code.  This also allows MachineFunction to 
keep an MCContext reference handy, and cleans up the TargetRegistry
interfaces for AsmPrinters.

llvm-svn: 98450
2010-03-13 20:55:24 +00:00
Jeffrey Yasskin 9eeda13a52 Fix LLVM build when the user specifies CPPFLAGS on the make command line.
llvm-svn: 98394
2010-03-12 21:42:14 +00:00
Chris Lattner 0b822ab447 inline GetGlobalValueSymbol into the rest its callers and
remove it.

llvm-svn: 98390
2010-03-12 21:19:23 +00:00
Bill Wendling dd3fe94336 The same situation that effected ARM effects PPC with regards to placing the
LSDA into the TEXT section. We need to generate non-lazy pointers to it on
Mach-O. However, the object the NLP points to may be local to the translation
unit. If so, then the NLP needs to have the value of that object specified
instead of "0", which the linker interprets as "external".

llvm-svn: 98325
2010-03-12 02:00:43 +00:00
Bill Wendling faec0815a3 MC-ize PPC's asm printing of stubs.
llvm-svn: 98300
2010-03-11 23:39:44 +00:00
Bill Wendling a810bdfcca Add a bit along with the MCSymbols stored in the MachineModuleInfo maps that
indicates that an MCSymbol is external or not. (It's true if it's external.)
This will be used to specify the correct information to add to non-lazy
pointers. That will be explained further when this bit is used.

llvm-svn: 98199
2010-03-10 22:34:10 +00:00
Chris Lattner ac2361a9b0 set the temporary bit on MCSymbols correctly.
llvm-svn: 98124
2010-03-10 02:25:11 +00:00
Jim Grosbach fae913adf8 Change the Value argument to eliminateFrameIndex to a type-tagged value. This
is preparatory to having PEI's scavenged frame index value reuse logic
properly distinguish types of frame values (e.g., whether the value is
stack-pointer relative or frame-pointer relative).

No functionality change.

llvm-svn: 98086
2010-03-09 21:45:49 +00:00
Dale Johannesen 90eab67320 The address of an indirect call must be in R12 on Darwin.
Make it so.  (This patch is in LowerCall_Darwin, which seems
to be used by SVR4 code as well; since that doesn't belong here,
I haven't worried about this case.)

llvm-svn: 98077
2010-03-09 20:15:42 +00:00
Chris Lattner dac58bd094 Fix a bunch of ambiguous patterns which tblgen happens to infer types
for, due to a bug.

llvm-svn: 97953
2010-03-08 18:44:04 +00:00
Chris Lattner f98f124a73 Sink InstructionSelect() out of each target into SDISel, and rename it
DoInstructionSelection.  Inline "SelectRoot" into it from DAGISelHeader.
Sink some other stuff out of DAGISelHeader into SDISel.

Eliminate the various 'Indent' stuff from various targets, which dates
to when isel was recursive.

 17 files changed, 114 insertions(+), 430 deletions(-)

llvm-svn: 97555
2010-03-02 06:34:30 +00:00
Bill Wendling 78c5b7a76d Remove dead parameter passing.
llvm-svn: 97536
2010-03-02 01:55:18 +00:00
Dan Gohman 6f34abd092 Floating-point add, sub, and mul are now spelled fadd, fsub, and fmul,
respectively.

llvm-svn: 97531
2010-03-02 01:11:08 +00:00
Chris Lattner f159afc951 remove a bogus pattern, which had the same pattern as STDU
but codegen'd differently.  This really wanted to use some
sort of subreg to get the low 4 bytes of the G8RC register
or something.  However, it's invalid and nothing is testing
it, so I'm just zapping the bogosity.

llvm-svn: 97345
2010-02-27 21:15:32 +00:00
Jakob Stoklund Olesen 17d54920d7 Merge PPC instructions FMRS and FMRD into a single FMR instruction.
This is possible because F8RC is a subclass of F4RC. We keep FMRSD around so
fextend has a pattern.

Also allow folding of memory operands on FMRSD.

llvm-svn: 97275
2010-02-26 21:53:24 +00:00
Jakob Stoklund Olesen ddbf7a858e Use the right floating point load/store instructions in PPCInstrInfo::foldMemoryOperandImpl().
The PowerPC floating point registers can represent both f32 and f64 via the
two register classes F4RC and F8RC. F8RC is considered a subclass of F4RC to
allow cross-class coalescing. This coalescing only affects whether registers
are spilled as f32 or f64.

Spill slots must be accessed with load/store instructions corresponding to the
class of the spilled register. PPCInstrInfo::foldMemoryOperandImpl was looking
at the instruction opcode which is wrong.

X86 has similar floating point register classes, but doesn't try to fold
memory operands, so there is no problem there.

llvm-svn: 97262
2010-02-26 21:09:24 +00:00
Chris Lattner d17089231a remove a bunch of dead named arguments in input patterns,
though some look dubious afaict, these are all ok.

llvm-svn: 96899
2010-02-23 06:54:29 +00:00
Chris Lattner 986ab3fb1d Eliminate some uses of immAllOnes, just use -1, it does
the same thing and is more efficient for the matcher.

llvm-svn: 96712
2010-02-21 03:12:16 +00:00
Dale Johannesen 1b967bf0e4 Really reserve R2 on PPC Darwin. PR 6314.
llvm-svn: 96399
2010-02-16 21:53:27 +00:00
Rafael Espindola af25cf825c Drop support for the InReg attribute on the ppc backend. This was used by
llvm-gcc but has been replaced with pad argument which don't need any
special backend support.

llvm-svn: 96312
2010-02-16 01:50:18 +00:00
Anton Korobeynikov ab663a0bfe Move TLOF implementations to libCodegen to resolve layering violation.
llvm-svn: 96288
2010-02-15 22:37:53 +00:00
Anton Korobeynikov ae4ccc10da Preliminary patch to improve dwarf EH generation - Hooks to return Personality / FDE / LSDA / TType encoding depending on target / options (e.g. code model / relocation model) - MCIzation of Dwarf EH printer to use encoding information - Stub generation for ELF target (needed for indirect references) - Some other small changes here and there
llvm-svn: 96285
2010-02-15 22:35:59 +00:00
David Greene 87a5abea33 Remove an assumption of default arguments. This is in anticipation of a
change to SelectionDAG build APIs.

llvm-svn: 96236
2010-02-15 16:56:53 +00:00
Dale Johannesen 626b79d6a6 Add the problem I just hacked around in 96015/96020.
The solution there produces correct code, but is seriously
deficient in several ways.

llvm-svn: 96039
2010-02-12 23:16:24 +00:00
Dale Johannesen cb39340b81 This should have gone in with 26015, see comments there.
llvm-svn: 96020
2010-02-12 22:00:40 +00:00
Dale Johannesen 26062150fa When save/restoring CR at prolog/epilog, in a large
stack frame, the prolog/epilog code was using the same
register for the copy of CR and the address of the save slot.  Oops.
This is fixed here for Darwin, sort of, by reserving R2 for this case.
A better way would be to do the store before the decrement of SP,
which is safe on Darwin due to the red zone.

SVR4 probably has the same problem, but I don't know how to fix it;
there is no red zone and R2 is already used for something else.
I'm going to leave it to someone interested in that target.

Better still would be to rewrite the CR-saving code completely;
spilling each CR subregister individually is horrible code.

llvm-svn: 96015
2010-02-12 21:35:34 +00:00
Dan Gohman 4a618827de Fix "the the" and similar typos.
llvm-svn: 95781
2010-02-10 16:03:48 +00:00
Chris Lattner ff68a42121 print all the newlines at the end of instructions with
OutStreamer.AddBlankLine instead of textually.

llvm-svn: 95734
2010-02-10 00:36:00 +00:00
Chris Lattner b06015aa69 move target-independent opcodes out of TargetInstrInfo
into TargetOpcodes.h.  #include the new TargetOpcodes.h
into MachineInstr.  Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the 
codebase.

llvm-svn: 95687
2010-02-09 19:54:29 +00:00
Dan Gohman 3464a5b609 Rename the PerformTailCallOpt variable to GuaranteedTailCallOpt to reflect
its current purpose.

llvm-svn: 95564
2010-02-08 20:27:50 +00:00
Rafael Espindola 4536b9a904 Fix alignment on ppc linux. This fixes the build of crtend.o
llvm-svn: 95477
2010-02-06 03:32:21 +00:00
Chris Lattner 082f484074 make MachineModuleInfoMachO hold non-const MCSymbol*'s instead
of const ones.  non-const ones aren't very useful, because you can't
even, say, emit them.

llvm-svn: 95205
2010-02-03 06:18:30 +00:00
Chris Lattner 996ec840d0 rejigger the world so that EmitInstruction prints the \n at
the end of the instruction instead of expecting the caller to
do it.  This currently causes the asm-verbose instruction 
comments to be on the next line.

llvm-svn: 95178
2010-02-03 01:09:55 +00:00
Evan Cheng 6f36a083ef Revert 95130.
llvm-svn: 95160
2010-02-02 23:55:14 +00:00
Chris Lattner b0d44c3807 refactor code so that LLVMTargetMachine creates the asmstreamer and
mccontext instead of having AsmPrinter do it.  This allows other 
types of MCStreamer's to be passed in.

llvm-svn: 95155
2010-02-02 23:37:42 +00:00
Chris Lattner f46359642f tidy some targets.
llvm-svn: 95146
2010-02-02 22:13:21 +00:00
Chris Lattner 308acc4ab0 detemplatize the ppc code emitter.
llvm-svn: 95142
2010-02-02 21:55:58 +00:00
Chris Lattner a3fa43932d remove dead code.
llvm-svn: 95141
2010-02-02 21:52:03 +00:00
Chris Lattner 0cd6c2a047 eliminate all the dead addSimpleCodeEmitter implementations.
eliminate random "code emitter" stuff in Alpha, except for
the JIT path.  Next up, remove the template cruft.

llvm-svn: 95131
2010-02-02 21:31:47 +00:00
Evan Cheng c1b0116ff1 Pass callsite return type to TargetLowering::LowerCall and use that to check sibcall eligibility.
llvm-svn: 95130
2010-02-02 21:29:10 +00:00