blob: 35e2518462bedd7a79d81e003b10f291ba469a26 [file] [log] [blame]
Jia Liub22310f2012-02-18 12:03:15 +00001//===-- PPCTargetMachine.h - Define TargetMachine for PowerPC ---*- C++ -*-===//
Misha Brukmanb4402432005-04-21 23:30:14 +00002//
Misha Brukmand022a5a2004-08-11 00:09:42 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukmanb4402432005-04-21 23:30:14 +00007//
Misha Brukmand022a5a2004-08-11 00:09:42 +00008//===----------------------------------------------------------------------===//
Misha Brukmanb4402432005-04-21 23:30:14 +00009//
Misha Brukman116f9272004-08-17 04:55:41 +000010// This file declares the PowerPC specific subclass of TargetMachine.
Misha Brukmand022a5a2004-08-11 00:09:42 +000011//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_POWERPC_PPCTARGETMACHINE_H
15#define LLVM_LIB_TARGET_POWERPC_PPCTARGETMACHINE_H
Misha Brukmand022a5a2004-08-11 00:09:42 +000016
Chandler Carruth802d7552012-12-04 07:12:27 +000017#include "PPCInstrInfo.h"
Chandler Carruth802d7552012-12-04 07:12:27 +000018#include "PPCSubtarget.h"
Chandler Carruth9fb823b2013-01-02 11:36:10 +000019#include "llvm/IR/DataLayout.h"
Chris Lattner2ed745a2005-10-14 23:44:05 +000020#include "llvm/Target/TargetMachine.h"
Misha Brukmand022a5a2004-08-11 00:09:42 +000021
22namespace llvm {
Misha Brukmand022a5a2004-08-11 00:09:42 +000023
Chris Lattner0c4aa142006-06-16 01:37:27 +000024/// PPCTargetMachine - Common code between 32-bit and 64-bit PowerPC targets.
25///
Chris Lattner12e97302006-09-04 04:14:57 +000026class PPCTargetMachine : public LLVMTargetMachine {
Eric Christopher3faf2f12014-10-06 06:45:36 +000027 PPCSubtarget Subtarget;
28
29 mutable StringMap<std::unique_ptr<PPCSubtarget>> SubtargetMap;
Bill Wendling40cb8112007-01-24 03:41:36 +000030
Chris Lattner2ed745a2005-10-14 23:44:05 +000031public:
Evan Cheng2129f592011-07-19 06:37:02 +000032 PPCTargetMachine(const Target &T, StringRef TT,
Nick Lewycky50f02cb2011-12-02 22:16:29 +000033 StringRef CPU, StringRef FS, const TargetOptions &Options,
Evan Chengecb29082011-11-16 08:38:26 +000034 Reloc::Model RM, CodeModel::Model CM,
Eric Christopher3770cf52014-08-09 04:38:56 +000035 CodeGenOpt::Level OL);
Nate Begeman6cca84e2005-10-16 05:39:50 +000036
Eric Christopherd9134482014-08-04 21:25:23 +000037 const PPCSubtarget *getSubtargetImpl() const override { return &Subtarget; }
Eric Christopher3faf2f12014-10-06 06:45:36 +000038 const PPCSubtarget *getSubtargetImpl(const Function &F) const override;
Anton Korobeynikov28dc9d02008-08-17 13:54:28 +000039
Chris Lattner12e97302006-09-04 04:14:57 +000040 // Pass Pipeline Configuration
Craig Topper0d3fa922014-04-29 07:57:37 +000041 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
Hal Finkel4e5ca9e2013-01-25 23:05:59 +000042
43 /// \brief Register PPC analysis passes with a pass manager.
Craig Topper0d3fa922014-04-29 07:57:37 +000044 void addAnalysisPasses(PassManagerBase &PM) override;
Misha Brukmand022a5a2004-08-11 00:09:42 +000045};
Chris Lattner0c4aa142006-06-16 01:37:27 +000046
47/// PPC32TargetMachine - PowerPC 32-bit target machine.
48///
49class PPC32TargetMachine : public PPCTargetMachine {
David Blaikiea379b1812011-12-20 02:50:00 +000050 virtual void anchor();
Chris Lattner0c4aa142006-06-16 01:37:27 +000051public:
Evan Cheng2129f592011-07-19 06:37:02 +000052 PPC32TargetMachine(const Target &T, StringRef TT,
Nick Lewycky50f02cb2011-12-02 22:16:29 +000053 StringRef CPU, StringRef FS, const TargetOptions &Options,
Evan Chengecb29082011-11-16 08:38:26 +000054 Reloc::Model RM, CodeModel::Model CM,
55 CodeGenOpt::Level OL);
Chris Lattner0c4aa142006-06-16 01:37:27 +000056};
57
58/// PPC64TargetMachine - PowerPC 64-bit target machine.
59///
60class PPC64TargetMachine : public PPCTargetMachine {
David Blaikiea379b1812011-12-20 02:50:00 +000061 virtual void anchor();
Chris Lattner0c4aa142006-06-16 01:37:27 +000062public:
Evan Cheng2129f592011-07-19 06:37:02 +000063 PPC64TargetMachine(const Target &T, StringRef TT,
Nick Lewycky50f02cb2011-12-02 22:16:29 +000064 StringRef CPU, StringRef FS, const TargetOptions &Options,
Evan Chengecb29082011-11-16 08:38:26 +000065 Reloc::Model RM, CodeModel::Model CM,
66 CodeGenOpt::Level OL);
Chris Lattner0c4aa142006-06-16 01:37:27 +000067};
68
Misha Brukmand022a5a2004-08-11 00:09:42 +000069} // end namespace llvm
70
71#endif