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