Commit Graph

29830 Commits

Author SHA1 Message Date
Xerxes Ranby
baaf1178e9 Fix cmake build lib/Target/TargetMachineRegistry.cpp removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 12:19:36 +00:00
Daniel Dunbar
03f4bc5d6c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75778 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 12:11:05 +00:00
Daniel Dunbar
6501145ec6 Kill off unused TargetMachineRegistry methods and ivars.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75774 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 11:48:36 +00:00
Daniel Dunbar
54785e6df0 Migrate llc and the JIT to using the TargetRegistry for lookups.
- They still use the TargetMachineRegistry to populate the contents of the
   -march option (via the listener interface). We can't just populate it in the
   option parser because we can't expect the TargetRegistry to be populated yet
   (we no longer rely on static constructors).

 - There are a couple ways to finish killing off TargetMachineRegistry, but I
   haven't figured out the cleanest one yet...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 11:36:15 +00:00
Daniel Dunbar
4d1be777f8 Include the Target& in the TargetMachineRegisterEntry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75772 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 11:23:49 +00:00
Daniel Dunbar
3fb7eee9c2 Allow multiple registrations of the same target.
- This doesn't necessarily seem like a good idea, but the JIT unittest
   currently relies on it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75769 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 10:32:44 +00:00
Daniel Dunbar
dec9803b69 Switch some obvious clients to using the new TargetRegistry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75767 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 10:05:03 +00:00
Daniel Dunbar
e0bda7df1a Reimplement TargetMachineRegistry in terms of TargetRegistry.
- This is a temporary hack to aid in incremental refactoring, for now we
   allocate a new TargetMachineRegistryEntry on every getClosest... call.

 - No intended functionality change, other than the leaked memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75766 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 09:53:37 +00:00
Daniel Dunbar
4246790aa8 Register Target's TargetMachine and AsmPrinter in the new registry.
- This abuses TargetMachineRegistry's constructor for now, this will get
   cleaned up in time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 09:22:31 +00:00
Daniel Dunbar
579fb87ce7 Detect write failures on raw_fd_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 08:11:46 +00:00
Daniel Dunbar
f23d4930bd Fix stupid thinko
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 07:37:49 +00:00
Daniel Dunbar
73b3ec4134 Address some review comments on TargetRegistry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 07:09:29 +00:00
Daniel Dunbar
c984df8602 Add TargetInfo libraries for all targets.
- Intended to match current TargetMachine implementations.

 - No facilities for linking these in yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 06:35:19 +00:00
Evan Cheng
f9b36f08ef Move load / store folding alignment require into the table(s).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75749 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 06:10:07 +00:00
Ted Kremenek
51381d25af Update CMake file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75746 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 05:39:55 +00:00
Chris Lattner
c08872ec60 rename decorateName -> DecorateCygMingName, make it assert if not
cygming, make the two callers only call it if cygming.  Other minor
cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75744 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 04:55:56 +00:00
Chris Lattner
9d5511b7db eliminate the Mangler::PreserveAsmNames bit, the sole client of this
can do it perfectly well itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 04:50:47 +00:00
Chris Lattner
f1cfea2dbf remove printSuffixedName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 04:42:49 +00:00
Chris Lattner
b1ccad3b0d convert arm/darwin stubs to use the mangler to synthesize all the names instead of
doing it with printSuffixedName.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75741 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 04:41:01 +00:00
Daniel Dunbar
bb06129140 Add new TargetRegistry.
Targets implement a single global Target structure which will live in a new
<Target>/TargetInfo library; this will be present in any image which the target
is usable in.
 - Optional target specific classes can then be registered and attached to the
   Target description.

 - Registration for normal Targets will be done via the initialization functions
   instead of using static constructors.

 - This allows clients to use a single interface to obtain target data, without
   requiring the code generator be linked in. It also provides a natural
   extension point for adding new optional target data (assembler parser,
   disassembler, etc.).

 - This also provides a new entry point for obtaining a target for a particular
   triple (without a module).

 - Not yet used, however this should eventually replace the TargetMachineRegistry.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75739 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 04:24:58 +00:00
