2005-10-16 05:39:50 +00:00
|
|
|
//===-- PPCTargetMachine.h - Define TargetMachine for PowerPC -----*- C++ -*-=//
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-08-11 00:09:42 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-08-11 00:09:42 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-08-17 04:55:41 +00:00
|
|
|
// This file declares the PowerPC specific subclass of TargetMachine.
|
2004-08-11 00:09:42 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2005-10-16 05:39:50 +00:00
|
|
|
#ifndef PPC_TARGETMACHINE_H
|
|
|
|
#define PPC_TARGETMACHINE_H
|
2004-08-11 00:09:42 +00:00
|
|
|
|
2011-01-10 12:39:04 +00:00
|
|
|
#include "PPCFrameLowering.h"
|
2005-10-14 23:51:18 +00:00
|
|
|
#include "PPCSubtarget.h"
|
2005-10-14 23:53:41 +00:00
|
|
|
#include "PPCJITInfo.h"
|
2005-10-14 23:59:06 +00:00
|
|
|
#include "PPCInstrInfo.h"
|
2006-03-13 23:20:37 +00:00
|
|
|
#include "PPCISelLowering.h"
|
2010-05-11 17:31:57 +00:00
|
|
|
#include "PPCSelectionDAGInfo.h"
|
2005-10-14 23:44:05 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2006-05-12 06:33:49 +00:00
|
|
|
#include "llvm/Target/TargetData.h"
|
2004-08-11 00:09:42 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
2005-10-15 21:58:54 +00:00
|
|
|
class PassManager;
|
2005-10-14 23:44:05 +00:00
|
|
|
class GlobalValue;
|
2004-08-11 00:09:42 +00:00
|
|
|
|
2006-06-16 01:37:27 +00:00
|
|
|
/// PPCTargetMachine - Common code between 32-bit and 64-bit PowerPC targets.
|
|
|
|
///
|
2006-09-04 04:14:57 +00:00
|
|
|
class PPCTargetMachine : public LLVMTargetMachine {
|
2006-06-16 01:37:27 +00:00
|
|
|
PPCSubtarget Subtarget;
|
|
|
|
const TargetData DataLayout; // Calculates type size & alignment
|
|
|
|
PPCInstrInfo InstrInfo;
|
2011-01-10 12:39:04 +00:00
|
|
|
PPCFrameLowering FrameLowering;
|
2006-06-16 01:37:27 +00:00
|
|
|
PPCJITInfo JITInfo;
|
|
|
|
PPCTargetLowering TLInfo;
|
2010-05-11 17:31:57 +00:00
|
|
|
PPCSelectionDAGInfo TSInfo;
|
2006-06-16 01:37:27 +00:00
|
|
|
InstrItineraryData InstrItins;
|
2007-01-24 03:41:36 +00:00
|
|
|
|
2005-10-14 23:44:05 +00:00
|
|
|
public:
|
2011-07-19 06:37:02 +00:00
|
|
|
PPCTargetMachine(const Target &T, StringRef TT,
|
2011-12-02 22:16:29 +00:00
|
|
|
StringRef CPU, StringRef FS, const TargetOptions &Options,
|
2011-11-16 08:38:26 +00:00
|
|
|
Reloc::Model RM, CodeModel::Model CM,
|
|
|
|
CodeGenOpt::Level OL, bool is64Bit);
|
2005-10-16 05:39:50 +00:00
|
|
|
|
2011-01-10 12:39:04 +00:00
|
|
|
virtual const PPCInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
|
|
|
virtual const PPCFrameLowering *getFrameLowering() const {
|
|
|
|
return &FrameLowering;
|
|
|
|
}
|
|
|
|
virtual PPCJITInfo *getJITInfo() { return &JITInfo; }
|
2012-02-03 05:12:30 +00:00
|
|
|
virtual const PPCTargetLowering *getTargetLowering() const {
|
2010-04-17 15:26:15 +00:00
|
|
|
return &TLInfo;
|
2006-05-12 21:09:57 +00:00
|
|
|
}
|
2010-05-11 17:31:57 +00:00
|
|
|
virtual const PPCSelectionDAGInfo* getSelectionDAGInfo() const {
|
|
|
|
return &TSInfo;
|
|
|
|
}
|
2011-01-10 12:39:04 +00:00
|
|
|
virtual const PPCRegisterInfo *getRegisterInfo() const {
|
2004-08-17 04:55:41 +00:00
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
2012-02-03 05:12:30 +00:00
|
|
|
|
2006-06-16 01:37:27 +00:00
|
|
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
|
|
|
virtual const PPCSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
2012-02-03 05:12:30 +00:00
|
|
|
virtual const InstrItineraryData *getInstrItineraryData() const {
|
2010-09-10 01:29:16 +00:00
|
|
|
return &InstrItins;
|
2005-11-01 20:06:59 +00:00
|
|
|
}
|
2008-08-17 13:54:28 +00:00
|
|
|
|
2006-09-04 04:14:57 +00:00
|
|
|
// Pass Pipeline Configuration
|
2012-02-04 02:56:59 +00:00
|
|
|
virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
|
2011-11-16 08:38:26 +00:00
|
|
|
virtual bool addCodeEmitter(PassManagerBase &PM,
|
2009-07-15 22:33:19 +00:00
|
|
|
JITCodeEmitter &JCE);
|
2004-08-11 00:09:42 +00:00
|
|
|
};
|
2006-06-16 01:37:27 +00:00
|
|
|
|
|
|
|
/// PPC32TargetMachine - PowerPC 32-bit target machine.
|
|
|
|
///
|
|
|
|
class PPC32TargetMachine : public PPCTargetMachine {
|
2011-12-20 02:50:00 +00:00
|
|
|
virtual void anchor();
|
2006-06-16 01:37:27 +00:00
|
|
|
public:
|
2011-07-19 06:37:02 +00:00
|
|
|
PPC32TargetMachine(const Target &T, StringRef TT,
|
2011-12-02 22:16:29 +00:00
|
|
|
StringRef CPU, StringRef FS, const TargetOptions &Options,
|
2011-11-16 08:38:26 +00:00
|
|
|
Reloc::Model RM, CodeModel::Model CM,
|
|
|
|
CodeGenOpt::Level OL);
|
2006-06-16 01:37:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/// PPC64TargetMachine - PowerPC 64-bit target machine.
|
|
|
|
///
|
|
|
|
class PPC64TargetMachine : public PPCTargetMachine {
|
2011-12-20 02:50:00 +00:00
|
|
|
virtual void anchor();
|
2006-06-16 01:37:27 +00:00
|
|
|
public:
|
2011-07-19 06:37:02 +00:00
|
|
|
PPC64TargetMachine(const Target &T, StringRef TT,
|
2011-12-02 22:16:29 +00:00
|
|
|
StringRef CPU, StringRef FS, const TargetOptions &Options,
|
2011-11-16 08:38:26 +00:00
|
|
|
Reloc::Model RM, CodeModel::Model CM,
|
|
|
|
CodeGenOpt::Level OL);
|
2006-06-16 01:37:27 +00:00
|
|
|
};
|
|
|
|
|
2004-08-11 00:09:42 +00:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|