diff options
| author | Brian Gaeke <gaeke@uiuc.edu> | 2003-06-18 21:14:23 +0000 |
|---|---|---|
| committer | Brian Gaeke <gaeke@uiuc.edu> | 2003-06-18 21:14:23 +0000 |
| commit | 2e2f2dcd6af454a26838457dbfd61ceca7cef41b (patch) | |
| tree | 76522beb024b4814cd54a6a26151c2f9c2820be9 /lib | |
| parent | baed07333f00dc192a33eab9764df466da60daf3 (diff) | |
| download | llvm-2e2f2dcd6af454a26838457dbfd61ceca7cef41b.tar.gz llvm-2e2f2dcd6af454a26838457dbfd61ceca7cef41b.tar.bz2 llvm-2e2f2dcd6af454a26838457dbfd61ceca7cef41b.tar.xz | |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6776 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Target/SparcV9/SparcV9TargetMachine.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/Target/SparcV9/SparcV9TargetMachine.cpp b/lib/Target/SparcV9/SparcV9TargetMachine.cpp index 8304712bb9..f389f93580 100644 --- a/lib/Target/SparcV9/SparcV9TargetMachine.cpp +++ b/lib/Target/SparcV9/SparcV9TargetMachine.cpp @@ -21,6 +21,7 @@ #include "llvm/CodeGen/MachineCodeForInstruction.h" #include "llvm/Reoptimizer/Mapping/MappingInfo.h" #include "Support/CommandLine.h" +#include "llvm/Assembly/PrintModulePass.h" static const unsigned ImplicitRegUseList[] = { 0 }; /* not used yet */ // Build the MachineInstruction Description Array... @@ -46,6 +47,14 @@ static cl::opt<bool> DisableSched("nosched", static cl::opt<bool> DisablePeephole("nopeephole", cl::desc("Disable peephole optimization pass")); +static cl::opt<bool> +DisableStrip("disable-strip", + cl::desc("Do not strip the LLVM bytecode included in the executable")); + +static cl::opt<bool> +DumpAsm("dump-asm", cl::desc("Print bytecode before native code generation"), + cl::Hidden); + //---------------------------------------------------------------------------- // allocateSparcTargetMachine - Allocate and return a subclass of TargetMachine // that implements the Sparc backend. (the llvm/CodeGen/Sparc.h interface) @@ -141,9 +150,21 @@ UltraSparc::UltraSparc() // bool UltraSparc::addPassesToEmitAssembly(PassManager &PM, std::ostream &Out) { + // The following 3 passes used to be inserted specially by llc. + // Replace malloc and free instructions with library calls. + PM.add(createLowerAllocationsPass()); + + // If LLVM dumping after transformations is requested, add it to the pipeline + if (DumpAsm) + PM.add(new PrintFunctionPass("Code after xformations: \n", &std::cerr)); + + // Strip all of the symbols from the bytecode so that it will be smaller... + if (!DisableStrip) + PM.add(createSymbolStrippingPass()); + // FIXME: implement the switch instruction in the instruction selector. PM.add(createLowerSwitchPass()); - + // Construct and initialize the MachineFunction object for this fn. PM.add(createMachineCodeConstructionPass(*this)); |