Chris Lattner
4fb63d088b fix an arm codegen bug (the same as PR4482 on ppc) where available_externally
symbols were not getting stubs.  While I'm at it, add a big testcase for
stub generation to make sure I don't break anything.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75737 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 04:12:33 +00:00
Chris Lattner
0a2385455b convert [Hidden]GVNonLazyPtrs to compute the global and stub names
with the mangler (like x86 and ppc), instead of going through 
printSuffixedName.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 03:12:43 +00:00
Chris Lattner
f813d7d7ef use makeNameProper to add the globalprefix instead of doing it manually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75734 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 03:01:23 +00:00
Chris Lattner
392db3e11d get the PPC stub temporary label from the mangler instead of
using horrible string hacking.  This gives us a different label,
but it's just an assembler temporary, so the name doesn't matter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75733 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 02:56:53 +00:00
Chris Lattner
1a87c05ec0 turn some if/then's into ?:
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75732 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 02:36:21 +00:00
Chris Lattner
defd3000dc eliminate a bunch of printSuffixedName's by using info computed from
Mangler in FnStubs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75731 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 02:33:19 +00:00
Chris Lattner
9ec8facd10 convert FnStubs to using a more structured form, eliminating
a couple instances of printSuffixedName (in favor of having
the mangler do stuff).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 02:28:57 +00:00
Chris Lattner
b7b179ead9 actually $stub labels *are* private, I just missed that
printSuffixedName automatically does this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 01:53:36 +00:00
Dan Gohman
5668cf77a7 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75723 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 01:26:32 +00:00
Dan Gohman
bdc017edac Make makeLoopInvariant report whether it made any changes or not,
and use this to simplify more code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75722 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 01:25:43 +00:00
Chris Lattner
2e2ad51ffd $stub references should not be private ("L") labels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75721 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 01:23:13 +00:00
Chris Lattner
0f6c8f25aa simplify "EmitExternalGlobal": it is only used to output a
reference to the personality function for a module, and
those are all added to the GVStubs array by looping
over MMI->getPersonalities()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75720 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 01:16:38 +00:00
Chris Lattner
8f831cbf0d Convert GVStubs and HiddenGVStubs to work more like the X86 backend, this
eliminates a bunch of uses of "printSuffixedName" and "getGlobalLinkName".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75719 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 01:14:44 +00:00
Chris Lattner
ea56f109db minor cleanups: only switch sections once before all function stubs, instead of
before each one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75718 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 00:55:58 +00:00
Kevin Enderby
1f049b24c7 Added llvm-mc support for parsing the .include directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 23:21:55 +00:00
Chris Lattner
1f318e00ba minor syntax cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 23:14:10 +00:00
Owen Anderson
9adc0abad3 Move EVER MORE stuff over to LLVMContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 23:09:55 +00:00
Daniel Dunbar
a89b7ea9d6 Fix path name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75697 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 22:58:03 +00:00
Bruno Cardoso Lopes
f6fbad15f7 Use the right relocation type for X86::MOV64ri64i32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 21:46:40 +00:00
Bob Wilson
8718bc4497 Fix bad indentation and 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75686 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 21:45:58 +00:00
Kevin Enderby
711482476c Added llvm-mc support for parsing the .lsym directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75685 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 21:35:03 +00:00
David Goodwin
4cb73525a9 Check for PRE_INC and POST_INC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75683 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 21:29:29 +00:00
Dan Gohman
0196dc5733 Fix the expansion of umax and smax in the case where one or more of
the operands have pointer type, so that the resulting type matches
the original SCEV type, and so that unnecessary ptrtoints are
avoided in common cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75680 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 20:57:04 +00:00
Ted Kremenek
d84ba34daa Update CMake file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75677 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 20:44:17 +00:00
Chris Lattner
5473f07314 fix David's merge conflict
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75673 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 20:25:40 +00:00
Chris Lattner
9ac7542bab reapply r75408, which eliminates MOV64r0 in favor of using
MOV32r0 + subregs to do the same thing.  This should work now
that PR4544 is fixed.  Thanks Evan!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 20:19:57 +00:00
David Greene
71847813bc Have asm printers use formatted_raw_ostream directly to avoid a
dynamic_cast<>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75670 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 20:18:05 +00:00
Ted Kremenek
2da51dba63 Update CMake file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75666 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 19:46:07 +00:00
David Goodwin
419c615087 hasThumb2() does not mean we are compiling for thumb, must also check isThumb().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75660 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 18:48:51 +00:00
Bob Wilson
3eadf00b46 Remove an extra space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75658 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 18:44:34 +00:00