blob: 53cf276a3ef96c0a73ba634e6f02bb23392322f4 [file] [log] [blame]
Chris Lattner7c90f732006-02-05 05:50:24 +00001//===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
Misha Brukmanb5f662f2005-04-21 23:30:14 +00002//
Brian Gaekee785e532004-02-25 19:28:19 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-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 Brukmanb5f662f2005-04-21 23:30:14 +00007//
Brian Gaekee785e532004-02-25 19:28:19 +00008//===----------------------------------------------------------------------===//
Misha Brukmanb5f662f2005-04-21 23:30:14 +00009//
Chris Lattner7c90f732006-02-05 05:50:24 +000010// This file declares the Sparc specific subclass of TargetMachine.
Brian Gaekee785e532004-02-25 19:28:19 +000011//
12//===----------------------------------------------------------------------===//
13
Chris Lattner7c90f732006-02-05 05:50:24 +000014#ifndef SPARCTARGETMACHINE_H
15#define SPARCTARGETMACHINE_H
Brian Gaekee785e532004-02-25 19:28:19 +000016
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000017#include "SparcFrameLowering.h"
Chandler Carrutha1514e22012-12-04 07:12:27 +000018#include "SparcISelLowering.h"
19#include "SparcInstrInfo.h"
Anton Korobeynikov33464912010-11-15 00:06:54 +000020#include "SparcSelectionDAGInfo.h"
21#include "SparcSubtarget.h"
Micah Villmow3574eca2012-10-08 16:38:25 +000022#include "llvm/DataLayout.h"
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000023#include "llvm/Target/TargetFrameLowering.h"
Chandler Carrutha1514e22012-12-04 07:12:27 +000024#include "llvm/Target/TargetMachine.h"
Nadav Rotemcbd9a192012-10-18 23:22:48 +000025#include "llvm/Target/TargetTransformImpl.h"
Brian Gaekee785e532004-02-25 19:28:19 +000026
27namespace llvm {
28
Chris Lattner1911fd42006-09-04 04:14:57 +000029class SparcTargetMachine : public LLVMTargetMachine {
Chris Lattner7c90f732006-02-05 05:50:24 +000030 SparcSubtarget Subtarget;
Micah Villmow3574eca2012-10-08 16:38:25 +000031 const DataLayout DL; // Calculates type size & alignment
Jakob Stoklund Olesened277f32012-05-04 02:16:39 +000032 SparcInstrInfo InstrInfo;
Dan Gohmanda8ac5f2008-10-03 16:55:19 +000033 SparcTargetLowering TLInfo;
Dan Gohmanff7a5622010-05-11 17:31:57 +000034 SparcSelectionDAGInfo TSInfo;
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000035 SparcFrameLowering FrameLowering;
Nadav Rotemcbd9a192012-10-18 23:22:48 +000036 ScalarTargetTransformImpl STTI;
37 VectorTargetTransformImpl VTTI;
Brian Gaekee785e532004-02-25 19:28:19 +000038public:
Evan Cheng43966132011-07-19 06:37:02 +000039 SparcTargetMachine(const Target &T, StringRef TT,
Nick Lewycky8a8d4792011-12-02 22:16:29 +000040 StringRef CPU, StringRef FS, const TargetOptions &Options,
Evan Chengb95fc312011-11-16 08:38:26 +000041 Reloc::Model RM, CodeModel::Model CM,
Nick Lewycky8a8d4792011-12-02 22:16:29 +000042 CodeGenOpt::Level OL, bool is64bit);
Brian Gaekee785e532004-02-25 19:28:19 +000043
Chris Lattner7c90f732006-02-05 05:50:24 +000044 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
Anton Korobeynikov16c29b52011-01-10 12:39:04 +000045 virtual const TargetFrameLowering *getFrameLowering() const {
46 return &FrameLowering;
47 }
Dan Gohmanc9f5f3f2008-05-14 01:58:56 +000048 virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; }
49 virtual const SparcRegisterInfo *getRegisterInfo() const {
Brian Gaekee785e532004-02-25 19:28:19 +000050 return &InstrInfo.getRegisterInfo();
51 }
Dan Gohmand858e902010-04-17 15:26:15 +000052 virtual const SparcTargetLowering* getTargetLowering() const {
53 return &TLInfo;
Dan Gohmanda8ac5f2008-10-03 16:55:19 +000054 }
Dan Gohmanff7a5622010-05-11 17:31:57 +000055 virtual const SparcSelectionDAGInfo* getSelectionDAGInfo() const {
56 return &TSInfo;
57 }
Nadav Rotemcbd9a192012-10-18 23:22:48 +000058 virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const {
59 return &STTI;
60 }
61 virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const {
62 return &VTTI;
63 }
Micah Villmow3574eca2012-10-08 16:38:25 +000064 virtual const DataLayout *getDataLayout() const { return &DL; }
Misha Brukmanb5f662f2005-04-21 23:30:14 +000065
Chris Lattner1911fd42006-09-04 04:14:57 +000066 // Pass Pipeline Configuration
Andrew Trick061efcf2012-02-04 02:56:59 +000067 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
Brian Gaekee785e532004-02-25 19:28:19 +000068};
69
Chris Lattner87c06d62010-02-04 06:34:01 +000070/// SparcV8TargetMachine - Sparc 32-bit target machine
71///
72class SparcV8TargetMachine : public SparcTargetMachine {
David Blaikie2d24e2a2011-12-20 02:50:00 +000073 virtual void anchor();
Chris Lattner87c06d62010-02-04 06:34:01 +000074public:
Evan Cheng43966132011-07-19 06:37:02 +000075 SparcV8TargetMachine(const Target &T, StringRef TT,
Evan Cheng34ad6db2011-07-20 07:51:56 +000076 StringRef CPU, StringRef FS,
Nick Lewycky8a8d4792011-12-02 22:16:29 +000077 const TargetOptions &Options,
Evan Chengb95fc312011-11-16 08:38:26 +000078 Reloc::Model RM, CodeModel::Model CM,
79 CodeGenOpt::Level OL);
Chris Lattner87c06d62010-02-04 06:34:01 +000080};
81
82/// SparcV9TargetMachine - Sparc 64-bit target machine
83///
84class SparcV9TargetMachine : public SparcTargetMachine {
David Blaikie2d24e2a2011-12-20 02:50:00 +000085 virtual void anchor();
Chris Lattner87c06d62010-02-04 06:34:01 +000086public:
Evan Cheng43966132011-07-19 06:37:02 +000087 SparcV9TargetMachine(const Target &T, StringRef TT,
Evan Cheng34ad6db2011-07-20 07:51:56 +000088 StringRef CPU, StringRef FS,
Nick Lewycky8a8d4792011-12-02 22:16:29 +000089 const TargetOptions &Options,
Evan Chengb95fc312011-11-16 08:38:26 +000090 Reloc::Model RM, CodeModel::Model CM,
91 CodeGenOpt::Level OL);
Chris Lattner87c06d62010-02-04 06:34:01 +000092};
93
Brian Gaekee785e532004-02-25 19:28:19 +000094} // end namespace llvm
95
96#endif