1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

439 Commits

Author SHA1 Message Date
Anton Korobeynikov
d104087bfe Distinguish between pcrel imm operands and 'normal' ones. Fix fixes gross weirdness of asmprinting.
llvm-svn: 84710
2009-10-21 00:13:25 +00:00
Anton Korobeynikov
c35bd58bd5 Add basic block operands & jump kinds
llvm-svn: 84709
2009-10-21 00:13:05 +00:00
Anton Korobeynikov
2bcb24c40b Ignore all implicit reg operands
llvm-svn: 84708
2009-10-21 00:12:44 +00:00
Anton Korobeynikov
f3003dfcd1 Add a workaround for different memops prefixes
llvm-svn: 84707
2009-10-21 00:12:27 +00:00
Anton Korobeynikov
af4c4ee8f5 Checkpoint MCInst printer. We (almostly) able to print global / JT / constpool entries
llvm-svn: 84706
2009-10-21 00:12:08 +00:00
Anton Korobeynikov
5a6771aab2 Add simple operand printing stuff
llvm-svn: 84704
2009-10-21 00:11:27 +00:00
Anton Korobeynikov
8b01906b63 Add experimental MSP430 MCInstLowering stuff
llvm-svn: 84703
2009-10-21 00:11:08 +00:00
Anton Korobeynikov
0c059394ac Wire up MSP430 printMCInst() method
llvm-svn: 84702
2009-10-21 00:10:47 +00:00
Anton Korobeynikov
a534ef3f63 Add MSP430 InstPrinter stub
llvm-svn: 84701
2009-10-21 00:10:30 +00:00
Anton Korobeynikov
8dc97f136b Use proper target data
llvm-svn: 84700
2009-10-21 00:10:00 +00:00
Evan Cheng
d941e8b23a Revert 84315 for now. Re-thinking the patch.
llvm-svn: 84321
2009-10-17 07:53:04 +00:00
Evan Cheng
12dd96e2f8 Rename getFixedStack to getStackObject. The stack objects represented are not
necessarily fixed. Only those will negative frame indices are "fixed."

llvm-svn: 84315
2009-10-17 06:22:26 +00:00
Anton Korobeynikov
deadc3ed2d Add missed mem-mem move patterns
llvm-svn: 83812
2009-10-11 23:03:53 +00:00
Anton Korobeynikov
986885b62e Add MSP430 mem-mem insts support. Patch by Brian Lucas with some my refinements
llvm-svn: 83811
2009-10-11 23:03:28 +00:00
Anton Korobeynikov
329def1675 Implement 'm' memory operand properly
llvm-svn: 83785
2009-10-11 19:14:21 +00:00
Anton Korobeynikov
4465f90db6 Implement proper asmprinting for the globals. This eliminates bogus "call" modifier and also adds support for offsets wrt globals.
llvm-svn: 83784
2009-10-11 19:14:02 +00:00
Anton Korobeynikov
1ca8655151 Implement asm printing for inline asm memory operands
llvm-svn: 83783
2009-10-11 19:13:34 +00:00
Anton Korobeynikov
1f9ff55cbc It seems that OR operation does not affect status reg at all.
Remove impdef of SRW. This fixes PR4779

llvm-svn: 83739
2009-10-10 22:17:47 +00:00
Jim Grosbach
61c5ce1bde Add register-reuse to frame-index register scavenging. When a target uses
a virtual register to eliminate a frame index, it can return that register
and the constant stored there to PEI to track. When scavenging to allocate
for those registers, PEI then tracks the last-used register and value, and
if it is still available and matches the value for the next index, reuses
the existing value rather and removes the re-materialization instructions.
Fancier tracking and adjustment of scavenger allocations to keep more
values live for longer is possible, but not yet implemented and would likely
be better done via a different, less special-purpose, approach to the
problem.

eliminateFrameIndex() is modified so the target implementations can return
the registers they wish to be tracked for reuse.

ARM Thumb1 implements and utilizes the new mechanism. All other targets are
simply modified to adjust for the changed eliminateFrameIndex() prototype.

llvm-svn: 83467
2009-10-07 17:12:56 +00:00
Dan Gohman
a803c712dd Instead of printing unnecessary basic block labels as labels in
verbose-asm mode, print comments instead. This eliminates a non-comment
difference between verbose-asm mode and non-verbose-asm mode.

Also, factor out the relevant code out of all the targets and into
target-independent code.

llvm-svn: 83392
2009-10-06 17:38:38 +00:00
Devang Patel
a8f35ac640 Update processDebugLoc() so that it can be used to process debug info before and after printing an instruction.
llvm-svn: 83363
2009-10-06 02:19:11 +00:00
Devang Patel
e097bf49d0 Use MachineInstr as an processDebugLoc() argument.
This will allow processDebugLoc() to handle scopes for DWARF debug info. 

llvm-svn: 83183
2009-09-30 23:12:50 +00:00
Dan Gohman
0c4e55a2f8 Rename getTargetNode to getMachineNode, for consistency with the
naming scheme used in SelectionDAG, where there are multiple kinds
of "target" nodes, but "machine" nodes are nodes which represent
a MachineInstr.

