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

461 Commits

Author SHA1 Message Date
Dan Gohman
ed398abb31 Make llc opt into the addPassesToEmitFile verify pass.
llvm-svn: 97502
2010-03-01 21:45:21 +00:00
Chris Lattner
e8811c3222 change addPassesToEmitFile to return true on failure instead of its input,
add -filetype=null for performance testing and remove -filetype=dynlib,
which isn't planned to be implemented.

llvm-svn: 95202
2010-02-03 05:55:08 +00:00
Chris Lattner
78f57ac8dc Hook up -filetype=obj through the MachO streamer. Here's a demo:
$ cat t.ll 
@g = global i32 42
$ llc t.ll -o t.o -filetype=obj
$ nm t.o
00000000 D _g

There is still a ton of work left.  Instructions are not being encoded
yet apparently.

llvm-svn: 95162
2010-02-02 23:57:42 +00:00
Chris Lattner
7dd4ad3ced Remove a bunch of stuff around the edges of the ELF writer.
Now the only use of the ELF writer is the JIT, which won't be
easy to fix in the short term. :( :(

llvm-svn: 95148
2010-02-02 22:31:11 +00:00
Chris Lattner
7d162688a9 eliminate FileModel::Model, just use CodeGenFileType. The client
of the code generator shouldn't care what object format a target
uses.

llvm-svn: 95124
2010-02-02 21:06:45 +00:00
Chris Lattner
ff8ba8fc79 eliminate all forms of addPassesToEmitMachineCode except
the one used by the JIT.  Remove all forms of
addPassesToEmitFileFinish except the one used by the static
code generator.  Inline the remaining version of
addPassesToEmitFileFinish into its only caller.

llvm-svn: 95109
2010-02-02 19:14:27 +00:00
Nate Begeman
4d489ea053 Kill the Mach-O writer, and temporarily make filetype=obj an error.
The MCStreamer based assemblers will take over for this functionality.

llvm-svn: 95033
2010-02-01 23:56:58 +00:00
Jeffrey Yasskin
fb10587e50 Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods.  The bindings to
other languages still use the ModuleProvider concept.  It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.

llvm-svn: 94686
2010-01-27 20:34:15 +00:00
Nate Begeman
b6c8d75f62 Hook up llc's -filetype=obj to use MCStreamer if an MCCodeEmitter is available.
Remove most of old Mach-O Writer support, it has been replaced by MCMachOStreamer

Further refactoring to completely remove MachOWriter and drive the object file
writer with the AsmPrinter MCInst/MCSection logic is forthcoming.

llvm-svn: 93527
2010-01-15 18:51:18 +00:00
David Greene
a9aa7f2e15 Enable debug buffering.
llvm-svn: 92666
2010-01-05 01:30:21 +00:00
Evan Cheng
96e3c797d1 Add a CodeGenOpt::Less level to match -O1. It'll be used by clients which do not want post-regalloc scheduling.
llvm-svn: 84272
2009-10-16 21:02:20 +00:00
Dan Gohman
f289d3a1c9 Now that llc can read .ll files directly, teach it to recognize .ll as
an extension, so that the default output filename for foo.ll is foo.s,
not foo.ll.s

llvm-svn: 82071
2009-09-16 19:18:41 +00:00
Daniel Dunbar
92d6efefb4 Tweak comment.
llvm-svn: 80891
2009-09-03 05:47:22 +00:00
Dan Gohman
6ebdbf7f07 Switch llc from ParseBitcodeFile to ParseIRFile. This lets llc
transparently read either LLVM Assembly or LLVM Bitcode files.

llvm-svn: 80829
2009-09-02 19:35:19 +00:00
Dan Gohman
5f0f402eab Delete some unnecessary flushes.
llvm-svn: 80013
2009-08-25 17:48:17 +00:00
Dan Gohman
53f0d68f87 Make LLVM command-line tools overwrite their output files without -f.
This is conventional command-line tool behavior. -f now just means
"enable binary output on terminals".

Add a -f option to llvm-extract and llvm-link, for consistency.

Remove F_Force from raw_fd_ostream and enable overwriting and
truncating by default. Introduce an F_Excl flag to permit users to
enable a failure when the file already exists. This flag is
currently unused.

Update Makefiles and documentation accordingly.

llvm-svn: 79990
2009-08-25 15:34:52 +00:00
Chris Lattner
f16d8ade4f Change raw_fd_ostream to take flags as an optional bitmask
instead of as two bools.  Use this to add a F_Append flag
which has the obvious behavior.

Other unrelated changes conflated into this patch:

1. REmove EH stuff from llvm-dis and llvm-as, the try blocks
   are dead.
2. Simplify the filename inference code in llvm-as/llvm-dis,
   because raw_fd_ostream does the right thing with '-'.
3. Switch machine verifier to use raw_ostream instead of ostream
   (Which is the thing that needed append in the first place).

llvm-svn: 79807
2009-08-23 02:51:22 +00:00
Daniel Dunbar
85d2406691 No really, it's unused.
llvm-svn: 78047
2009-08-04 04:08:40 +00:00
Daniel Dunbar
a96d5b360b Provide target data from the module if the target machine doesn't have any.
llvm-svn: 77973
2009-08-03 17:34:19 +00:00
Daniel Dunbar
2781e4bd89 Remove now unused arguments from TargetRegistry::lookupTarget.
llvm-svn: 77950
2009-08-03 04:20:57 +00:00
Daniel Dunbar
775da1948b Pass target triple string in to TargetMachine constructor.
This is not just a matter of passing in the target triple from the module;
currently backends are making decisions based on the build and host
architecture. The goal is to migrate to making these decisions based off of the
triple (in conjunction with the feature string). Thus most clients pass in the
target triple, or the host triple if that is empty.

This has one important change in the way behavior of the JIT and llc.

For the JIT, it was previously selecting the Target based on the host
(naturally), but it was setting the target machine features based on the triple
from the module. Now it is setting the target machine features based on the
triple of the host.

For LLC, -march was previously only used to select the target, the target
machine features were initialized from the module's triple (which may have been
empty). Now the target triple is taken from the module, or the host's triple is
used if that is empty. Then the triple is adjusted to match -march.

The take away is that -march for llc is now used in conjunction with the host
triple to initialize the subtarget. If users want more deterministic behavior
from llc, they should use -mtriple, or set the triple in the input module.

llvm-svn: 77946
2009-08-03 04:03:51 +00:00
Daniel Dunbar
62e74f03c7 Add TargetRegistry::lookupTarget.
- This is a simplified mechanism which just looks up a target based on the
   target triple, with a few additional flags.

 - Remove getClosestStaticTargetForModule, the moral equivalent is now:
     lookupTarget(Mod->getTargetTriple, true, false, ...);

 - This no longer does the fuzzy matching with target data (based on endianness
   and pointer width) that getClosestStaticTargetForModule was doing, but this
   was deemed unnecessary.

llvm-svn: 77111
2009-07-26 02:12:58 +00:00
Daniel Dunbar
a567c0f537 Switch llc and createJIT to use simpler command line parsing for -march.
llvm-svn: 75890
2009-07-16 02:23:53 +00:00
Daniel Dunbar
f9b1d883dd Make sure targets are initialized before we do anything, even command line
processing.

llvm-svn: 75888
2009-07-16 02:04:54 +00:00
Owen Anderson
5c64fb5a80 To simplify the upcoming context-on-type change, switch all command line tools to using the default global context for now.
This will let us to hardwire stuff to the global context in the short term while the API is sorted out.

llvm-svn: 75846
2009-07-15 22:16:10 +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
Dan Gohman
9ced780576 Add a Force option to raw_fd_ostream to specify whether opening
an existing file is considered an error. Convert several tools
to use raw_fd_ostream instead of std::ostream, and to use this
new option instead of doing a manual check.

llvm-svn: 75801
2009-07-15 17:29:42 +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
Dan Gohman
60dce4c56b Use errs() instead of std::cerr.
llvm-svn: 75791
2009-07-15 16:35:29 +00:00
Daniel Dunbar
1d5b4e20c9 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...

llvm-svn: 75773
2009-07-15 11:36:15 +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
Bruno Cardoso Lopes
38373542a1 Add the Object Code Emitter class. Original patch by Aaron Gray, I did some
cleanup, removed some #includes and moved Object Code Emitter out-of-line.

llvm-svn: 74813
2009-07-06 05:09:34 +00:00
Owen Anderson
cf112e59c3 Hold the LLVMContext by reference rather than by pointer.
llvm-svn: 74640
2009-07-01 21:22:36 +00:00
Owen Anderson
81b8dabb53 Add a pointer to the owning LLVMContext to Module. This requires threading LLVMContext through a lot
of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools.

Patches for Clang and LLVM-GCC to follow.

llvm-svn: 74614
2009-07-01 16:58:40 +00:00
Chris Lattner
be0596427d switch to using llvm/Target/TargetSelect.h
llvm-svn: 73611
2009-06-17 16:42:19 +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
Devang Patel
8d170194e8 Add new function attribute - noimplicitfloat
Update code generator to use this attribute and remove NoImplicitFloat target option.
Update llc to set this attribute when -no-implicit-float command line option is used.

llvm-svn: 72959
2009-06-05 21:57:13 +00:00
Devang Patel
9757e4f9f3 Add new function attribute - noredzone.
Update code generator to use this attribute and remove DisableRedZone target option.
Update llc to set this attribute when -disable-red-zone command line option is used.

llvm-svn: 72894
2009-06-04 22:05:33 +00:00
Evan Cheng
0eb8616e89 Default llc / lli optimization to "Default", which corresponds to -O1 / -O2.
llvm-svn: 70934
2009-05-04 23:05:19 +00:00
Bill Wendling
9a6ed80b64 Remove unused flags.
llvm-svn: 70459
2009-04-30 00:57:51 +00:00
Bill Wendling
4df71cd268 Error out with bad optimization level specified.
llvm-svn: 70449
2009-04-29 23:46:43 +00:00
Bill Wendling
6e33661382 Remove LTO optimization level.
llvm-svn: 70445
2009-04-29 23:40:42 +00:00
Bill Wendling
40a162f75f Instead of passing in an unsigned value for the optimization level, use an enum,
which better identifies what the optimization is doing. And is more flexible for
future uses.

llvm-svn: 70440
2009-04-29 23:29:43 +00:00
Bill Wendling
7546bed590 Second attempt:
Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want to
use the old behavior, the flag is -O0. This change allows for finer-grained
control over which optimizations are run at different -O levels.

Most of this work was pretty mechanical. The majority of the fixes came from
verifying that a "fast" variable wasn't used anymore. The JIT still uses a
"Fast" flag. I'll change the JIT with a follow-up patch.

llvm-svn: 70343
2009-04-29 00:15:41 +00:00
Bill Wendling
ef47ace92f r70270 isn't ready yet. Back this out. Sorry for the noise.
llvm-svn: 70275
2009-04-28 01:04:53 +00:00
Bill Wendling
2799e916c3 Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want to
use the old behavior, the flag is -O0. This change allows for finer-grained
control over which optimizations are run at different -O levels.

Most of this work was pretty mechanical. The majority of the fixes came from
verifying that a "fast" variable wasn't used anymore. The JIT still uses a
"Fast" flag. I'm not 100% sure if it's necessary to change it there...

llvm-svn: 70270
2009-04-28 00:21:31 +00:00
Evan Cheng
129934ea28 CodeGen still defaults to non-verbose asm, but llc now overrides it and default to verbose.
llvm-svn: 67669
2009-03-25 01:48:21 +00:00
Chris Lattner
1b05680d5f Change various llvm utilities to use PrettyStackTraceProgram in
their main routines.  This makes the tools print their argc/argv
commands if they crash.

llvm-svn: 66248
2009-03-06 05:34:10 +00:00
Mikhail Glushenkov
49be18cfc6 Registry.h should not depend on CommandLine.h.
Split Support/Registry.h into two files so that we have less to
recompile every time CommandLine.h is changed.

llvm-svn: 62312
2009-01-16 07:02:28 +00:00
Mikhail Glushenkov
5000223556 Delete trailing whitespace.
llvm-svn: 62307
2009-01-16 06:53:46 +00:00
Misha Brukman
6c8b57ddfa Fix spacing to be uniform for parameters.
llvm-svn: 61528
2008-12-31 17:39:58 +00:00
Daniel Dunbar
a830cb14f3 Add Binary flag to raw_fd_ostream constructor.
Document raw_fd_ostream's treatment of "-".

llvm-svn: 59219
2008-11-13 05:01:07 +00:00
Dan Gohman
9543edc4ef Fix command-line option printing to print two spaces where needed,
instead of requiring all "short description" strings to begin with
two spaces. This makes these strings less mysterious, and it fixes
some cases where short description strings mistakenly did not
begin with two spaces.

llvm-svn: 57521
2008-10-14 20:25:08 +00:00
Dan Gohman
e5a492f261 Don't silently ignore errors when opening output streams.
llvm-svn: 55120
2008-08-21 15:33:45 +00:00
Owen Anderson
2c1d54952b Use raw_ostream throughout the AsmPrinter.
llvm-svn: 55092
2008-08-21 00:14:44 +00:00
Anton Korobeynikov
dd94221bda Link GC metadata printers by default to llc
llvm-svn: 54892
2008-08-17 14:33:01 +00:00
Anton Korobeynikov
193b7db7c7 First step of implementing PR1538: move llvm2cpp logic to new 'target'
llvm-svn: 50189
2008-04-23 22:29:24 +00:00
Dan Gohman
a7040d914f Fix a memory leak in llc.
llvm-svn: 49793
2008-04-16 15:56:26 +00:00
Chris Lattner
309aeb140b remove attributions from tools.
llvm-svn: 45421
2007-12-29 20:44:31 +00:00
Gordon Henriksen
a6050b38d2 Switching TargetMachineRegistry to use the new generic Registry.
llvm-svn: 43094
2007-10-17 21:28:48 +00:00
Dan Gohman
2e8245a376 Move the space in overview output for commands out of each of the
commands and into the common code.

llvm-svn: 42752
2007-10-08 15:45:12 +00:00
Gabor Greif
5f705671e4 Here is the bulk of the sanitizing.
Almost all occurrences of "bytecode" in the sources have been eliminated.

llvm-svn: 37913
2007-07-05 17:07:56 +00:00
Chris Lattner
e24a5def42 use the new MemoryBuffer interfaces to simplify error reporting in clients.
llvm-svn: 36900
2007-05-06 23:45:49 +00:00
Chris Lattner
ad70a3024f switch tools to bitcode from bytecode
llvm-svn: 36872
2007-05-06 09:32:02 +00:00
Chris Lattner
206534649d use an auto_ptr to avoid an explicit delete
llvm-svn: 36850
2007-05-06 05:47:36 +00:00
Chris Lattner
22509133cd add bitcode reading support. Remove EH cruft.
llvm-svn: 36839
2007-05-06 04:55:19 +00:00
Reid Spencer
39f16aef65 For PR1277:
Implement error handling for bytecode parsing.

Patch by Scott Michel.

llvm-svn: 35364
2007-03-26 22:38:01 +00:00
Bill Wendling
9345a73364 The new version of how to add passes to emit files. We explicitly call a
function to add the file writers between calls to add the passes.

llvm-svn: 34035
2007-02-08 01:41:07 +00:00
Chris Lattner
43d0b955a3 push bytecode decompressor out through APIs. Now the bytecode reader
api's look like this:

ModuleProvider *getBytecodeModuleProvider(
  const std::string &Filename,  ///< Name of file to be read
  BCDecompressor_t *BCDC = Compressor::decompressToNewBuffer,
  std::string* ErrMsg = 0,      ///< Optional error message holder
  BytecodeHandler* H = 0        ///< Optional handler for reader events
);

This is ugly, but allows a client to say:

  getBytecodeModuleProvider("foo", 0);

If they do this, there is no dependency on the compression libraries, saving
codesize.

llvm-svn: 34012
2007-02-07 21:41:02 +00:00
Reid Spencer
19af04a142 For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.

llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Chris Lattner
41c5ddb8cb make all llvm tools call llvm_shutdown when they exit, static'ify some stuff.
With this change, I can now move -stats to print when llvm_shutdown is called.

llvm-svn: 32250
2006-12-06 01:18:01 +00:00
Chris Lattner
33c9ddc91d Completely rearchitect the interface between targets and the pass manager.
This pass:

1. Splits TargetMachine into TargetMachine (generic targets, can be implemented
any way, like the CBE) and LLVMTargetMachine (subclass of TM that is used by
things using libcodegen and other support).
2. Instead of having each target fully populate the passmgr for file or JIT
   output, move all this to common code, and give targets hooks they can
   implement.
3. Commonalize the target population stuff between file emission and JIT
   emission.
4. All (native code) codegen stuff now happens in a FunctionPassManager, which
   paves the way for "fast -O0" stuff in the CFE later, and now LLC could
   lazily stream .bc files from disk to use less memory.
5. There are now many fewer #includes and the targets don't depend on the
   scalar xforms or libanalysis anymore (but codegen does).
6. Changing common code generator pass ordering stuff no longer requires
   touching all targets.
7. The JIT now has the option of "-fast" codegen or normal optimized codegen,
   which is now orthogonal to the fact that JIT'ing is being done.

llvm-svn: 30081
2006-09-04 04:14:57 +00:00
Chris Lattner
2ad6ff3f77 Remove use of target::getName()
llvm-svn: 30069
2006-09-03 18:38:30 +00:00
Nate Begeman
ae020ecfa9 Make sure that both non-asm file types are marked as experimental
llvm-svn: 29851
2006-08-23 21:29:52 +00:00
Nate Begeman
1268d6cd46 Initial checkin of the Mach-O emitter. There's plenty of fixmes, but it
does emit linkable .o files in very simple cases.

llvm-svn: 29850
2006-08-23 21:08:52 +00:00
Chris Lattner
c7d664b581 Fix the build on case-sensitive filesystems :(
llvm-svn: 29457
2006-08-01 22:34:35 +00:00
Jim Laskey
b92b14f422 Introducing plugable register allocators and instruction schedulers.
llvm-svn: 29434
2006-08-01 14:21:23 +00:00
Reid Spencer
854aa3ca41 For PR780:
1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o
2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage
3. Make each of the tools with --load options include LinkAllVMCore.h
This should be the last set of changes for this bug and 800.

llvm-svn: 28719
2006-06-07 23:03:13 +00:00
Owen Anderson
29e4d70aed Refactor a bunch of includes so that TargetMachine.h doesn't have to include
TargetData.h.  This should make recompiles a bit faster with my current
TargetData tinkering.

llvm-svn: 28238
2006-05-12 06:33:49 +00:00
Chris Lattner
bf8f91715e Adjust to use proper TargetData copy ctor
llvm-svn: 28112
2006-05-04 21:18:40 +00:00
Owen Anderson
71bc529dfa Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses. This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.
This fixes PR 759.

llvm-svn: 28074
2006-05-03 01:29:57 +00:00
Chris Lattner
8228f79eae Add a warning.
llvm-svn: 27795
2006-04-18 05:31:20 +00:00
Chris Lattner
3d5ca510c9 remove always-null IntrinsicLowering argument.
llvm-svn: 26971
2006-03-23 05:28:02 +00:00
Chris Lattner
28415cda31 Remove dead #include
llvm-svn: 25520
2006-01-23 00:38:14 +00:00
Chris Lattner
685b2eb976 It doesn't make sense to give llc a list of passes on the command line,
LLVM doesn't use it and it can't work anyway.

llvm-svn: 25519
2006-01-23 00:36:05 +00:00
Chris Lattner
0d03087d6d remove unused header
llvm-svn: 25101
2006-01-05 00:21:37 +00:00
Jim Laskey
61138e28ff Applied some recommend changes from sabre. The dominate one beginning "let the
pass manager do it's thing."  Fixes crash when compiling -g files and suppresses
dwarf statements if no debug info is present.

llvm-svn: 25100
2006-01-04 22:28:25 +00:00
Jim Laskey
c8681a0c43 Adding MachineDebugInfo as a immutable pass.
llvm-svn: 25088
2006-01-04 13:42:02 +00:00
Duraid Madina
5bcf91632a don't need this anymore
llvm-svn: 25049
2005-12-30 02:50:44 +00:00
Duraid Madina
c2dd544342 delete file portably
llvm-svn: 25048
2005-12-30 02:47:21 +00:00
Duraid Madina
362af3db08 behold my standards-compliant humps!
llvm-svn: 25033
2005-12-28 05:56:36 +00:00
Duraid Madina
446f8cd8d0 WAKEY WAKEY
llvm-svn: 25032
2005-12-28 05:48:55 +00:00
Chris Lattner
9823998a84 rename option for consistency with -mcpu -mattr etc
llvm-svn: 24734
2005-12-16 05:19:55 +00:00
Chris Lattner
073c670431 provide an option to override the target triple in a module from the command
line.

llvm-svn: 24729
2005-12-16 04:59:57 +00:00
Chris Lattner
6d1e384d01 Add a new -fast option, which generates code quickly.
llvm-svn: 24234
2005-11-08 02:12:17 +00:00
Chris Lattner
21ad999fef Shrinkify to make --help output look better
llvm-svn: 23911
2005-10-23 22:37:13 +00:00
Chris Lattner
455911544a shrinkify the option name a bit
llvm-svn: 23910
2005-10-23 22:35:42 +00:00
Chris Lattner
546641acdd document this as experimental
llvm-svn: 23883
2005-10-22 22:00:45 +00:00
Jim Laskey
1f9c40400c Add help support for -mcpu and -mattr.
llvm-svn: 23222
2005-09-02 19:27:43 +00:00
Jim Laskey
f32ef9a37f 1. Use SubtargetFeatures in llc/lli.
2. Propagate feature "string" to all targets.

3. Implement use of SubtargetFeatures in PowerPCTargetSubtarget.

llvm-svn: 23192
2005-09-01 21:38:21 +00:00
Jeff Cohen
019104459d Keep tabs and trailing spaces out.
llvm-svn: 22565
2005-07-30 18:33:25 +00:00
Reid Spencer
30e43e3126 Run the verifier pass after all the other passes rather than before them.
This catches mistakes in the passes rather than just verifying the bytecode
input to llc.

llvm-svn: 22534
2005-07-28 04:00:49 +00:00
Reid Spencer
db38cd714e Make the verifier pass run (in debug mode) in llc. This adds a sanity check
to llc when debugging. Also allow other passes to be run from llc.
Patch contributed by Michael McCracken.

llvm-svn: 22532
2005-07-28 02:25:30 +00:00
Chris Lattner
879a78ea54 add a new -filetype argument to llc.
llvm-svn: 22287
2005-06-25 03:32:05 +00:00
Chris Lattner
704a543530 minor cleanups, use copy ctor instead of manually doing it.
llvm-svn: 22285
2005-06-25 03:00:34 +00:00
Chris Lattner
c8a5e80f4f refactor this interface
llvm-svn: 22284
2005-06-25 02:50:35 +00:00
Misha Brukman
960a8d47d7 Remove trailing whitespace
llvm-svn: 21428
2005-04-22 00:00:37 +00:00
Reid Spencer
298f85282c For PR351:
* Place a try/catch block around the entire tool to Make sure std::string
  exceptions are caught and printed before exiting the tool.
* Make sure we catch unhandled exceptions at the top level so that we don't
  abort with a useless message but indicate than an unhandled exception was
  generated.

llvm-svn: 19192
2004-12-30 05:36:08 +00:00
Reid Spencer
bbdeb2181d Fix usage of changed function prototype
llvm-svn: 17798
2004-11-14 22:30:54 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Reid Spencer
8cb2484800 The functions in Signal.h are now in the llvm::sys namespace - adjust
llvm-svn: 16091
2004-08-29 19:28:55 +00:00
Misha Brukman
c9bf3b6db9 * Tabs to spaces
* Delete extra blank lines

llvm-svn: 14779
2004-07-12 22:58:07 +00:00
Chris Lattner
0171aec781 Goodbye macro hell, hello nice clean and simple code. This also gives llc
the ability to dynamically load and use targets that are not linked into it
statically.  e.g.:

  llc -load libparisc.so -march=parisc foo.bc -o foo.s

llvm-svn: 14751
2004-07-11 04:03:24 +00:00
Reid Spencer
6d8b0985d1 Add #include <iostream> since Value.h does not include it any more.
llvm-svn: 14623
2004-07-04 12:20:55 +00:00
Chris Lattner
6f0bab5b9d Header file moved
llvm-svn: 13813
2004-05-27 05:41:36 +00:00
Brian Gaeke
f6f76523cb Add a better head-of-file comment.
llvm-svn: 12447
2004-03-16 21:47:20 +00:00
Misha Brukman
34ab36e8c8 SparcV8 removed until it grows up becomes a mature backend.
llvm-svn: 12288
2004-03-11 18:16:33 +00:00
Chris Lattner
ab9a9c4119 Add a hook to run with the V8 target, though it doesn't currently work. Also
mark the PPC backend as experimental

llvm-svn: 11962
2004-02-28 19:55:16 +00:00
Brian Gaeke
c6de948cd1 Great renaming part II: Sparc --> SparcV9 (also includes command-line options and Makefiles)
llvm-svn: 11827
2004-02-25 19:08:12 +00:00
Chris Lattner
3c9511b0ac Make sure to print a stack trace whenever an error signal is delivered to
the tool.

llvm-svn: 11633
2004-02-19 20:32:39 +00:00
Chris Lattner
81eae02a9e When the user runs 'llc foo.bc -march=c', write the output to "foo.cbe.c", not
to "foo.s".

llvm-svn: 11485
2004-02-15 22:54:19 +00:00
Chris Lattner
5a793ef4b5 Add support for -march=c
llvm-svn: 11410
2004-02-13 23:19:09 +00:00
Brian Gaeke
e3e4d098e1 Add a -march=powerpc option. Automatically select it if this looks like a
big-endian, 32-bit module, or if __ppc__, __POWERPC__, or __APPLE__ are
defined.

llvm-svn: 11075
2004-02-02 19:06:12 +00:00
Chris Lattner
2a1a75c9aa Pass extra arguments around n stuph
llvm-svn: 10631
2003-12-28 09:51:04 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell
569fd0bb5c Removed extraneous comment line.
llvm-svn: 9308
2003-10-20 20:40:30 +00:00
John Criswell
d06dc1136b Added copyright header to all C++ source files.
llvm-svn: 9291
2003-10-20 17:47:21 +00:00
Misha Brukman
e63af2ec7e Fix grammar.
llvm-svn: 9026
2003-10-10 17:56:49 +00:00
John Criswell
65e849241f Added code to avoid checking for .bc when the filename is too short.
llvm-svn: 8190
2003-08-28 21:42:29 +00:00
Chris Lattner
f1f637aac9 Targets now configure themselves with the module, not flags
llvm-svn: 8133
2003-08-24 19:50:12 +00:00
Chris Lattner
98320af078 Add support for modules with "any" pointersize/endianness
llvm-svn: 8122
2003-08-24 14:02:14 +00:00
Misha Brukman
6f05e9ea0c Revert change: default architecture is never set, it is guessed from input
bytecode file. This means that LLC on X86 will compile to Sparc assembly given a
64-bit input bytecode file...

llvm-svn: 7419
2003-07-30 15:29:55 +00:00
Misha Brukman
582cf5be31 Initialize the target architecture based on compiler defines, so if compiled on
x86 or Sparc, LLC will automatically default to that platform, no guessing
required. On another platform, it will default to `noarch' and will have to
guess which architecture to compile to.

llvm-svn: 7207
2003-07-18 22:21:40 +00:00
Misha Brukman
543aedd7d0 Fixed indentation.
llvm-svn: 7122
2003-07-07 22:28:42 +00:00
Chris Lattner
85559692cb Minor cleanups
llvm-svn: 6799
2003-06-20 15:49:04 +00:00
Brian Gaeke
667447173d tools/llc/llc.cpp: Make "-o -" work.
llvm-svn: 6780
2003-06-18 21:43:33 +00:00
Brian Gaeke
19420e8daf lib/Target/Sparc/Sparc.cpp:
Move LowerAllocations, PrintFunction, and SymbolStripping passes, and
  the corresponding -disable-strip and -d options, over here to the SPARC
  target-specific bits of llc. Rename -d to -dump-asm.

tools/llc/Makefile:
 Reindent. Add x86 library so that llc compiles again.

tools/llc/llc.cpp:
 Remove support for running arbitrary optimization passes. Use opt instead.
 Remove LowerAllocations, PrintFunction, and SymbolStripping passes, as noted
  above.
 Allow user to select a backend (x86 or SPARC); default to guessing from
  the endianness/pointer size of the input bytecode file.
 Fix typos.
 Delete empty .s file and exit with error status if target does not support
  static compilation.

llvm-svn: 6776
2003-06-18 21:14:23 +00:00
Chris Lattner
a7bf3dea5c Reindent code to match the rest of the file
llvm-svn: 6772
2003-06-18 18:46:08 +00:00
Chris Lattner
dec82c2ca1 Remove duplicate pass
llvm-svn: 6631
2003-06-05 20:51:10 +00:00
Chris Lattner
f8db81aac0 Remove ugly hack (that I put in originally) for building in trace stuff
automatically in LLC

llvm-svn: 6358
2003-05-27 21:23:02 +00:00
Chris Lattner
0316a440a1 Add a new option to disable stripping of bytecode files
llvm-svn: 5969
2003-04-28 03:28:56 +00:00
Chris Lattner
bbe1aba425 Remove two fields from TargetData which are target specific.
llvm-svn: 5963
2003-04-26 20:11:09 +00:00
Chris Lattner
86ff9b94a9 Make sure to copy double alignment as well
llvm-svn: 5936
2003-04-25 06:06:13 +00:00
Chris Lattner
658693c26d Kill using declarations
llvm-svn: 5934
2003-04-25 05:26:11 +00:00
Chris Lattner
5efddeb447 Make sure to add a targetdata instance to the passmanager, and make it match the
one in use by the TargetMachine

llvm-svn: 5931
2003-04-25 05:22:29 +00:00
Chris Lattner
1228ad2415 Remove support for "target data" pass ctors
llvm-svn: 5900
2003-04-24 18:36:41 +00:00
Chris Lattner
bdb65e864f Rename header
llvm-svn: 5283
2003-01-14 22:57:15 +00:00
Chris Lattner
4b2c56d87f Eliminate direct access to TargetData structure
llvm-svn: 5156
2002-12-28 20:00:00 +00:00
Chris Lattner
fcf89885a1 * Privatize the TargetName
llvm-svn: 4418
2002-10-29 21:48:33 +00:00
Chris Lattner
eec571dce8 Allow TargetMachine to refuse static code gen
llvm-svn: 4415
2002-10-29 21:12:46 +00:00
Chris Lattner
7bfce07f26 * Remove explicit strcmp calls
* Rename Sparc.h to TargetMachineImpls.h

llvm-svn: 4406
2002-10-29 20:45:04 +00:00
Chris Lattner
4b838cd6b5 Change LowerAllocations pass to 'require' TargetData instead of it being
passed in.

llvm-svn: 3930
2002-09-25 23:47:49 +00:00
Chris Lattner
1740f763c0 Indent a comment right, add a new one
llvm-svn: 3819
2002-09-19 16:06:28 +00:00
Vikram S. Adve
c1a58ef078 Make all registered optimization passes available to llc.
Eliminate duplicate tracing options and use those defined by the trace passes.
Making the tracing step a module pass that runs before any llc-specific
passes.

llvm-svn: 3753
2002-09-16 16:35:34 +00:00
Misha Brukman
2e598f0092 Function.h is unnecessary when Module.h is included.
llvm-svn: 3716
2002-09-14 03:04:02 +00:00
Chris Lattner
ea9f0c3c4e Print the tool name when an error comes from so that I can tell which
tool of a pipeline is having issues.

llvm-svn: 3167
2002-07-30 21:43:22 +00:00
Chris Lattner
5b4d1e6d6c *** empty log message ***
llvm-svn: 3040
2002-07-23 22:04:43 +00:00
Chris Lattner
99ad379582 *** empty log message ***
llvm-svn: 2985
2002-07-22 02:10:13 +00:00
Chris Lattner
858f3734a1 Strip the symbols out of the bytecode to inflate generated executables less.
llvm-svn: 2811
2002-06-30 16:25:07 +00:00
Anand Shukla
c28bf298bb Changes for 64bit gcc
llvm-svn: 2799
2002-06-25 21:57:48 +00:00
Chris Lattner
dfd421a7df MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2779
2002-06-25 16:13:24 +00:00
Chris Lattner
6b2ba36c18 Fix tracing code support to link in the tracing routines if neccesary.
This is required because trace code can insert calls to functions that
are (now) in an LLVM library, not a native library.

This change makes it easier to use the tracing code because the native
link options don't have to change, and it fits in a lot better with the
LLVM model.

llvm-svn: 2675
2002-05-20 21:20:08 +00:00
Chris Lattner
466c66f47a Merge all include/llvm/Transforms/Scalar/* into a single Scalar.h
llvm-svn: 2538
2002-05-07 20:03:27 +00:00
Chris Lattner
453a66845a Remove unneccesary pass.
llvm-svn: 2421
2002-04-30 20:53:05 +00:00
Chris Lattner
96e0c48175 Eliminate duplicate or unneccesary #include's
llvm-svn: 2397
2002-04-29 17:42:12 +00:00
Chris Lattner
536cf1b13f * Rename MethodPass class to FunctionPass
- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
  - Method is now const
  - It now takes one AnalysisUsage object to fill in instead of 3 vectors
    to fill in
  - Pass's now specify which other passes they _preserve_ not which ones
    they modify (be conservative!)
  - A pass can specify that it preserves all analyses (because it never
    modifies the underlying program)
* s/Method/Function/g in other random places as well

llvm-svn: 2333
2002-04-27 06:56:12 +00:00
Chris Lattner
ded2679ed0 Make sure that there is no case where a signal can occur leaving a partially
written output file.  This is important because crashing testcases often write
part of a file out, and the testing harness decides the file is up-to-date next
time the test is run.

llvm-svn: 2303
2002-04-18 19:55:25 +00:00
Chris Lattner
53b18fe247 s/PrintMethodPass/PrintFunctionPass
llvm-svn: 2182
2002-04-08 22:05:01 +00:00
Chris Lattner
bc15ae64dd Change references to the Method class to be references to the Function
class.  The Method class is obsolete (renamed) and all references to it
are being converted over to Function.

llvm-svn: 2144
2002-04-07 20:49:59 +00:00
Vikram S. Adve
1231c34e04 Rename pass to DecomposeMultiDimRefs.
llvm-svn: 1960
2002-03-24 03:19:54 +00:00
Chris Lattner
5e721a352c * Make all command line arguments static
* Change -trace & -tracem options to use a 3 values enum option
* Change to use new style interface to passes

llvm-svn: 1813
2002-02-26 21:36:53 +00:00
Chris Lattner
4e02006161 * Remove -noasm option. If we're not compiling, what's the point?
* convert over to pass based target backend.  Much cleaner now

llvm-svn: 1665
2002-02-03 23:43:19 +00:00
Chris Lattner
ed11b34f8d Switch over to a model where we compile each method, emit assembly, then free
machineinstr memory before starting on the next method.

llvm-svn: 1659
2002-02-03 07:54:10 +00:00
Chris Lattner
70f03681e8 PassManager is now in its own header file
MethodPass's now cannot be run on external methods

llvm-svn: 1609
2002-01-31 00:46:45 +00:00
Chris Lattner
d4ebfa46da In an amazing fit of stupidity, I flipped the conditional and didn't test
it right.  Sheesh :)

llvm-svn: 1550
2002-01-22 21:07:24 +00:00
Chris Lattner
4cecd63a42 Rename LowerAllocations.h to ChangeAllocations.h since it now contains the
RaiseAllocations pass as well.

llvm-svn: 1525
2002-01-22 01:04:08 +00:00
Chris Lattner
2521ae1011 Implement a more powerful, simpler, pass system. This pass system can figure
out how to run a collection of passes optimially given their behaviors and
charactaristics.

Convert code to use it.

llvm-svn: 1507
2002-01-21 07:31:50 +00:00
Chris Lattner
3dc9a2a61f Changes to build successfully with GCC 3.02
llvm-svn: 1503
2002-01-20 22:54:45 +00:00
Chris Lattner
463cc31132 Create a new #include "Support/..." directory structure to move things
from "llvm/Support/..." that are not llvm dependant.

Move files and fix #includes

llvm-svn: 1400
2001-11-27 00:03:19 +00:00
Chris Lattner
3b77672a36 Remove unneccesary retcode var
llvm-svn: 905
2001-10-18 20:33:21 +00:00
Chris Lattner
80630ae4ed Refactor Assembly/Bytecode writer code into Assembly & bytecode libraries
llvm-svn: 904
2001-10-18 20:32:07 +00:00
Chris Lattner
a5d14f7a24 Bytecode writer is yanked out of Module printer
llvm-svn: 899
2001-10-18 20:06:31 +00:00
Vikram S. Adve
a70aaaf07a Move malloc/free lowering after tracing until lli supports
calls to external malloc/free functions.

llvm-svn: 893
2001-10-18 18:20:20 +00:00
Chris Lattner
236f063966 Only output code if file open is successful
llvm-svn: 890
2001-10-18 17:07:22 +00:00
Vikram S. Adve
6c1fee9a85 Trace code should always be exported just before code generation;
this is not a debugging option.  But we can export it as assembly
instead of bytecode if -debugtrace is specified.

llvm-svn: 889
2001-10-18 13:51:20 +00:00
Chris Lattner
0a383effcc Convert to new simpler, more powerful pass structure
llvm-svn: 882
2001-10-18 05:28:44 +00:00
Chris Lattner
2322c8bab6 Passes return true if they change something, not if they fail
llvm-svn: 869
2001-10-18 01:31:22 +00:00
Chris Lattner
463b90cb78 ConcretePass should not be a templated class!
llvm-svn: 838
2001-10-15 17:47:13 +00:00
Chris Lattner
902a7235a7 Minor cleanups
llvm-svn: 837
2001-10-15 17:41:24 +00:00
Chris Lattner
c8af2adc9f Use the new Pass infrastructure to clean up llc
llvm-svn: 835
2001-10-15 17:30:47 +00:00
Chris Lattner
a68fff6614 Minor code cleanups
llvm-svn: 825
2001-10-15 13:47:13 +00:00
Vikram S. Adve
dc3f0d62c7 *** empty log message ***
llvm-svn: 811
2001-10-14 23:29:28 +00:00
Chris Lattner
96e32057bc MethodTypes take an explicit isVarArg argument
llvm-svn: 782
2001-10-13 07:07:28 +00:00
Chris Lattner
7a83259579 Add hack to get rid of malloc & free instructions for code generation
llvm-svn: 713
2001-10-04 01:40:53 +00:00
Chris Lattner
43647563f5 Add proper support to send output to the right place
llvm-svn: 649
2001-09-19 16:52:09 +00:00
Chris Lattner
d5ca24e73e Emit assembly language from the target...
llvm-svn: 640
2001-09-19 13:56:47 +00:00
Chris Lattner
b28fb4bcf5 C++ gives us auto_ptr's, so we might as well use them. :)
llvm-svn: 629
2001-09-18 17:04:18 +00:00
Vikram S. Adve
ee361e80bc Minor changes.
llvm-svn: 622
2001-09-18 13:10:45 +00:00
Chris Lattner
a0a3946882 Make a new llvm/Target #include directory.
Move files from lib/CodeGen/TargetMachine to lib/Target
Move TargetData.h and TargetMachine.h to Target/{Data.h|Machine.h}
Prepare to split TargetMachine.h into several smaller files

llvm-svn: 566
2001-09-14 05:34:53 +00:00
Chris Lattner
7e70cdb641 Checkin changes to:
1. Clean up the TargetMachine structure.  No more wierd pointers that have to
   be cast around and taken care of by the target.
2. Instruction Scheduling now takes the schedinfo as an argument.  The same
   should be done with the instinfo, it just isn't now.

llvm-svn: 565
2001-09-14 04:32:55 +00:00
Chris Lattner
3e2a85a0e3 This checkin represents some cleanup of the backend, implementing the following things:
1. The TargetMachine structure is free to decide the process a particular target uses to generate code.
2. All of the gooee details of the sparc backend are now localized in the lib/CodeGen/TargetMAchine/Sparc directory.  The Sparc.h file that is globally visible is just a stub.
3. The Sparc.h file that esxists now will dissapear entirely someday when we have multiple backends chosen by a factory of some sort.

llvm-svn: 559
2001-09-14 03:37:52 +00:00
Chris Lattner
f87b8ba9e3 Convert llc driver to standard tool format
llvm-svn: 496
2001-09-07 22:20:50 +00:00
Chris Lattner
df5b2e934f Clean up driver
llvm-svn: 492
2001-09-07 21:26:31 +00:00
Vikram S. Adve
35eed0ce61 Add calls to NormalizeMethod() and to ScheduleInstructionsWithSSA().
llvm-svn: 404
2001-08-28 23:23:14 +00:00
Chris Lattner
3e365b974b CommandLine library cleanup. No longer use getValue/setValue, instead, just treat the commandline
args as the objects they represent and the "right thing" will happen

llvm-svn: 283
2001-07-23 19:27:24 +00:00
Chris Lattner
ff6c44f04f Moved inline/llvm/Tools/* to include/llvm/Support/*
llvm-svn: 279
2001-07-23 17:46:59 +00:00
Chris Lattner
d73669f4c6 Removal of the redundant CompileContext wrapper
llvm-svn: 274
2001-07-23 03:09:03 +00:00
Chris Lattner
f42a7804c8 Large scale changes to implement new command line argument facility
llvm-svn: 272
2001-07-23 02:35:57 +00:00
Chris Lattner
c5758cb574 Privatize LLCOptions. It had no business being visible to the entire
program.

llvm-svn: 267
2001-07-22 04:40:02 +00:00
Chris Lattner
f1a2e3b6bb Renamed include/llvm/Codegen to include/llvm/CodeGen
llvm-svn: 253
2001-07-21 20:58:30 +00:00
Vikram S. Adve
b7ca711494 Driver and options for the llc compiler.
llvm-svn: 234
2001-07-21 12:42:29 +00:00