2012-02-18 12:03:15 +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"
|
2006-03-13 23:20:37 +00:00
|
|
|
#include "PPCISelLowering.h"
|
2012-12-04 07:12:27 +00:00
|
|
|
#include "PPCInstrInfo.h"
|
|
|
|
#include "PPCJITInfo.h"
|
2010-05-11 17:31:57 +00:00
|
|
|
#include "PPCSelectionDAGInfo.h"
|
2012-12-04 07:12:27 +00:00
|
|
|
#include "PPCSubtarget.h"
|
2013-01-02 11:36:10 +00:00
|
|
|
#include "llvm/IR/DataLayout.h"
|
2005-10-14 23:44:05 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2004-08-11 00:09:42 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
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;
|
|
|
|
PPCTargetLowering TLInfo;
|
2010-05-11 17:31:57 +00:00
|
|
|
PPCSelectionDAGInfo TSInfo;
|
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
|
|
|
|
2014-06-12 22:05:46 +00:00
|
|
|
const PPCInstrInfo *getInstrInfo() const override {
|
|
|
|
return getSubtargetImpl()->getInstrInfo();
|
|
|
|
}
|
2014-06-12 20:54:11 +00:00
|
|
|
const PPCFrameLowering *getFrameLowering() const override {
|
|
|
|
return getSubtargetImpl()->getFrameLowering();
|
2011-01-10 12:39:04 +00:00
|
|
|
}
|
2014-06-12 22:28:06 +00:00
|
|
|
PPCJITInfo *getJITInfo() override { return Subtarget.getJITInfo(); }
|
2014-04-29 07:57:37 +00:00
|
|
|
const PPCTargetLowering *getTargetLowering() const override {
|
2010-04-17 15:26:15 +00:00
|
|
|
return &TLInfo;
|
2006-05-12 21:09:57 +00:00
|
|
|
}
|
2014-04-29 07:57:37 +00:00
|
|
|
const PPCSelectionDAGInfo* getSelectionDAGInfo() const override {
|
2010-05-11 17:31:57 +00:00
|
|
|
return &TSInfo;
|
|
|
|
}
|
2014-06-12 22:05:46 +00:00
|
|
|
const PPCRegisterInfo *getRegisterInfo() const override {
|
|
|
|
return &getInstrInfo()->getRegisterInfo();
|
2004-08-17 04:55:41 +00:00
|
|
|
}
|
2012-02-03 05:12:30 +00:00
|
|
|
|
2014-06-12 21:08:06 +00:00
|
|
|
const DataLayout *getDataLayout() const override {
|
|
|
|
return getSubtargetImpl()->getDataLayout();
|
|
|
|
}
|
2014-04-29 07:57:37 +00:00
|
|
|
const PPCSubtarget *getSubtargetImpl() const override { return &Subtarget; }
|
|
|
|
const InstrItineraryData *getInstrItineraryData() const override {
|
2014-06-11 00:53:17 +00:00
|
|
|
return &getSubtargetImpl()->getInstrItineraryData();
|
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
|
2014-04-29 07:57:37 +00:00
|
|
|
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
|
|
|
bool addCodeEmitter(PassManagerBase &PM,
|
|
|
|
JITCodeEmitter &JCE) override;
|
2013-01-25 23:05:59 +00:00
|
|
|
|
|
|
|
/// \brief Register PPC analysis passes with a pass manager.
|
2014-04-29 07:57:37 +00:00
|
|
|
void addAnalysisPasses(PassManagerBase &PM) override;
|
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
|