aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/SparcV9/SparcV9TargetMachine.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-14 04:32:55 +0000
committerChris Lattner <sabre@nondot.org>2001-09-14 04:32:55 +0000
commitf6e0e2813526b4ebea473427ea5ffd88bb1559ac (patch)
tree56d0246effc4225ae9f25a1fa799f52866c88bdb /lib/Target/SparcV9/SparcV9TargetMachine.cpp
parent69db8da0235bf6fe862de9b2b8852b73d664051b (diff)
downloadexternal_llvm-f6e0e2813526b4ebea473427ea5ffd88bb1559ac.zip
external_llvm-f6e0e2813526b4ebea473427ea5ffd88bb1559ac.tar.gz
external_llvm-f6e0e2813526b4ebea473427ea5ffd88bb1559ac.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@565 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SparcV9/SparcV9TargetMachine.cpp')
-rw-r--r--lib/Target/SparcV9/SparcV9TargetMachine.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/Target/SparcV9/SparcV9TargetMachine.cpp b/lib/Target/SparcV9/SparcV9TargetMachine.cpp
index 80de2e7..cf09734 100644
--- a/lib/Target/SparcV9/SparcV9TargetMachine.cpp
+++ b/lib/Target/SparcV9/SparcV9TargetMachine.cpp
@@ -8,6 +8,7 @@
// 7/15/01 - Vikram Adve - Created
//**************************************************************************/
+#include "llvm/CodeGen/Sparc.h"
#include "SparcInternals.h"
#include "llvm/Method.h"
#include "llvm/CodeGen/InstrScheduling.h"
@@ -91,22 +92,14 @@ UltraSparcSchedInfo::initializeResources()
//
//---------------------------------------------------------------------------
-UltraSparc::UltraSparc() : TargetMachine("UltraSparc-Native") {
- machineInstrInfo = new UltraSparcInstrInfo();
- machineSchedInfo = new UltraSparcSchedInfo(machineInstrInfo);
-
+UltraSparc::UltraSparc() : TargetMachine("UltraSparc-Native"),
+ InstSchedulingInfo(&InstInfo) {
optSizeForSubWordData = 4;
minMemOpWordSize = 8;
maxAtomicMemOpWordSize = 8;
zeroRegNum = 0; // %g0 always gives 0 on Sparc
}
-UltraSparc::~UltraSparc() {
- delete (UltraSparcInstrInfo*) machineInstrInfo;
- delete (UltraSparcSchedInfo*) machineSchedInfo;
-}
-
-
bool UltraSparc::compileMethod(Method *M) {
if (SelectInstructionsForMethod(M, *this)) {
cerr << "Instruction selection failed for method " << M->getName()
@@ -114,10 +107,15 @@ bool UltraSparc::compileMethod(Method *M) {
return true;
}
- if (ScheduleInstructionsWithSSA(M, *this)) {
+ if (ScheduleInstructionsWithSSA(M, *this, InstSchedulingInfo)) {
cerr << "Instruction scheduling before allocation failed for method "
<< M->getName() << "\n\n";
return true;
}
return false;
}
+
+// allocateSparcTargetMachine - Allocate and return a subclass of TargetMachine
+// that implements the Sparc backend.
+//
+TargetMachine *allocateSparcTargetMachine() { return new UltraSparc(); }