llvm-svn: 82790
2009-09-25 18:54:59 +00:00
Evan Cheng
7714c8412d Fix PR4926. When target hook EmitInstrWithCustomInserter() insert new basic blocks and update CFG, it should also inform sdisel of the changes so the phi source operands will come from the right basic blocks.
llvm-svn: 82311
2009-09-19 09:51:03 +00:00
Evan Cheng
7cb9c456e5 Enhance EmitInstrWithCustomInserter() so target can specify CFG changes that sdisel will use to properly complete phi nodes.
Not functionality change yet.

llvm-svn: 82273
2009-09-18 21:02:19 +00:00
Anton Korobeynikov
fb7ac49d96 Allow symbols to start from the digit if target requests it. This allows, e.g. pinning
variables to specified absolute address. Make use of this feature for MSP430.
This unbreaks PR4776.

llvm-svn: 82227
2009-09-18 16:57:42 +00:00
Chris Lattner
334aa7a1d4 remove all but one reference to TargetRegisterDesc::AsmName.
llvm-svn: 81714
2009-09-13 20:31:40 +00:00
Chris Lattner
20b7392123 the tblgen produced 'getRegisterName' method does not access
the object, make it static instead of const.

llvm-svn: 81711
2009-09-13 20:19:22 +00:00
Chris Lattner
0cde5283e3 make tblgen produce a function that returns the name for a physreg.
Nothing is using this info yet.

llvm-svn: 81707
2009-09-13 20:08:00 +00:00
Chris Lattner
cbcbedf254 replace printBasicBlockLabel with EmitBasicBlockStart,
now that printBasicBlockLabel is only used for starting
a MBB.  This allows elimination of a bunch of arguments.

llvm-svn: 81684
2009-09-13 18:25:37 +00:00
Chris Lattner
de1324146e convert some uses of printBasicBlockLabel to use GetMBBSymbol
instead.

llvm-svn: 81677
2009-09-13 17:14:04 +00:00
Chris Lattner
b9aca1a178 remove DebugLoc from MCInst and eliminate "Comment printing" from
the MCInst path of the asmprinter.  Instead, pull comment printing
out of the autogenerated asmprinter into each target that uses the
autogenerated asmprinter.  This causes code duplication into each
target, but in a way that will be easier to clean up later when more
asmprinter stuff is commonized into the base AsmPrinter class.

This also fixes an xcore strangeness where it inserted two tabs
before every instruction.

llvm-svn: 81396
2009-09-09 23:14:36 +00:00
Duncan Sands
10c1356bad Remove some unused variables and methods warned about by
icc (#177, partial).  Patch by Erick Tryzelaar.

llvm-svn: 81106
2009-09-06 08:33:48 +00:00
Sandeep Patel
9c4e094e2a Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.
llvm-svn: 80773
2009-09-02 08:44:58 +00:00
Benjamin Kramer
61232721d9 Normalize makefile comments and sort cmake file lists.
llvm-svn: 80584
2009-08-31 13:05:24 +00:00
Anton Korobeynikov
6ee3a73ba1 Add dummy inline asm handling for 'r' constraint. This fixes PR4778
llvm-svn: 80085
2009-08-26 13:44:29 +00:00
Anton Korobeynikov
b388728ba7 Provide dynamic_stackalloc lowering for MSP430.
This fixes PR4769

llvm-svn: 80001
2009-08-25 17:00:23 +00:00
Daniel Dunbar
411094cde6 Fix some refactos for iostream changes (in -Asserts mode).
- The world needs better C++ refactoring tools, can I get an Amen!?

llvm-svn: 79843
2009-08-23 08:50:52 +00:00
Chris Lattner
bd73307361 eliminate uses of cerr()
llvm-svn: 79834
2009-08-23 07:05:07 +00:00
Chris Lattner
26ec3291f0 eliminate the last DOUTs from the targets.
llvm-svn: 79833
2009-08-23 06:49:22 +00:00
Benjamin Kramer
52cba58070 Forgot to update some CMakeLists.
llvm-svn: 79780
2009-08-22 22:20:11 +00:00
Chris Lattner
8d06945fff rename TAI -> MAI, being careful not to make MAILJMP instructions :)
llvm-svn: 79777
2009-08-22 21:43:10 +00:00
Chris Lattner
5d8af49626 Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.
llvm-svn: 79763
2009-08-22 20:48:53 +00:00
Chris Lattner
9cbc9c2d13 eliminate AsmPrinter::SwitchToSection and just have clients
talk to the MCStreamer directly instead.

llvm-svn: 79405
2009-08-19 05:49:37 +00:00
Anton Korobeynikov
a52d80928a Cleanup the mess in msp430 target registration and hopefully unbreak the build
llvm-svn: 79024
2009-08-14 19:06:50 +00:00
Anton Korobeynikov
094a764f5d Hopefully unbreak cmake builds
llvm-svn: 79015
2009-08-14 18:46:49 +00:00
Anton Korobeynikov
5787e69dfb Give MSP430 a separate asmprinter lib
llvm-svn: 79012
2009-08-14 18:28:12 +00:00
Chris Lattner
55df534293 Change TargetAsmInfo to be constructed via TargetRegistry from a Target+Triple
pair instead of from a virtual method on TargetMachine.  This cuts the final
ties of TargetAsmInfo to TargetMachine, meaning that MC can now use 
TargetAsmInfo.

