summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-06-18 21:14:23 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-06-18 21:14:23 +0000
commitcf8c4f5fe475e797f358107a3b751d6834ec5119 (patch)
tree18924efcc8813cf06f6baf4d04dfe64063916795 /llvm/lib/Target/Sparc
parentfbac3ce589f593afc07cd9f747dd85e16d1291e3 (diff)
downloadbcm5719-llvm-cf8c4f5fe475e797f358107a3b751d6834ec5119.tar.gz
bcm5719-llvm-cf8c4f5fe475e797f358107a3b751d6834ec5119.zip
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
Diffstat (limited to 'llvm/lib/Target/Sparc')
-rw-r--r--llvm/lib/Target/Sparc/Sparc.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/llvm/lib/Target/Sparc/Sparc.cpp b/llvm/lib/Target/Sparc/Sparc.cpp
index 8304712bb97..f389f93580e 100644
--- a/llvm/lib/Target/Sparc/Sparc.cpp
+++ b/llvm/lib/Target/Sparc/Sparc.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));
OpenPOWER on IntegriCloud