[llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPC.h PowerPCInstrInfo.h PowerPCJITInfo.h PowerPCTargetMachine.cpp PowerPCTargetMachine.h PowerPCAsmPrinter.cpp PowerPCCodeEmitter.cpp PowerPCISelSimple.cpp
Misha Brukman
brukman at cs.uiuc.edu
Tue Aug 10 17:11:36 PDT 2004
Changes in directory llvm/lib/Target/PowerPC:
PowerPC.h updated: 1.4 -> 1.5
PowerPCInstrInfo.h updated: 1.4 -> 1.5
PowerPCJITInfo.h updated: 1.1.1.1 -> 1.2
PowerPCTargetMachine.cpp updated: 1.23 -> 1.24
PowerPCTargetMachine.h updated: 1.3 -> 1.4
PowerPCAsmPrinter.cpp (r1.33) removed
PowerPCCodeEmitter.cpp (r1.2) removed
PowerPCISelSimple.cpp (r1.56) removed
---
Log message:
Breaking up the PowerPC target into 32- and 64-bit subparts, Part III: the rest.
---
Diffs of the changes: (+26 -114)
Index: llvm/lib/Target/PowerPC/PowerPC.h
diff -u llvm/lib/Target/PowerPC/PowerPC.h:1.4 llvm/lib/Target/PowerPC/PowerPC.h:1.5
--- llvm/lib/Target/PowerPC/PowerPC.h:1.4 Mon Aug 9 17:27:45 2004
+++ llvm/lib/Target/PowerPC/PowerPC.h Tue Aug 10 19:11:25 2004
@@ -15,19 +15,13 @@
#ifndef TARGET_POWERPC_H
#define TARGET_POWERPC_H
-#include <iosfwd>
-
namespace llvm {
class FunctionPass;
-class TargetMachine;
-// Here is where you would define factory methods for powerpc-specific
-// passes. For example:
-FunctionPass *createPPCSimpleInstructionSelector(TargetMachine &TM);
-FunctionPass *createPPCAsmPrinterPass(std::ostream &OS, TargetMachine &TM);
FunctionPass *createPowerPCPEI();
FunctionPass *createPPCBranchSelectionPass();
+
} // end namespace llvm;
// Defines symbolic names for PowerPC registers. This defines a mapping from
Index: llvm/lib/Target/PowerPC/PowerPCInstrInfo.h
diff -u llvm/lib/Target/PowerPC/PowerPCInstrInfo.h:1.4 llvm/lib/Target/PowerPC/PowerPCInstrInfo.h:1.5
--- llvm/lib/Target/PowerPC/PowerPCInstrInfo.h:1.4 Tue Aug 10 17:47:03 2004
+++ llvm/lib/Target/PowerPC/PowerPCInstrInfo.h Tue Aug 10 19:11:25 2004
@@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef POWERPCINSTRUCTIONINFO_H
-#define POWERPCINSTRUCTIONINFO_H
+#ifndef POWERPC_INSTRUCTIONINFO_H
+#define POWERPC_INSTRUCTIONINFO_H
#include "PowerPC.h"
#include "PowerPCRegisterInfo.h"
Index: llvm/lib/Target/PowerPC/PowerPCJITInfo.h
diff -u llvm/lib/Target/PowerPC/PowerPCJITInfo.h:1.1.1.1 llvm/lib/Target/PowerPC/PowerPCJITInfo.h:1.2
--- llvm/lib/Target/PowerPC/PowerPCJITInfo.h:1.1.1.1 Mon Jun 21 11:55:26 2004
+++ llvm/lib/Target/PowerPC/PowerPCJITInfo.h Tue Aug 10 19:11:25 2004
@@ -11,16 +11,16 @@
//
//===----------------------------------------------------------------------===//
-#ifndef POWERPCJITINFO_H
-#define POWERPCJITINFO_H
+#ifndef POWERPC_JITINFO_H
+#define POWERPC_JITINFO_H
#include "llvm/Target/TargetJITInfo.h"
namespace llvm {
class TargetMachine;
- class IntrinsicLowering;
class PowerPCJITInfo : public TargetJITInfo {
+ protected:
TargetMachine &TM;
public:
PowerPCJITInfo(TargetMachine &tm) : TM(tm) {}
Index: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp
diff -u llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.23 llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.24
--- llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.23 Mon Aug 9 17:27:45 2004
+++ llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp Tue Aug 10 19:11:25 2004
@@ -23,10 +23,12 @@
#include <iostream>
using namespace llvm;
-namespace {
- // Register the target.
- RegisterTarget<PowerPCTargetMachine> X("powerpc", " PowerPC (experimental)");
-}
+PowerPCTargetMachine::PowerPCTargetMachine(const std::string &name,
+ IntrinsicLowering *IL,
+ const TargetData &TD,
+ const TargetFrameInfo &TFI,
+ const PowerPCJITInfo &TJI)
+ : TargetMachine(name, IL, TD), FrameInfo(TFI), JITInfo(TJI) {}
unsigned PowerPCTargetMachine::getJITMatchQuality() {
#if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)
@@ -35,86 +37,17 @@
return 0;
#endif
}
-
-unsigned PowerPCTargetMachine::getModuleMatchQuality(const Module &M) {
- if (M.getEndianness() == Module::BigEndian &&
- M.getPointerSize() == Module::Pointer32)
- return 10; // Direct match
- else if (M.getEndianness() != Module::AnyEndianness ||
- M.getPointerSize() != Module::AnyPointerSize)
- return 0; // Match for some other target
- return getJITMatchQuality()/2;
+void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
+ assert(0 && "Cannot execute PowerPCJITInfo::addPassesToJITCompile()");
}
-
-/// PowerPCTargetMachine ctor - Create an ILP32 architecture model
-///
-PowerPCTargetMachine::PowerPCTargetMachine(const Module &M,
- IntrinsicLowering *IL)
- : TargetMachine("PowerPC", IL, false, 4, 4, 4, 4, 4, 4, 2, 1, 4),
- FrameInfo(TargetFrameInfo::StackGrowsDown, 16, -4), JITInfo(*this) {
+void PowerPCJITInfo::replaceMachineCodeForFunction(void *Old, void *New) {
+ assert(0 && "Cannot execute PowerPCJITInfo::replaceMachineCodeForFunction()");
}
-/// addPassesToEmitAssembly - Add passes to the specified pass manager
-/// to implement a static compiler for this target.
-///
-bool PowerPCTargetMachine::addPassesToEmitAssembly(PassManager &PM,
- std::ostream &Out) {
- // FIXME: Implement efficient support for garbage collection intrinsics.
- PM.add(createLowerGCPass());
-
- // FIXME: Implement the invoke/unwind instructions!
- PM.add(createLowerInvokePass());
-
- // FIXME: Implement the switch instruction in the instruction selector!
- PM.add(createLowerSwitchPass());
-
- PM.add(createLowerConstantExpressionsPass());
-
- // Make sure that no unreachable blocks are instruction selected.
- PM.add(createUnreachableBlockEliminationPass());
-
- PM.add(createPPCSimpleInstructionSelector(*this));
-
- if (PrintMachineCode)
- PM.add(createMachineFunctionPrinterPass(&std::cerr));
-
- PM.add(createRegisterAllocator());
-
- if (PrintMachineCode)
- PM.add(createMachineFunctionPrinterPass(&std::cerr));
-
- // I want a PowerPC specific prolog/epilog code inserter so I can put the
- // fills/spills in the right spots.
- PM.add(createPowerPCPEI());
-
- // Must run branch selection immediately preceding the printer
- PM.add(createPPCBranchSelectionPass());
- PM.add(createPPCAsmPrinterPass(Out, *this));
- PM.add(createMachineCodeDeleter());
- return false;
-}
-
-/// addPassesToJITCompile - Add passes to the specified pass manager to
-/// implement a fast dynamic compiler for this target.
-///
-void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
- // FIXME: Implement efficient support for garbage collection intrinsics.
- PM.add(createLowerGCPass());
-
- // FIXME: Implement the invoke/unwind instructions!
- PM.add(createLowerInvokePass());
-
- // FIXME: Implement the switch instruction in the instruction selector!
- PM.add(createLowerSwitchPass());
-
- PM.add(createLowerConstantExpressionsPass());
-
- // Make sure that no unreachable blocks are instruction selected.
- PM.add(createUnreachableBlockEliminationPass());
-
- PM.add(createPPCSimpleInstructionSelector(TM));
- PM.add(createRegisterAllocator());
- PM.add(createPrologEpilogCodeInserter());
+void *PowerPCJITInfo::getJITStubForFunction(Function *F,
+ MachineCodeEmitter &MCE) {
+ assert(0 && "Cannot execute PowerPCJITInfo::getJITStubForFunction()");
+ return 0;
}
Index: llvm/lib/Target/PowerPC/PowerPCTargetMachine.h
diff -u llvm/lib/Target/PowerPC/PowerPCTargetMachine.h:1.3 llvm/lib/Target/PowerPC/PowerPCTargetMachine.h:1.4
--- llvm/lib/Target/PowerPC/PowerPCTargetMachine.h:1.3 Fri Jul 23 11:08:20 2004
+++ llvm/lib/Target/PowerPC/PowerPCTargetMachine.h Tue Aug 10 19:11:25 2004
@@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef POWERPCTARGETMACHINE_H
-#define POWERPCTARGETMACHINE_H
+#ifndef POWERPC_TARGETMACHINE_H
+#define POWERPC_TARGETMACHINE_H
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetFrameInfo.h"
@@ -31,9 +31,11 @@
TargetFrameInfo FrameInfo;
PowerPCJITInfo JITInfo;
+protected:
+ PowerPCTargetMachine(const std::string &name, IntrinsicLowering *IL,
+ const TargetData &TD, const TargetFrameInfo &TFI,
+ const PowerPCJITInfo &TJI);
public:
- PowerPCTargetMachine(const Module &M, IntrinsicLowering *IL);
-
virtual const PowerPCInstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
virtual const MRegisterInfo *getRegisterInfo() const {
@@ -43,24 +45,7 @@
return &JITInfo;
}
- /// addPassesToEmitMachineCode - Add passes to the specified pass manager to
- /// get machine code emitted. This uses a MachineCodeEmitter object to handle
- /// actually outputting the machine code and resolving things like the address
- /// of functions. This method should returns true if machine code emission is
- /// not supported.
- ///
- virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
- MachineCodeEmitter &MCE);
-
- virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
-
- static unsigned getModuleMatchQuality(const Module &M);
static unsigned getJITMatchQuality();
-
- // Two shared sets between the instruction selector and the printer allow for
- // correct linkage on Darwin
- std::set<GlobalValue*> CalledFunctions;
- std::set<GlobalValue*> AddressTaken;
};
} // end namespace llvm
More information about the llvm-commits
mailing list