blob: c8df44d9f0b2c79479092d8d34a52d7a201b3617 [file] [log] [blame]
Jia Liu9f610112012-02-17 08:55:11 +00001//===-- MipsTargetMachine.cpp - Define TargetMachine for Mips -------------===//
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +00002//
3// 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.
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +00007//
Akira Hatanakae2489122011-04-15 21:51:11 +00008//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +00009//
10// Implements the info about Mips target spec.
11//
Akira Hatanakae2489122011-04-15 21:51:11 +000012//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +000013
Chandler Carruth6bda14b2017-06-06 11:49:48 +000014#include "MipsTargetMachine.h"
Eugene Zelenko926883e2017-02-01 01:22:51 +000015#include "MCTargetDesc/MipsABIInfo.h"
16#include "MCTargetDesc/MipsMCTargetDesc.h"
Craig Topperb25fda92012-03-17 18:46:09 +000017#include "Mips.h"
Chandler Carruth8a8cd2b2014-01-07 11:48:04 +000018#include "Mips16ISelDAGToDAG.h"
Reed Kotler1595f362013-04-09 19:46:01 +000019#include "MipsSEISelDAGToDAG.h"
Eugene Zelenko926883e2017-02-01 01:22:51 +000020#include "MipsSubtarget.h"
Aditya Nandakumara2719322014-11-13 09:26:31 +000021#include "MipsTargetObjectFile.h"
Eugene Zelenko926883e2017-02-01 01:22:51 +000022#include "llvm/ADT/Optional.h"
23#include "llvm/ADT/STLExtras.h"
24#include "llvm/ADT/StringRef.h"
Reed Kotler1595f362013-04-09 19:46:01 +000025#include "llvm/Analysis/TargetTransformInfo.h"
Petar Jovanovicfac93e22018-02-23 11:06:40 +000026#include "llvm/CodeGen/GlobalISel/IRTranslator.h"
27#include "llvm/CodeGen/GlobalISel/Legalizer.h"
28#include "llvm/CodeGen/GlobalISel/RegBankSelect.h"
29#include "llvm/CodeGen/GlobalISel/InstructionSelect.h"
Eugene Zelenko926883e2017-02-01 01:22:51 +000030#include "llvm/CodeGen/BasicTTIImpl.h"
31#include "llvm/CodeGen/MachineFunction.h"
Andrew Trickccb67362012-02-03 05:12:41 +000032#include "llvm/CodeGen/Passes.h"
Matthias Braun31d19d42016-05-10 03:21:59 +000033#include "llvm/CodeGen/TargetPassConfig.h"
Eugene Zelenko926883e2017-02-01 01:22:51 +000034#include "llvm/IR/Attributes.h"
35#include "llvm/IR/Function.h"
36#include "llvm/Support/CodeGen.h"
Reed Kotler1595f362013-04-09 19:46:01 +000037#include "llvm/Support/Debug.h"
Evan Cheng2bb40352011-08-24 18:08:43 +000038#include "llvm/Support/TargetRegistry.h"
Chandler Carruth8a8cd2b2014-01-07 11:48:04 +000039#include "llvm/Support/raw_ostream.h"
Eugene Zelenko926883e2017-02-01 01:22:51 +000040#include "llvm/Target/TargetOptions.h"
41#include <string>
Vasileios Kalintiris6312f512015-03-14 08:34:25 +000042
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +000043using namespace llvm;
44
Chandler Carruthe96dd892014-04-21 22:55:11 +000045#define DEBUG_TYPE "mips"
46
Daniel Dunbar5680b4f2009-07-25 06:49:55 +000047extern "C" void LLVMInitializeMipsTarget() {
48 // Register the target.
Mehdi Aminif42454b2016-10-09 23:00:34 +000049 RegisterTargetMachine<MipsebTargetMachine> X(getTheMipsTarget());
50 RegisterTargetMachine<MipselTargetMachine> Y(getTheMipselTarget());
51 RegisterTargetMachine<MipsebTargetMachine> A(getTheMips64Target());
52 RegisterTargetMachine<MipselTargetMachine> B(getTheMips64elTarget());
Petar Jovanovicfac93e22018-02-23 11:06:40 +000053
54 PassRegistry *PR = PassRegistry::getPassRegistry();
55 initializeGlobalISel(*PR);
Simon Dardisae201082018-05-11 16:13:53 +000056 initializeMipsDelaySlotFillerPass(*PR);
Aleksandar Beserminjia5f75512018-05-22 13:24:38 +000057 initializeMipsBranchExpansionPass(*PR);
Zoran Jovanovic3a7654c2018-06-13 12:51:37 +000058 initializeMicroMipsSizeReducePass(*PR);
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +000059}
60
Daniel Sandersed64d622015-06-11 15:34:59 +000061static std::string computeDataLayout(const Triple &TT, StringRef CPU,
Mehdi Amini93e1ea12015-03-12 00:07:24 +000062 const TargetOptions &Options,
63 bool isLittle) {
Eugene Zelenko926883e2017-02-01 01:22:51 +000064 std::string Ret;
Daniel Sanders50f17232015-09-15 16:17:27 +000065 MipsABIInfo ABI = MipsABIInfo::computeTargetABI(TT, CPU, Options.MCOptions);
Eric Christopher8b770652015-01-26 19:03:15 +000066
67 // There are both little and big endian mips.
68 if (isLittle)
69 Ret += "e";
70 else
71 Ret += "E";
72
Daniel Sanders6a738832016-07-19 10:49:03 +000073 if (ABI.IsO32())
74 Ret += "-m:m";
75 else
76 Ret += "-m:e";
Eric Christopher8b770652015-01-26 19:03:15 +000077
78 // Pointers are 32 bit on some ABIs.
79 if (!ABI.IsN64())
80 Ret += "-p:32:32";
81
Sanjay Pateld4e1bb82015-07-07 21:31:54 +000082 // 8 and 16 bit integers only need to have natural alignment, but try to
Eric Christopher8b770652015-01-26 19:03:15 +000083 // align them to 32 bits. 64 bit integers have natural alignment.
84 Ret += "-i8:8:32-i16:16:32-i64:64";
85
86 // 32 bit registers are always available and the stack is at least 64 bit
87 // aligned. On N64 64 bit registers are also available and the stack is
88 // 128 bit aligned.
89 if (ABI.IsN64() || ABI.IsN32())
90 Ret += "-n32:64-S128";
91 else
92 Ret += "-n32-S64";
93
94 return Ret;
95}
96
Rafael Espindola79e238a2017-08-03 02:16:21 +000097static Reloc::Model getEffectiveRelocModel(bool JIT,
Rafael Espindola8c34dd82016-05-18 22:04:49 +000098 Optional<Reloc::Model> RM) {
Rafael Espindola79e238a2017-08-03 02:16:21 +000099 if (!RM.hasValue() || JIT)
Rafael Espindola8c34dd82016-05-18 22:04:49 +0000100 return Reloc::Static;
101 return *RM;
102}
103
Rafael Espindola79e238a2017-08-03 02:16:21 +0000104static CodeModel::Model getEffectiveCodeModel(Optional<CodeModel::Model> CM) {
105 if (CM)
106 return *CM;
107 return CodeModel::Small;
108}
109
Bruno Cardoso Lopes43318832007-08-28 05:13:42 +0000110// On function prologue, the stack is created by decrementing
111// its pointer. Once decremented, all references are done with positive
Anton Korobeynikovf7183ed2010-11-15 00:06:54 +0000112// offset from the stack/frame pointer, using StackGrowsUp enables
Bruno Cardoso Lopes4659aad2008-08-06 06:14:43 +0000113// an easier handling.
Bruno Cardoso Lopesc9c3f492008-07-05 19:05:21 +0000114// Using CodeModel::Large enables different CALL behavior.
Daniel Sanders3e5de882015-06-11 19:41:26 +0000115MipsTargetMachine::MipsTargetMachine(const Target &T, const Triple &TT,
Eric Christopher4407dde2014-07-02 00:54:07 +0000116 StringRef CPU, StringRef FS,
117 const TargetOptions &Options,
Rafael Espindola8c34dd82016-05-18 22:04:49 +0000118 Optional<Reloc::Model> RM,
Rafael Espindola79e238a2017-08-03 02:16:21 +0000119 Optional<CodeModel::Model> CM,
120 CodeGenOpt::Level OL, bool JIT,
Rafael Espindola8c34dd82016-05-18 22:04:49 +0000121 bool isLittle)
Matthias Braunbb8507e2017-10-12 22:57:28 +0000122 : LLVMTargetMachine(T, computeDataLayout(TT, CPU, Options, isLittle), TT,
123 CPU, FS, Options, getEffectiveRelocModel(JIT, RM),
124 getEffectiveCodeModel(CM), OL),
Eugene Zelenko926883e2017-02-01 01:22:51 +0000125 isLittle(isLittle), TLOF(llvm::make_unique<MipsTargetObjectFile>()),
Daniel Sanders50f17232015-09-15 16:17:27 +0000126 ABI(MipsABIInfo::computeTargetABI(TT, CPU, Options.MCOptions)),
John Baldwin1255b162017-08-14 21:49:38 +0000127 Subtarget(nullptr), DefaultSubtarget(TT, CPU, FS, isLittle, *this,
128 Options.StackAlignmentOverride),
Daniel Sanders3e5de882015-06-11 19:41:26 +0000129 NoMips16Subtarget(TT, CPU, FS.empty() ? "-mips16" : FS.str() + ",-mips16",
John Baldwin1255b162017-08-14 21:49:38 +0000130 isLittle, *this, Options.StackAlignmentOverride),
Daniel Sanders3e5de882015-06-11 19:41:26 +0000131 Mips16Subtarget(TT, CPU, FS.empty() ? "+mips16" : FS.str() + ",+mips16",
John Baldwin1255b162017-08-14 21:49:38 +0000132 isLittle, *this, Options.StackAlignmentOverride) {
Eric Christopher4e7d1e72014-07-18 23:41:32 +0000133 Subtarget = &DefaultSubtarget;
Rafael Espindola227144c2013-05-13 01:16:13 +0000134 initAsmInfo();
Bruno Cardoso Lopes35d86e62007-10-09 03:01:19 +0000135}
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +0000136
Eugene Zelenko926883e2017-02-01 01:22:51 +0000137MipsTargetMachine::~MipsTargetMachine() = default;
Reid Kleckner357600e2014-11-20 23:37:18 +0000138
Eugene Zelenko926883e2017-02-01 01:22:51 +0000139void MipsebTargetMachine::anchor() {}
David Blaikiea379b1812011-12-20 02:50:00 +0000140
Daniel Sanders3e5de882015-06-11 19:41:26 +0000141MipsebTargetMachine::MipsebTargetMachine(const Target &T, const Triple &TT,
142 StringRef CPU, StringRef FS,
143 const TargetOptions &Options,
Rafael Espindola8c34dd82016-05-18 22:04:49 +0000144 Optional<Reloc::Model> RM,
Rafael Espindola79e238a2017-08-03 02:16:21 +0000145 Optional<CodeModel::Model> CM,
146 CodeGenOpt::Level OL, bool JIT)
147 : MipsTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, JIT, false) {}
Akira Hatanaka3d673cc2011-09-21 03:00:58 +0000148
Eugene Zelenko926883e2017-02-01 01:22:51 +0000149void MipselTargetMachine::anchor() {}
David Blaikiea379b1812011-12-20 02:50:00 +0000150
Daniel Sanders3e5de882015-06-11 19:41:26 +0000151MipselTargetMachine::MipselTargetMachine(const Target &T, const Triple &TT,
152 StringRef CPU, StringRef FS,
153 const TargetOptions &Options,
Rafael Espindola8c34dd82016-05-18 22:04:49 +0000154 Optional<Reloc::Model> RM,
Rafael Espindola79e238a2017-08-03 02:16:21 +0000155 Optional<CodeModel::Model> CM,
156 CodeGenOpt::Level OL, bool JIT)
157 : MipsTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, JIT, true) {}
Bruno Cardoso Lopes326a0372008-06-04 01:45:25 +0000158
Eric Christophera9353d12014-09-26 01:44:08 +0000159const MipsSubtarget *
David Majnemerde360752014-09-26 02:57:05 +0000160MipsTargetMachine::getSubtargetImpl(const Function &F) const {
Duncan P. N. Exon Smith2e753142015-02-14 02:37:48 +0000161 Attribute CPUAttr = F.getFnAttribute("target-cpu");
162 Attribute FSAttr = F.getFnAttribute("target-features");
Eric Christophera9353d12014-09-26 01:44:08 +0000163
164 std::string CPU = !CPUAttr.hasAttribute(Attribute::None)
165 ? CPUAttr.getValueAsString().str()
166 : TargetCPU;
167 std::string FS = !FSAttr.hasAttribute(Attribute::None)
168 ? FSAttr.getValueAsString().str()
169 : TargetFS;
170 bool hasMips16Attr =
Duncan P. N. Exon Smith2e753142015-02-14 02:37:48 +0000171 !F.getFnAttribute("mips16").hasAttribute(Attribute::None);
Eric Christophera9353d12014-09-26 01:44:08 +0000172 bool hasNoMips16Attr =
Duncan P. N. Exon Smith2e753142015-02-14 02:37:48 +0000173 !F.getFnAttribute("nomips16").hasAttribute(Attribute::None);
Eric Christophera9353d12014-09-26 01:44:08 +0000174
Simon Atanasyane0b726f2017-05-22 12:47:41 +0000175 bool HasMicroMipsAttr =
176 !F.getFnAttribute("micromips").hasAttribute(Attribute::None);
177 bool HasNoMicroMipsAttr =
178 !F.getFnAttribute("nomicromips").hasAttribute(Attribute::None);
179
Eric Christopher6a0551e2014-09-29 21:57:54 +0000180 // FIXME: This is related to the code below to reset the target options,
181 // we need to know whether or not the soft float flag is set on the
Toma Tabacu506cfd02015-05-07 10:29:52 +0000182 // function, so we can enable it as a subtarget feature.
Eric Christopher824f42f2015-05-12 01:26:05 +0000183 bool softFloat =
184 F.hasFnAttribute("use-soft-float") &&
185 F.getFnAttribute("use-soft-float").getValueAsString() == "true";
Eric Christopher6a0551e2014-09-29 21:57:54 +0000186
Eric Christophera9353d12014-09-26 01:44:08 +0000187 if (hasMips16Attr)
188 FS += FS.empty() ? "+mips16" : ",+mips16";
189 else if (hasNoMips16Attr)
190 FS += FS.empty() ? "-mips16" : ",-mips16";
Simon Atanasyane0b726f2017-05-22 12:47:41 +0000191 if (HasMicroMipsAttr)
192 FS += FS.empty() ? "+micromips" : ",+micromips";
193 else if (HasNoMicroMipsAttr)
194 FS += FS.empty() ? "-micromips" : ",-micromips";
Toma Tabacu506cfd02015-05-07 10:29:52 +0000195 if (softFloat)
196 FS += FS.empty() ? "+soft-float" : ",+soft-float";
Eric Christophera9353d12014-09-26 01:44:08 +0000197
Toma Tabacu506cfd02015-05-07 10:29:52 +0000198 auto &I = SubtargetMap[CPU + FS];
Eric Christophera9353d12014-09-26 01:44:08 +0000199 if (!I) {
200 // This needs to be done before we create a new subtarget since any
201 // creation will depend on the TM and the code generation flags on the
202 // function that reside in TargetOptions.
203 resetTargetOptions(F);
Alexander Richardsoneb5ce8b2017-09-22 08:52:03 +0000204 I = llvm::make_unique<MipsSubtarget>(TargetTriple, CPU, FS, isLittle, *this,
205 Options.StackAlignmentOverride);
Eric Christophera9353d12014-09-26 01:44:08 +0000206 }
207 return I.get();
208}
209
Eric Christopher4e7d1e72014-07-18 23:41:32 +0000210void MipsTargetMachine::resetSubtarget(MachineFunction *MF) {
Nicola Zaghend34e60c2018-05-14 12:53:11 +0000211 LLVM_DEBUG(dbgs() << "resetSubtarget\n");
Eric Christophera9353d12014-09-26 01:44:08 +0000212
Matthias Braunf1caa282017-12-15 22:22:58 +0000213 Subtarget = const_cast<MipsSubtarget *>(getSubtargetImpl(MF->getFunction()));
Eric Christopherfc6de422014-08-05 02:39:49 +0000214 MF->setSubtarget(Subtarget);
Eric Christopher4e7d1e72014-07-18 23:41:32 +0000215}
216
Andrew Trickccb67362012-02-03 05:12:41 +0000217namespace {
Eugene Zelenko926883e2017-02-01 01:22:51 +0000218
Andrew Trickccb67362012-02-03 05:12:41 +0000219/// Mips Code Generator Pass Configuration Options.
220class MipsPassConfig : public TargetPassConfig {
221public:
Matthias Braun5e394c32017-05-30 21:36:41 +0000222 MipsPassConfig(MipsTargetMachine &TM, PassManagerBase &PM)
Alexander Richardsoneb5ce8b2017-09-22 08:52:03 +0000223 : TargetPassConfig(TM, PM) {
Akira Hatanaka3c0d6af2013-10-07 19:13:53 +0000224 // The current implementation of long branch pass requires a scratch
225 // register ($at) to be available before branch instructions. Tail merging
226 // can break this requirement, so disable it when long branch pass is
227 // enabled.
228 EnableTailMerge = !getMipsSubtarget().enableLongBranchPass();
229 }
Andrew Trickccb67362012-02-03 05:12:41 +0000230
231 MipsTargetMachine &getMipsTargetMachine() const {
232 return getTM<MipsTargetMachine>();
233 }
234
235 const MipsSubtarget &getMipsSubtarget() const {
236 return *getMipsTargetMachine().getSubtargetImpl();
237 }
238
Craig Topper56c590a2014-04-29 07:58:02 +0000239 void addIRPasses() override;
240 bool addInstSelector() override;
Matthias Braun7e37a5f2014-12-11 21:26:47 +0000241 void addPreEmitPass() override;
Matthias Braun7e37a5f2014-12-11 21:26:47 +0000242 void addPreRegAlloc() override;
Petar Jovanovicfac93e22018-02-23 11:06:40 +0000243 bool addIRTranslator() override;
244 bool addLegalizeMachineIR() override;
245 bool addRegBankSelect() override;
246 bool addGlobalInstructionSelect() override;
Andrew Trickccb67362012-02-03 05:12:41 +0000247};
Eugene Zelenko926883e2017-02-01 01:22:51 +0000248
249} // end anonymous namespace
Andrew Trickccb67362012-02-03 05:12:41 +0000250
Andrew Trickf8ea1082012-02-04 02:56:59 +0000251TargetPassConfig *MipsTargetMachine::createPassConfig(PassManagerBase &PM) {
Matthias Braun5e394c32017-05-30 21:36:41 +0000252 return new MipsPassConfig(*this, PM);
Andrew Trickccb67362012-02-03 05:12:41 +0000253}
254
Reed Kotlerfe94cc32013-04-10 16:58:04 +0000255void MipsPassConfig::addIRPasses() {
256 TargetPassConfig::addIRPasses();
Francis Visoiu Mistrih8b617642017-05-18 17:21:13 +0000257 addPass(createAtomicExpandPass());
Reed Kotlerfe94cc32013-04-10 16:58:04 +0000258 if (getMipsSubtarget().os16())
Francis Visoiu Mistrih8b617642017-05-18 17:21:13 +0000259 addPass(createMipsOs16Pass());
Reed Kotler783c7942013-05-10 22:25:39 +0000260 if (getMipsSubtarget().inMips16HardFloat())
Francis Visoiu Mistrih8b617642017-05-18 17:21:13 +0000261 addPass(createMips16HardFloatPass());
Reed Kotlerfe94cc32013-04-10 16:58:04 +0000262}
Anton Korobeynikovf7183ed2010-11-15 00:06:54 +0000263// Install an instruction selector pass using
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +0000264// the ISelDag to gen Mips code.
Bill Wendlingb12f16e2012-05-01 08:27:43 +0000265bool MipsPassConfig::addInstSelector() {
Francis Visoiu Mistrih8b617642017-05-18 17:21:13 +0000266 addPass(createMipsModuleISelDagPass());
Daniel Sanders46fe6552016-07-14 13:25:22 +0000267 addPass(createMips16ISelDag(getMipsTargetMachine(), getOptLevel()));
268 addPass(createMipsSEISelDag(getMipsTargetMachine(), getOptLevel()));
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +0000269 return false;
270}
271
Matthias Braun7e37a5f2014-12-11 21:26:47 +0000272void MipsPassConfig::addPreRegAlloc() {
Francis Visoiu Mistrih8b617642017-05-18 17:21:13 +0000273 addPass(createMipsOptimizePICCallPass());
Reed Kotler96b74022014-03-10 16:31:25 +0000274}
275
Sanjoy Das26d11ca2017-12-22 18:21:59 +0000276TargetTransformInfo
277MipsTargetMachine::getTargetTransformInfo(const Function &F) {
278 if (Subtarget->allowMixed16_32()) {
Nicola Zaghend34e60c2018-05-14 12:53:11 +0000279 LLVM_DEBUG(errs() << "No Target Transform Info Pass Added\n");
Sanjoy Das26d11ca2017-12-22 18:21:59 +0000280 // FIXME: This is no longer necessary as the TTI returned is per-function.
281 return TargetTransformInfo(F.getParent()->getDataLayout());
282 }
Chandler Carruth93dcdc42015-01-31 11:17:59 +0000283
Nicola Zaghend34e60c2018-05-14 12:53:11 +0000284 LLVM_DEBUG(errs() << "Target Transform Info Pass Added\n");
Sanjoy Das26d11ca2017-12-22 18:21:59 +0000285 return TargetTransformInfo(BasicTTIImpl(this, F));
Reed Kotler1595f362013-04-09 19:46:01 +0000286}
287
Anton Korobeynikovf7183ed2010-11-15 00:06:54 +0000288// Implemented by targets that want to run passes immediately before
289// machine code is emitted. return true if -print-machineinstrs should
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +0000290// print out the code after the passes.
Matthias Braun7e37a5f2014-12-11 21:26:47 +0000291void MipsPassConfig::addPreEmitPass() {
Aleksandar Beserminji3239ba82018-07-05 09:27:05 +0000292 // Expand pseudo instructions that are sensitive to register allocation.
293 addPass(createMipsExpandPseudoPass());
294
295 // The microMIPS size reduction pass performs instruction reselection for
296 // instructions which can be remapped to a 16 bit instruction.
Zoran Jovanovic3a7654c2018-06-13 12:51:37 +0000297 addPass(createMicroMipsSizeReducePass());
Daniel Sanderse8efff32016-03-14 16:24:05 +0000298
Aleksandar Beserminjia5f75512018-05-22 13:24:38 +0000299 // The delay slot filler pass can potientially create forbidden slot hazards
300 // for MIPSR6 and therefore it should go before MipsBranchExpansion pass.
Francis Visoiu Mistrih8b617642017-05-18 17:21:13 +0000301 addPass(createMipsDelaySlotFillerPass());
Aleksandar Beserminjia5f75512018-05-22 13:24:38 +0000302
303 // This pass expands branches and takes care about the forbidden slot hazards.
304 // Expanding branches may potentially create forbidden slot hazards for
305 // MIPSR6, and fixing such hazard may potentially break a branch by extending
306 // its offset out of range. That's why this pass combine these two tasks, and
307 // runs them alternately until one of them finishes without any changes. Only
308 // then we can be sure that all branches are expanded properly and no hazards
309 // exists.
310 // Any new pass should go before this pass.
311 addPass(createMipsBranchExpansion());
312
Rafael Espindola6f7c2802016-06-28 14:26:39 +0000313 addPass(createMipsConstantIslandPass());
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +0000314}
Petar Jovanovicfac93e22018-02-23 11:06:40 +0000315
316bool MipsPassConfig::addIRTranslator() {
317 addPass(new IRTranslator());
318 return false;
319}
320
321bool MipsPassConfig::addLegalizeMachineIR() {
322 addPass(new Legalizer());
323 return false;
324}
325
326bool MipsPassConfig::addRegBankSelect() {
327 addPass(new RegBankSelect());
328 return false;
329}
330
331bool MipsPassConfig::addGlobalInstructionSelect() {
332 addPass(new InstructionSelect());
333 return false;
334}