llvm-svn: 78802
2009-08-12 07:22:17 +00:00
Owen Anderson
48f2f0ae72 Split EVT into MVT and EVT, the former representing _just_ a primitive type, while
the latter is capable of representing either a primitive or an extended type.

llvm-svn: 78713
2009-08-11 20:47:22 +00:00
Chris Lattner
30d9c39337 pass the TargetTriple down from each target ctor to the
LLVMTargetMachine ctor.  It is currently unused.

llvm-svn: 78711
2009-08-11 20:42:37 +00:00
Owen Anderson
b4bce99769 Rename MVT to EVT, in preparation for splitting SimpleValueType out into its own struct type.
llvm-svn: 78610
2009-08-10 22:56:29 +00:00
Chris Lattner
7bf6e40552 make printInstruction return void since its result is omitted. Make the
error condition get trapped with an assert.

llvm-svn: 78449
2009-08-08 01:32:19 +00:00
Chris Lattner
2fc10a4dd9 don't check the result of printInstruction anymore.
llvm-svn: 78444
2009-08-08 00:05:42 +00:00
Anton Korobeynikov
27fdf43425 Special constants as destinations does not work as expected - drop the patterns.
llvm-svn: 78191
2009-08-05 14:42:00 +00:00
Dan Gohman
5d566d918b Major calling convention code refactoring.
Instead of awkwardly encoding calling-convention information with ISD::CALL,
ISD::FORMAL_ARGUMENTS, ISD::RET, and ISD::ARG_FLAGS nodes, TargetLowering
provides three virtual functions for targets to override:
LowerFormalArguments, LowerCall, and LowerRet, which replace the custom
lowering done on the special nodes. They provide the same information, but
in a more immediately usable format.

This also reworks much of the target-independent tail call logic. The
decision of whether or not to perform a tail call is now cleanly split
between target-independent portions, and the target dependent portion
in IsEligibleForTailCallOptimization.

This also synchronizes all in-tree targets, to help enable future
refactoring and feature work.

llvm-svn: 78142
2009-08-05 01:29:28 +00:00
Dan Gohman
4b2748d474 Don't flush the raw_ostream between each MachineFunction. These flush
calls were originally put in place because errs() at one time was
not unbuffered, and these print routines are commonly used with errs()
for debugging. However, errs() is now properly unbuffered, so the
flush calls are no longer needed. This significantly reduces the
number of write(2) calls for regular asm printing when there are many
small functions.

llvm-svn: 78137
2009-08-05 00:49:25 +00:00
Daniel Dunbar
9e079eec0c Move most targets TargetMachine constructor to only taking a target triple.
- The C, C++, MSIL, and Mips backends still need the module.

llvm-svn: 77927
2009-08-02 23:37:13 +00:00
Daniel Dunbar
0b82c938fe Normalize Subtarget constructors to take a target triple string instead of
Module*.

Also, dropped uses of TargetMachine where unnecessary. The only target which
still takes a TargetMachine& is Mips, I would appreciate it if someone would
normalize this to match other targets.

llvm-svn: 77918
2009-08-02 22:11:08 +00:00
Chris Lattner
a871d5d718 MSP430 TAI doesn't need TM.
llvm-svn: 77871
2009-08-02 04:45:22 +00:00
Chris Lattner
b5ceb50677 remove TargetAsmInfo::TM, which is now dead. The basic TAI class now
no longer depends on TM!

llvm-svn: 77863
2009-08-02 04:27:24 +00:00
Chris Lattner
18af1b233a Give getPointerRegClass() a "kind" value so that targets can
support multiple different pointer register classes.

llvm-svn: 77501
2009-07-29 20:31:52 +00:00
Chris Lattner
5c3e1e0d0c pass the mangler down into the various SectionForGlobal methods.
No functionality change.

llvm-svn: 77432
2009-07-29 05:09:30 +00:00
Chris Lattner
55461787cc Rip all of the global variable lowering logic out of TargetAsmInfo. Since
it is highly specific to the object file that will be generated in the end,
this introduces a new TargetLoweringObjectFile interface that is implemented
for each of ELF/MachO/COFF/Alpha/PIC16 and XCore.

Though still is still a brutal and ugly refactoring, this is a major step
towards goodness.

This patch also:
1. fixes a bunch of dangling pointer problems in the PIC16 backend.
2. disables the TargetLowering copy ctor which PIC16 was accidentally using.
3. gets us closer to xcore having its own crazy target section flags and
   pic16 not having to shadow sections with its own objects.
4. fixes wierdness where ELF targets would set CStringSection but not
   CStringSection_.  Factor the code better.
5. fixes some bugs in string lowering on ELF targets.

llvm-svn: 77294
2009-07-28 03:13:23 +00:00
Chris Lattner
cd7d963b75 Eliminate getNamed/getUnnamedSection, adding a new and unified getOrCreateSection
instead.

llvm-svn: 77186
2009-07-27 06:17:14 +00:00
Chris Lattner
a2b00bdd7a Eliminate SectionFlags, just embed a SectionKind into Section
instead and drive things based off of that.

llvm-svn: 77184
2009-07-27 05:32:16 +00:00
Chris Lattner
0f4d60ca90 untangle a TargetAsmInfo hack where ELFTargetAsmInfo would create a
'unnamed' bss section, but some impls would want a named one.  Since
they don't have consistent behavior, just make each target do their
own thing, instead of doing something "sortof common" then having
targets change immutable objects later.

llvm-svn: 77165
2009-07-26 19:23:28 +00:00
Daniel Dunbar
a7a01acc7c Factor commonality in triple match routines into helper template for registering
classes, and migrate existing targets over.

llvm-svn: 77126
2009-07-26 05:03:33 +00:00
Daniel Dunbar
49987490c2 Kill Target specific ModuleMatchQuality stuff.
- This was overkill and inconsistently implemented.

llvm-svn: 77114
2009-07-26 02:22:58 +00:00
Daniel Dunbar
d699ffc2ac Simplify JIT target selection.
- Instead of requiring targets to define a JIT quality match function, we just
   have them specify if they support a JIT.

 - Target selection for the JIT just gets the host triple and looks for the best
   target which matches the triple and has a JIT.

llvm-svn: 77060
2009-07-25 10:09:50 +00:00
Daniel Dunbar
284fe09fe4 Add new helpers for registering targets.
- Less boilerplate == good.

llvm-svn: 77052
2009-07-25 06:49:55 +00:00
Owen Anderson
cc287b28c9 Get rid of the Pass+Context magic.
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Chris Lattner
3d4ab7a231 make AsmPrinter::doFinalization iterate over the global variables
and call PrintGlobalVariable, allowing elimination and simplification
of various targets.

llvm-svn: 76604
2009-07-21 18:38:57 +00:00
Chris Lattner
433fbf959a fix Sparc, SystemZ, and MSP430 to not override AsmPrinter::doInitialization.
This eliminates redundancy setting up the mangler and adds support to them
for module-level inline asm and a .file directive.

llvm-svn: 76592
2009-07-21 17:37:35 +00:00
Chris Lattner
0f65fbf095 Rename LessPrivateGlobalPrefix -> LinkerPrivateGlobalPrefix to match the
LLVM IR concept.

llvm-svn: 76590
2009-07-21 17:30:51 +00:00
Chris Lattner
31a9d57bb9 remove an unneeded override.
llvm-svn: 76586
2009-07-21 17:23:41 +00:00
Bill Wendling
16a69eeaeb Pass in the unfortunately named "LessPrivatePrefix" for the
"LinkerPrivatePrefix". It seems to have been used in only one place before I
started this "linker_private" business. I'm thinking that a rename is in
order...

llvm-svn: 76479
2009-07-20 21:30:28 +00:00
Bill Wendling
1a10a060cb Add plumbing for the `linker_private' linkage type. This type is meant for
"private" symbols which the assember shouldn't strip, but which the linker may
remove after evaluation. This is mostly useful for Objective-C metadata.

This is plumbing, so we don't have a use of it yet. More to come, etc.

llvm-svn: 76385
2009-07-20 01:03:30 +00:00
Daniel Dunbar
f5a95d9e81 Tweak cmake files for the four targets that don't split CodeGen out.
- We should canonicalize this and get rid of the cmake and llvm-config hacks to
   support both variants.

llvm-svn: 76350
2009-07-19 00:26:46 +00:00
Daniel Dunbar
aca95eac72 Add dependencies from TargetInfo onto .td generation.
- Shouldn't really be necessary, but currently .inc files get included into
   some main target headers.

llvm-svn: 76349
2009-07-19 00:21:12 +00:00
Daniel Dunbar
960ef321ca Put Target definitions inside Target specific header, and llvm namespace.
llvm-svn: 76344
2009-07-18 23:03:22 +00:00
Eli Friedman
6e61f56a5c Oops, accidentally set a legal operation to expand.
llvm-svn: 76165
2009-07-17 07:34:23 +00:00
Eli Friedman
b946eb988f Expand misc operations from test/CodeGen/Generic.
llvm-svn: 76163
2009-07-17 07:28:06 +00:00
Daniel Dunbar
90536f6737 Kill off <TARGET>MachineModule variables, and <TARGETASMPRINTER>ForceLink
variables.
 - Module initialization functions supplanted the need for these.

llvm-svn: 75886
2009-07-16 01:55:13 +00:00
Daniel Dunbar
4771afe104 Lift addAssemblyEmitter into LLVMTargetMachine.
- No functionality change.

llvm-svn: 75859
2009-07-15 23:34:19 +00:00
Daniel Dunbar
efb868a754 Register AsmPrinter for XCore, MSP430, and PIC16 targets.
- Switch to standard addAssemblyEmitter logic.

llvm-svn: 75854
2009-07-15 23:17:20 +00:00
Daniel Dunbar
5707dd7f73 Reapply TargetRegistry refactoring commits.
--- Reverse-merging r75799 into '.':
 U   test/Analysis/PointerTracking
U    include/llvm/Target/TargetMachineRegistry.h
U    include/llvm/Target/TargetMachine.h
U    include/llvm/Target/TargetRegistry.h
U    include/llvm/Target/TargetSelect.h
U    tools/lto/LTOCodeGenerator.cpp
U    tools/lto/LTOModule.cpp
U    tools/llc/llc.cpp
U    lib/Target/PowerPC/PPCTargetMachine.h
U    lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
U    lib/Target/PowerPC/PPCTargetMachine.cpp
U    lib/Target/PowerPC/PPC.h
U    lib/Target/ARM/ARMTargetMachine.cpp
U    lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
U    lib/Target/ARM/ARMTargetMachine.h
U    lib/Target/ARM/ARM.h
U    lib/Target/XCore/XCoreTargetMachine.cpp
U    lib/Target/XCore/XCoreTargetMachine.h
U    lib/Target/PIC16/PIC16TargetMachine.cpp
U    lib/Target/PIC16/PIC16TargetMachine.h
U    lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
U    lib/Target/Alpha/AlphaTargetMachine.cpp
U    lib/Target/Alpha/AlphaTargetMachine.h
U    lib/Target/X86/X86TargetMachine.h
U    lib/Target/X86/X86.h
U    lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
U    lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
U    lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h
U    lib/Target/X86/X86TargetMachine.cpp
U    lib/Target/MSP430/MSP430TargetMachine.cpp
U    lib/Target/MSP430/MSP430TargetMachine.h
U    lib/Target/CppBackend/CPPTargetMachine.h
U    lib/Target/CppBackend/CPPBackend.cpp
U    lib/Target/CBackend/CTargetMachine.h
U    lib/Target/CBackend/CBackend.cpp
U    lib/Target/TargetMachine.cpp
U    lib/Target/IA64/IA64TargetMachine.cpp
U    lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
U    lib/Target/IA64/IA64TargetMachine.h
U    lib/Target/IA64/IA64.h
U    lib/Target/MSIL/MSILWriter.cpp
U    lib/Target/CellSPU/SPUTargetMachine.h
U    lib/Target/CellSPU/SPU.h
U    lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
U    lib/Target/CellSPU/SPUTargetMachine.cpp
U    lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
U    lib/Target/Mips/MipsTargetMachine.cpp
U    lib/Target/Mips/MipsTargetMachine.h
U    lib/Target/Mips/Mips.h
U    lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
U    lib/Target/Sparc/SparcTargetMachine.cpp
U    lib/Target/Sparc/SparcTargetMachine.h
U    lib/ExecutionEngine/JIT/TargetSelect.cpp
U    lib/Support/TargetRegistry.cpp

llvm-svn: 75820
2009-07-15 20:24:03 +00:00
Stuart Hastings
ef732a2bea Revert 75762, 75763, 75766..75769, 75772..75775, 75778, 75780, 75782 to repair broken LLVM-GCC build.
Will revert 75770 in the llvm-gcc trunk.

llvm-svn: 75799
2009-07-15 17:27:11 +00:00
Daniel Dunbar
2b67b4ab9f Kill off old (TargetMachine level, not Target level) match quality functions.
llvm-svn: 75780
2009-07-15 12:26:05 +00:00
Daniel Dunbar
51b81c9930 Provide TargetMachine implementations with reference to Target they were created
from.
 - This commit is almost entirely propogating the reference through the
   TargetMachine subclasses' constructor calls.

llvm-svn: 75778
2009-07-15 12:11:05 +00:00
Daniel Dunbar
a2af870bd7 Register Target's TargetMachine and AsmPrinter in the new registry.
- This abuses TargetMachineRegistry's constructor for now, this will get
   cleaned up in time.

llvm-svn: 75762
2009-07-15 09:22:31 +00:00
Daniel Dunbar
b70d5cdfe1 Add TargetInfo libraries for all targets.
- Intended to match current TargetMachine implementations.

 - No facilities for linking these in yet.

llvm-svn: 75751
2009-07-15 06:35:19 +00:00
David Greene
9c8a1b9b90 Have asm printers use formatted_raw_ostream directly to avoid a
dynamic_cast<>.

llvm-svn: 75670
2009-07-14 20:18:05 +00:00
Chris Lattner
6ec578688d Reapply my previous asmprinter changes now with more testing and two
additional bug fixes:

1. The bug that everyone hit was a problem in the asmprinter where it
   would remove $stub but keep the L prefix on a name when emitting the
   indirect symbol.  This is easy to fix by keeping the name of the stub
   and the name of the symbol in a StringMap instead of just keeping a
   StringSet and trying to reconstruct it late.

2. There was a problem printing the personality function.  The current
   logic to print out the personality function from the DWARF information
   is a bit of a cesspool right now that duplicates a bunch of other 
   logic in the asm printer.  The short version of it is that it depends
   on emitting both the L and _ prefix for symbols (at least on darwin)
   and until I can untangle it, it is best to switch the mangler back to
   emitting both prefixes.

llvm-svn: 75646
2009-07-14 18:17:16 +00:00
Torok Edwin
f955a6ef49 llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").

llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Daniel Dunbar
84d593320b Revert r75615, which depended on 75610.
--- Reverse-merging r75615 into '.':
U    lib/Target/XCore/XCoreAsmPrinter.cpp
U    lib/Target/PIC16/PIC16AsmPrinter.cpp
U    lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
U    lib/Target/MSP430/MSP430AsmPrinter.cpp
U    lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
U    lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
U    lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
U    lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
U    lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
U    lib/Target/MSIL/MSILWriter.cpp
U    lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
U    lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp

llvm-svn: 75637
2009-07-14 16:12:13 +00:00
Chris Lattner
8aa18612e2 Rename getValueName -> getMangledName.
llvm-svn: 75615
2009-07-14 06:18:50 +00:00
Torok Edwin
ae8a3ff177 assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.

llvm-svn: 75379
2009-07-11 20:10:48 +00:00
Richard Pennington
6cfce9d61d bug 4524: Add MSP430 to the cmake build.
llvm-svn: 75170
2009-07-09 20:27:09 +00:00
Owen Anderson
8970999512 Thread LLVMContext through MVT and related parts of SDISel.
llvm-svn: 75153
2009-07-09 17:57:24 +00:00
Torok Edwin
358888da3a Implement changes from Chris's feedback.
Finish converting lib/Target.

llvm-svn: 75043
2009-07-08 20:53:28 +00:00
Torok Edwin
980729667e Convert more abort() calls to llvm_report_error().
Also remove trailing semicolon.

llvm-svn: 75027
2009-07-08 19:04:27 +00:00
Duncan Sands
c149803103 Silence warning when building without assertions.
llvm-svn: 74777
2009-07-03 16:06:07 +00:00
Bill Wendling
fdd5badace Update comments to make it clear that the function alignment is the Log2 of the
bytes and not bytes.

llvm-svn: 74624
2009-07-01 18:50:55 +00:00
Daniel Dunbar
bc3d149e98 Remove unused AsmPrinter OptLevel argument, and propogate.
- This more or less amounts to a revert of r65379. I'm curious to know what
   happened that caused this variable to become unused.

llvm-svn: 74579
2009-07-01 01:48:54 +00:00
Bill Wendling
c0fb316bd3 Add an "alignment" field to the MachineFunction object. It makes more sense to
have the alignment be calculated up front, and have the back-ends obey whatever
alignment is decided upon.

This allows for future work that would allow for precise no-op placement and the
like.

llvm-svn: 74564
2009-06-30 22:38:32 +00:00
Bob Wilson
7bd642b80c Provide InitializeAllTargets and InitializeNativeTarget functions in the
C bindings.  Change all the backend "Initialize" functions to have C linkage.
Change the "llvm/Config/Targets.def" header to use C-style comments to avoid
compile warnings.

llvm-svn: 74026
2009-06-23 23:59:40 +00:00
Douglas Gregor
f5291553f2 Introduce new headers whose inclusion forces linking and
initialization of all targets (InitializeAllTargets.h) or assembler
printers (InitializeAllAsmPrinters.h). This is a step toward the
elimination of relinked object files, so that we can build normal
archives.

llvm-svn: 73543
2009-06-16 20:12:29 +00:00
Dan Gohman
e0d593cbf6 Add explicit keywords.
llvm-svn: 72969
2009-06-05 23:05:51 +00:00
Anton Korobeynikov
34fc85e2ee Propagate CPU string out of SubtargetFeatures
llvm-svn: 72335
2009-05-23 19:50:50 +00:00
Anton Korobeynikov
85accafcba Mark rotl/rotr as expand. This generates pretty ugly code, but this is better than nothing.
llvm-svn: 71976
2009-05-17 10:16:28 +00:00
Anton Korobeynikov
8753e89b79 Typo
llvm-svn: 71975
2009-05-17 10:15:22 +00:00
Bill Wendling
e421c8f63d Change MachineInstrBuilder::addReg() to take a flag instead of a list of
booleans. This gives a better indication of what the "addReg()" is
doing. Remembering what all of those booleans mean isn't easy, especially if you
aren't spending all of your time in that code.

I took Jakob's suggestion and made it illegal to pass in "true" for the
flag. This should hopefully prevent any unintended misuse of this (by reverting
to the old way of using addReg()).

llvm-svn: 71722
2009-05-13 21:33:08 +00:00
Anton Korobeynikov
02d9c5b905 Add imm-reg and imm-mem patters for cmp on msp430
(imm is allowed to be source operand, not dest...)

llvm-svn: 71393
2009-05-10 14:49:00 +00:00
Anton Korobeynikov
5461d8e07d Allow 8 bit select in custom inserter
llvm-svn: 71239
2009-05-08 18:51:21 +00:00
Anton Korobeynikov
1be416b310 Expand UREM / SREM into libcalls
llvm-svn: 71236
2009-05-08 18:50:41 +00:00
Anton Korobeynikov
8364529d37 Add 8 bit select
llvm-svn: 71235
2009-05-08 18:50:26 +00:00
Dan Gohman
83dfa97326 Trim unnecessary #includes.
llvm-svn: 70880
2009-05-04 17:11:06 +00:00
Anton Korobeynikov
df33e5a803 Handle implicit zext in a better way. Shamelessly stolen from x86 backend.
Thanks for Dan Gohman for suggestion!

llvm-svn: 70782
2009-05-03 15:50:18 +00:00
Anton Korobeynikov
46a92ec4d6 Update due to mainline API change
llvm-svn: 70769
2009-05-03 13:19:42 +00:00
Anton Korobeynikov
13ed1c4514 Add TODO list :)
llvm-svn: 70768
2009-05-03 13:19:24 +00:00
Anton Korobeynikov
8988fea464 Make handling of conditional stuff much more straightforward
llvm-svn: 70767
2009-05-03 13:19:09 +00:00
Anton Korobeynikov
d8c42b2dee Temporary disable imm patterns for cmp. Actually, all cmp-related stuff (select_cc, setcc, br_cc). needs to be rethought
llvm-svn: 70766
2009-05-03 13:18:50 +00:00
Anton Korobeynikov
e6c8cc6c51 Expand divisions into libcalls
llvm-svn: 70765
2009-05-03 13:18:33 +00:00
Anton Korobeynikov
54bbd77498 Custom lower SIGN_EXTEND
llvm-svn: 70763
2009-05-03 13:17:49 +00:00
Anton Korobeynikov
9103796e69 Some eye-candy
llvm-svn: 70762
2009-05-03 13:17:31 +00:00
Anton Korobeynikov
c0ea294fb9 Print function header / footer
llvm-svn: 70761
2009-05-03 13:17:11 +00:00
Anton Korobeynikov
f4b4812c83 Fix printing: je => jeq
llvm-svn: 70760
2009-05-03 13:16:54 +00:00
Anton Korobeynikov
4b5232c990 Add 8bit shifts
llvm-svn: 70759
2009-05-03 13:16:37 +00:00
Anton Korobeynikov
d0e3939bdf Handle logical shift right (at least I hope so :) )
llvm-svn: 70758
2009-05-03 13:16:17 +00:00
Anton Korobeynikov
7dd27f2e41 Handle anyext
llvm-svn: 70757
2009-05-03 13:15:57 +00:00
Anton Korobeynikov
baf9278166 Expand all sorts of indirect branches
llvm-svn: 70755
2009-05-03 13:15:40 +00:00
Anton Korobeynikov
806b8efb5e Add InsertBranch() hook for tail mergeing
llvm-svn: 70754
2009-05-03 13:15:22 +00:00
Anton Korobeynikov
b97b120cf9 Implement bswap
llvm-svn: 70753
2009-05-03 13:15:03 +00:00
Anton Korobeynikov
cebc97d79c Properly handle ExternalSymbol's
llvm-svn: 70752
2009-05-03 13:14:46 +00:00
Anton Korobeynikov
9b84c6b633 Expand muls (all mulls!) to libcalls for now
llvm-svn: 70751
2009-05-03 13:14:25 +00:00
Anton Korobeynikov
80d0bdc789 Provide addc and subc
llvm-svn: 70748
2009-05-03 13:13:34 +00:00
Anton Korobeynikov
1f80bde7ad Add left shift
llvm-svn: 70747
2009-05-03 13:13:17 +00:00
Anton Korobeynikov
d9b4143e47 Add direct branch
llvm-svn: 70746
2009-05-03 13:12:58 +00:00
Anton Korobeynikov
c5a13f6a3f It's error-prone to maintain two separate variants of asmprinting stuff, one of which is even used. Drop second (aka 'intel') variant of operands. It can be added later, if needed.
llvm-svn: 70745
2009-05-03 13:12:37 +00:00
Anton Korobeynikov
f7943f8df6 Lower select with custom inserted and make condjumps generic
llvm-svn: 70744
2009-05-03 13:12:23 +00:00
Anton Korobeynikov
d55d6586ae Add first draft for conditions, conditional branches, etc
llvm-svn: 70743
2009-05-03 13:12:06 +00:00
Anton Korobeynikov
2b8085a3f5 Hanle i8 returns
llvm-svn: 70742
2009-05-03 13:11:48 +00:00
Anton Korobeynikov
67b1a5c20b Small tweaking
llvm-svn: 70741
2009-05-03 13:11:35 +00:00
Anton Korobeynikov
c428224a89 Add prologue/epilogue emission. Fix frame pointer handling.
llvm-svn: 70740
2009-05-03 13:11:20 +00:00
Anton Korobeynikov
10d199fa80 Add code for save/restore of callee-saved registers
llvm-svn: 70739
2009-05-03 13:11:04 +00:00
Anton Korobeynikov
6a63537ff0 Two more hooks for RA and FP registers
llvm-svn: 70738
2009-05-03 13:10:40 +00:00
Anton Korobeynikov
06d645c199 Proper handle loading of effective address of stack slot stuff
llvm-svn: 70737
2009-05-03 13:10:26 +00:00
Anton Korobeynikov
88cc152a78 Match frame indexes
llvm-svn: 70736
2009-05-03 13:10:11 +00:00
Anton Korobeynikov
e7639579a3 First draft of stack slot loads / stores lowering
llvm-svn: 70735
2009-05-03 13:09:57 +00:00
Anton Korobeynikov
1f9d4dc64d Reverse order of memory arguments
llvm-svn: 70734
2009-05-03 13:09:40 +00:00
Anton Korobeynikov
f3fadcbbda Remove bogus pattern
llvm-svn: 70733
2009-05-03 13:09:24 +00:00
Anton Korobeynikov
47c1450013 Correct asmprinting of memory operands
llvm-svn: 70732
2009-05-03 13:09:10 +00:00
Anton Korobeynikov
eea3a58bbf Match wrapper node for address
llvm-svn: 70731
2009-05-03 13:08:51 +00:00
Anton Korobeynikov
cd06be1d13 Add lowering for global address nodes. Not pretty efficient though.
llvm-svn: 70730
2009-05-03 13:08:33 +00:00
Anton Korobeynikov
e02a674ee0 Some early full call lowering draft for direct calls
llvm-svn: 70729
2009-05-03 13:08:13 +00:00
Anton Korobeynikov
b396742d02 Add call frame setup instruction elimination and lowerid for bunch of call-related stuff.
llvm-svn: 70728
2009-05-03 13:07:54 +00:00
Anton Korobeynikov
4fa710b300 Add CALL lowering.
llvm-svn: 70727
2009-05-03 13:07:31 +00:00
Anton Korobeynikov
582d2a335b Add bunch of mem-whatever patterns
llvm-svn: 70726
2009-05-03 13:07:10 +00:00
Anton Korobeynikov
d14ee9eeae Add bunch of reg-mem inst patterns
llvm-svn: 70725
2009-05-03 13:06:46 +00:00
Anton Korobeynikov
7b7a743ea8 Add normal and trunc stores
llvm-svn: 70724
2009-05-03 13:06:26 +00:00
Anton Korobeynikov
91359dcc3b Basic support for mem=>reg moves
llvm-svn: 70723
2009-05-03 13:06:03 +00:00
Anton Korobeynikov
83122b7ef0 Add 8-bit insts. zext behaviour is not modelled yet
llvm-svn: 70722
2009-05-03 13:05:42 +00:00
Anton Korobeynikov
1c0af22261 Add 8-bit regclass and pattern for sext_inreg
llvm-svn: 70721
2009-05-03 13:05:22 +00:00
Anton Korobeynikov
d74b7ab46d Add pattern for OR
llvm-svn: 70720
2009-05-03 13:05:00 +00:00
Anton Korobeynikov
aff90ae4f2 Add reg-imm variants
llvm-svn: 70719
2009-05-03 13:04:41 +00:00
Anton Korobeynikov
ff4332fcde Add hint to nop
llvm-svn: 70718
2009-05-03 13:04:23 +00:00
Anton Korobeynikov
a46b46fa46 Add more instructions
llvm-svn: 70717
2009-05-03 13:04:06 +00:00
Anton Korobeynikov
1921caf185 Cleanup
llvm-svn: 70716
2009-05-03 13:03:50 +00:00
Anton Korobeynikov
262c4b9ff9 Add dummy lowering for shifts
llvm-svn: 70715
2009-05-03 13:03:33 +00:00
Anton Korobeynikov
f21d1d0d2c We don't have any div at all - thus mark it as expensive
llvm-svn: 70714
2009-05-03 13:03:14 +00:00
Anton Korobeynikov
df71fb8a3a We're not going to spend 100% of time in interrupts, do we? :)
llvm-svn: 70713
2009-05-03 13:02:57 +00:00
Anton Korobeynikov
627e169e8e Add simple reg-reg add.
llvm-svn: 70712
2009-05-03 13:02:39 +00:00
Anton Korobeynikov
be8018ff1d gas uses lower letter for register names
llvm-svn: 70711
2009-05-03 13:02:22 +00:00
Anton Korobeynikov
e9e0353b21 Add code enough for emission of reg-reg and reg-imm moves. This allows us to compile "ret i16 0" properly!
llvm-svn: 70710
2009-05-03 13:02:04 +00:00
Anton Korobeynikov
8b763cb6ec Add function body printing routine
llvm-svn: 70709
2009-05-03 13:01:41 +00:00
Anton Korobeynikov
5f8e2ee553 Add 'msp430' target triple recognizer
llvm-svn: 70708
2009-05-03 13:01:23 +00:00
Anton Korobeynikov
f5317831da Make emit{Prologue,Epilogue}() noop for now
llvm-svn: 70707
2009-05-03 13:01:04 +00:00
Anton Korobeynikov
57d55e96cd Add callee-saved regs & reg classes getter hooks
llvm-svn: 70706
2009-05-03 13:00:46 +00:00
Anton Korobeynikov
70dbb3eb2f Add simple FP indicator for given function hook
llvm-svn: 70705
2009-05-03 13:00:28 +00:00
Anton Korobeynikov
4c91b3a6f2 Provide set of reserved registers
llvm-svn: 70704
2009-05-03 13:00:11 +00:00
Anton Korobeynikov
ebab62b827 Add proper ISD::RET lowering
llvm-svn: 70703
2009-05-03 12:59:50 +00:00
Anton Korobeynikov
e74a06c068 Add first draft of MSP430 calling convention stuff and draft of ISD::FORMAL_ARGUMENTS node lowering.
llvm-svn: 70702
2009-05-03 12:59:33 +00:00
Anton Korobeynikov
b85740bf76 Fix register names, fix register allocation order, handle frame pointer.
llvm-svn: 70701
2009-05-03 12:59:16 +00:00
Anton Korobeynikov
5af68b43bc Clearify the usage and add some debug stuff
llvm-svn: 70700
2009-05-03 12:58:58 +00:00
Anton Korobeynikov
840e251a16 Cleanup
llvm-svn: 70699
2009-05-03 12:58:40 +00:00
Anton Korobeynikov
372921c7be Add cmake script. No idea whether it works or not :)
llvm-svn: 70698
2009-05-03 12:58:22 +00:00
Anton Korobeynikov
0eec6e6c0a Add a note
llvm-svn: 70697
2009-05-03 12:58:05 +00:00
Anton Korobeynikov
be51fd1388 Typo
llvm-svn: 70695
2009-05-03 12:57:47 +00:00
Anton Korobeynikov
d49e584da5 Dummy MSP430 backend
llvm-svn: 70694
2009-05-03 12:57:15 +00:00