2012-02-17 08:55:11 +00:00
|
|
|
//===-- MipsTargetMachine.cpp - Define TargetMachine for Mips -------------===//
|
2007-06-06 07:42:06 +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.
|
2007-06-06 07:42:06 +00:00
|
|
|
//
|
2011-04-15 21:51:11 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 07:42:06 +00:00
|
|
|
//
|
|
|
|
// Implements the info about Mips target spec.
|
|
|
|
//
|
2011-04-15 21:51:11 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 07:42:06 +00:00
|
|
|
|
|
|
|
#include "MipsTargetMachine.h"
|
2012-03-17 18:46:09 +00:00
|
|
|
#include "Mips.h"
|
2014-01-07 11:48:04 +00:00
|
|
|
#include "Mips16FrameLowering.h"
|
|
|
|
#include "Mips16HardFloat.h"
|
|
|
|
#include "Mips16ISelDAGToDAG.h"
|
|
|
|
#include "Mips16ISelLowering.h"
|
|
|
|
#include "Mips16InstrInfo.h"
|
2012-08-02 18:21:47 +00:00
|
|
|
#include "MipsFrameLowering.h"
|
|
|
|
#include "MipsInstrInfo.h"
|
2013-04-09 19:46:01 +00:00
|
|
|
#include "MipsModuleISelDAGToDAG.h"
|
2013-04-10 16:58:04 +00:00
|
|
|
#include "MipsOs16.h"
|
2013-04-09 19:46:01 +00:00
|
|
|
#include "MipsSEFrameLowering.h"
|
|
|
|
#include "MipsSEISelDAGToDAG.h"
|
2014-01-07 11:48:04 +00:00
|
|
|
#include "MipsSEISelLowering.h"
|
|
|
|
#include "MipsSEInstrInfo.h"
|
2014-11-13 09:26:31 +00:00
|
|
|
#include "MipsTargetObjectFile.h"
|
2013-04-09 19:46:01 +00:00
|
|
|
#include "llvm/Analysis/TargetTransformInfo.h"
|
2012-02-03 05:12:41 +00:00
|
|
|
#include "llvm/CodeGen/Passes.h"
|
2012-12-03 16:50:05 +00:00
|
|
|
#include "llvm/PassManager.h"
|
2013-04-09 19:46:01 +00:00
|
|
|
#include "llvm/Support/Debug.h"
|
2011-08-24 18:08:43 +00:00
|
|
|
#include "llvm/Support/TargetRegistry.h"
|
2014-01-07 11:48:04 +00:00
|
|
|
#include "llvm/Support/raw_ostream.h"
|
2013-08-23 10:27:02 +00:00
|
|
|
#include "llvm/Transforms/Scalar.h"
|
2007-06-06 07:42:06 +00:00
|
|
|
using namespace llvm;
|
|
|
|
|
2014-04-21 22:55:11 +00:00
|
|
|
#define DEBUG_TYPE "mips"
|
|
|
|
|
2009-07-25 06:49:55 +00:00
|
|
|
extern "C" void LLVMInitializeMipsTarget() {
|
|
|
|
// Register the target.
|
2011-09-21 03:00:58 +00:00
|
|
|
RegisterTargetMachine<MipsebTargetMachine> X(TheMipsTarget);
|
2009-08-03 02:22:28 +00:00
|
|
|
RegisterTargetMachine<MipselTargetMachine> Y(TheMipselTarget);
|
2012-07-31 21:39:17 +00:00
|
|
|
RegisterTargetMachine<MipsebTargetMachine> A(TheMips64Target);
|
|
|
|
RegisterTargetMachine<MipselTargetMachine> B(TheMips64elTarget);
|
2007-06-06 07:42:06 +00:00
|
|
|
}
|
|
|
|
|
2015-01-26 19:03:15 +00:00
|
|
|
static std::string computeDataLayout(bool isLittle, MipsABIInfo &ABI) {
|
|
|
|
std::string Ret = "";
|
|
|
|
|
|
|
|
// There are both little and big endian mips.
|
|
|
|
if (isLittle)
|
|
|
|
Ret += "e";
|
|
|
|
else
|
|
|
|
Ret += "E";
|
|
|
|
|
|
|
|
Ret += "-m:m";
|
|
|
|
|
|
|
|
// Pointers are 32 bit on some ABIs.
|
|
|
|
if (!ABI.IsN64())
|
|
|
|
Ret += "-p:32:32";
|
|
|
|
|
|
|
|
// 8 and 16 bit integers only need no have natural alignment, but try to
|
|
|
|
// align them to 32 bits. 64 bit integers have natural alignment.
|
|
|
|
Ret += "-i8:8:32-i16:16:32-i64:64";
|
|
|
|
|
|
|
|
// 32 bit registers are always available and the stack is at least 64 bit
|
|
|
|
// aligned. On N64 64 bit registers are also available and the stack is
|
|
|
|
// 128 bit aligned.
|
|
|
|
if (ABI.IsN64() || ABI.IsN32())
|
|
|
|
Ret += "-n32:64-S128";
|
|
|
|
else
|
|
|
|
Ret += "-n32-S64";
|
|
|
|
|
|
|
|
return Ret;
|
|
|
|
}
|
|
|
|
|
2007-08-28 05:13:42 +00:00
|
|
|
// On function prologue, the stack is created by decrementing
|
|
|
|
// its pointer. Once decremented, all references are done with positive
|
2010-11-15 00:06:54 +00:00
|
|
|
// offset from the stack/frame pointer, using StackGrowsUp enables
|
2008-08-06 06:14:43 +00:00
|
|
|
// an easier handling.
|
Several changes to Mips backend, experimental fp support being the most
important.
- Cleanup in the Subtarget info with addition of new features, not all support
yet, but they allow the future inclusion of features easier. Among new features,
we have : Arch family info (mips1, mips2, ...), ABI info (o32, eabi), 64-bit
integer
and float registers, allegrex vector FPU (VFPU), single float only support.
- TargetMachine now detects allegrex core.
- Added allegrex (Mips32r2) sext_inreg instructions.
- *Added Float Point Instructions*, handling single float only, and
aliased accesses for 32-bit FPUs.
- Some cleanup in FP instruction formats and FP register classes.
- Calling conventions improved to support mips 32-bit EABI.
- Added Asm Printer support for fp cond codes.
- Added support for sret copy to a return register.
- EABI support added into LowerCALL and FORMAL_ARGS.
- MipsFunctionInfo now keeps a virtual register per function to track the
sret on function entry until function ret.
- MipsInstrInfo FP support into methods (isMoveInstr, isLoadFromStackSlot, ...),
FP cond codes mapping and initial FP Branch Analysis.
- Two new Mips SDNode to handle fp branch and compare instructions : FPBrcond,
FPCmp
- MipsTargetLowering : handling different FP classes, Allegrex support, sret
return copy, no homing location within EABI, non 32-bit stack objects
arguments, and asm constraint for float.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 19:05:21 +00:00
|
|
|
// Using CodeModel::Large enables different CALL behavior.
|
2014-07-02 00:54:07 +00:00
|
|
|
MipsTargetMachine::MipsTargetMachine(const Target &T, StringRef TT,
|
|
|
|
StringRef CPU, StringRef FS,
|
|
|
|
const TargetOptions &Options,
|
|
|
|
Reloc::Model RM, CodeModel::Model CM,
|
|
|
|
CodeGenOpt::Level OL, bool isLittle)
|
|
|
|
: LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL),
|
2015-01-26 17:33:46 +00:00
|
|
|
isLittle(isLittle), TLOF(make_unique<MipsTargetObjectFile>()),
|
|
|
|
ABI(MipsABIInfo::computeTargetABI(Triple(TT), CPU, Options.MCOptions)),
|
2015-01-26 19:03:15 +00:00
|
|
|
DL(computeDataLayout(isLittle, ABI)), Subtarget(nullptr),
|
|
|
|
DefaultSubtarget(TT, CPU, FS, isLittle, *this),
|
2014-07-18 23:41:32 +00:00
|
|
|
NoMips16Subtarget(TT, CPU, FS.empty() ? "-mips16" : FS.str() + ",-mips16",
|
2015-01-08 18:18:57 +00:00
|
|
|
isLittle, *this),
|
2014-07-18 23:41:32 +00:00
|
|
|
Mips16Subtarget(TT, CPU, FS.empty() ? "+mips16" : FS.str() + ",+mips16",
|
2015-01-08 18:18:57 +00:00
|
|
|
isLittle, *this) {
|
2014-07-18 23:41:32 +00:00
|
|
|
Subtarget = &DefaultSubtarget;
|
2013-05-13 01:16:13 +00:00
|
|
|
initAsmInfo();
|
2013-04-09 19:46:01 +00:00
|
|
|
}
|
|
|
|
|
2014-11-20 23:37:18 +00:00
|
|
|
MipsTargetMachine::~MipsTargetMachine() {}
|
|
|
|
|
2011-12-20 02:50:00 +00:00
|
|
|
void MipsebTargetMachine::anchor() { }
|
|
|
|
|
2011-09-21 03:00:58 +00:00
|
|
|
MipsebTargetMachine::
|
|
|
|
MipsebTargetMachine(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,
|
2011-12-02 22:16:29 +00:00
|
|
|
CodeGenOpt::Level OL)
|
|
|
|
: MipsTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false) {}
|
2011-09-21 03:00:58 +00:00
|
|
|
|
2011-12-20 02:50:00 +00:00
|
|
|
void MipselTargetMachine::anchor() { }
|
|
|
|
|
2008-06-04 01:45:25 +00:00
|
|
|
MipselTargetMachine::
|
2011-07-19 06:37:02 +00:00
|
|
|
MipselTargetMachine(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,
|
2011-12-02 22:16:29 +00:00
|
|
|
CodeGenOpt::Level OL)
|
|
|
|
: MipsTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, true) {}
|
2008-06-04 01:45:25 +00:00
|
|
|
|
2014-09-26 01:44:08 +00:00
|
|
|
const MipsSubtarget *
|
2014-09-26 02:57:05 +00:00
|
|
|
MipsTargetMachine::getSubtargetImpl(const Function &F) const {
|
2014-09-26 01:44:08 +00:00
|
|
|
AttributeSet FnAttrs = F.getAttributes();
|
|
|
|
Attribute CPUAttr =
|
|
|
|
FnAttrs.getAttribute(AttributeSet::FunctionIndex, "target-cpu");
|
|
|
|
Attribute FSAttr =
|
|
|
|
FnAttrs.getAttribute(AttributeSet::FunctionIndex, "target-features");
|
|
|
|
|
|
|
|
std::string CPU = !CPUAttr.hasAttribute(Attribute::None)
|
|
|
|
? CPUAttr.getValueAsString().str()
|
|
|
|
: TargetCPU;
|
|
|
|
std::string FS = !FSAttr.hasAttribute(Attribute::None)
|
|
|
|
? FSAttr.getValueAsString().str()
|
|
|
|
: TargetFS;
|
|
|
|
bool hasMips16Attr =
|
|
|
|
!FnAttrs.getAttribute(AttributeSet::FunctionIndex, "mips16")
|
|
|
|
.hasAttribute(Attribute::None);
|
|
|
|
bool hasNoMips16Attr =
|
|
|
|
!FnAttrs.getAttribute(AttributeSet::FunctionIndex, "nomips16")
|
|
|
|
.hasAttribute(Attribute::None);
|
|
|
|
|
2014-09-29 21:57:54 +00:00
|
|
|
// FIXME: This is related to the code below to reset the target options,
|
|
|
|
// we need to know whether or not the soft float flag is set on the
|
|
|
|
// function before we can generate a subtarget. We also need to use
|
|
|
|
// it as a key for the subtarget since that can be the only difference
|
|
|
|
// between two functions.
|
|
|
|
Attribute SFAttr =
|
|
|
|
FnAttrs.getAttribute(AttributeSet::FunctionIndex, "use-soft-float");
|
|
|
|
bool softFloat = !SFAttr.hasAttribute(Attribute::None)
|
2014-09-29 23:31:13 +00:00
|
|
|
? SFAttr.getValueAsString() == "true"
|
2014-09-29 21:57:54 +00:00
|
|
|
: Options.UseSoftFloat;
|
|
|
|
|
2014-09-26 01:44:08 +00:00
|
|
|
if (hasMips16Attr)
|
|
|
|
FS += FS.empty() ? "+mips16" : ",+mips16";
|
|
|
|
else if (hasNoMips16Attr)
|
|
|
|
FS += FS.empty() ? "-mips16" : ",-mips16";
|
|
|
|
|
2014-09-29 21:57:54 +00:00
|
|
|
auto &I = SubtargetMap[CPU + FS + (softFloat ? "use-soft-float=true"
|
|
|
|
: "use-soft-float=false")];
|
2014-09-26 01:44:08 +00:00
|
|
|
if (!I) {
|
|
|
|
// This needs to be done before we create a new subtarget since any
|
|
|
|
// creation will depend on the TM and the code generation flags on the
|
|
|
|
// function that reside in TargetOptions.
|
|
|
|
resetTargetOptions(F);
|
2015-01-08 18:18:57 +00:00
|
|
|
I = llvm::make_unique<MipsSubtarget>(TargetTriple, CPU, FS, isLittle, *this);
|
2014-09-26 01:44:08 +00:00
|
|
|
}
|
|
|
|
return I.get();
|
|
|
|
}
|
|
|
|
|
2014-07-18 23:41:32 +00:00
|
|
|
void MipsTargetMachine::resetSubtarget(MachineFunction *MF) {
|
|
|
|
DEBUG(dbgs() << "resetSubtarget\n");
|
2014-09-26 01:44:08 +00:00
|
|
|
|
2014-09-26 02:57:05 +00:00
|
|
|
Subtarget = const_cast<MipsSubtarget *>(getSubtargetImpl(*MF->getFunction()));
|
2014-08-05 02:39:49 +00:00
|
|
|
MF->setSubtarget(Subtarget);
|
2014-07-18 23:41:32 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-02-03 05:12:41 +00:00
|
|
|
namespace {
|
|
|
|
/// Mips Code Generator Pass Configuration Options.
|
|
|
|
class MipsPassConfig : public TargetPassConfig {
|
|
|
|
public:
|
2012-02-04 02:56:59 +00:00
|
|
|
MipsPassConfig(MipsTargetMachine *TM, PassManagerBase &PM)
|
2013-10-07 19:13:53 +00:00
|
|
|
: TargetPassConfig(TM, PM) {
|
|
|
|
// The current implementation of long branch pass requires a scratch
|
|
|
|
// register ($at) to be available before branch instructions. Tail merging
|
|
|
|
// can break this requirement, so disable it when long branch pass is
|
|
|
|
// enabled.
|
|
|
|
EnableTailMerge = !getMipsSubtarget().enableLongBranchPass();
|
|
|
|
}
|
2012-02-03 05:12:41 +00:00
|
|
|
|
|
|
|
MipsTargetMachine &getMipsTargetMachine() const {
|
|
|
|
return getTM<MipsTargetMachine>();
|
|
|
|
}
|
|
|
|
|
|
|
|
const MipsSubtarget &getMipsSubtarget() const {
|
|
|
|
return *getMipsTargetMachine().getSubtargetImpl();
|
|
|
|
}
|
|
|
|
|
2014-04-29 07:58:02 +00:00
|
|
|
void addIRPasses() override;
|
|
|
|
bool addInstSelector() override;
|
|
|
|
void addMachineSSAOptimization() override;
|
2014-12-11 21:26:47 +00:00
|
|
|
void addPreEmitPass() override;
|
2014-03-10 16:31:25 +00:00
|
|
|
|
2014-12-11 21:26:47 +00:00
|
|
|
void addPreRegAlloc() override;
|
2014-03-10 16:31:25 +00:00
|
|
|
|
2012-02-03 05:12:41 +00:00
|
|
|
};
|
|
|
|
} // namespace
|
|
|
|
|
2012-02-04 02:56:59 +00:00
|
|
|
TargetPassConfig *MipsTargetMachine::createPassConfig(PassManagerBase &PM) {
|
|
|
|
return new MipsPassConfig(this, PM);
|
2012-02-03 05:12:41 +00:00
|
|
|
}
|
|
|
|
|
2013-04-10 16:58:04 +00:00
|
|
|
void MipsPassConfig::addIRPasses() {
|
|
|
|
TargetPassConfig::addIRPasses();
|
Erase fence insertion from SelectionDAGBuilder.cpp (NFC)
Summary:
Backends can use setInsertFencesForAtomic to signal to the middle-end that
montonic is the only memory ordering they can accept for
stores/loads/rmws/cmpxchg. The code lowering those accesses with a stronger
ordering to fences + monotonic accesses is currently living in
SelectionDAGBuilder.cpp. In this patch I propose moving this logic out of it
for several reasons:
- There is lots of redundancy to avoid: extremely similar logic already
exists in AtomicExpand.
- The current code in SelectionDAGBuilder does not use any target-hooks, it
does the same transformation for every backend that requires it
- As a result it is plain *unsound*, as it was apparently designed for ARM.
It happens to mostly work for the other targets because they are extremely
conservative, but Power for example had to switch to AtomicExpand to be
able to use lwsync safely (see r218331).
- Because it produces IR-level fences, it cannot be made sound ! This is noted
in the C++11 standard (section 29.3, page 1140):
```
Fences cannot, in general, be used to restore sequential consistency for atomic
operations with weaker ordering semantics.
```
It can also be seen by the following example (called IRIW in the litterature):
```
atomic<int> x = y = 0;
int r1, r2, r3, r4;
Thread 0:
x.store(1);
Thread 1:
y.store(1);
Thread 2:
r1 = x.load();
r2 = y.load();
Thread 3:
r3 = y.load();
r4 = x.load();
```
r1 = r3 = 1 and r2 = r4 = 0 is impossible as long as the accesses are all seq_cst.
But if they are lowered to monotonic accesses, no amount of fences can prevent it..
This patch does three things (I could cut it into parts, but then some of them
would not be tested/testable, please tell me if you would prefer that):
- it provides a default implementation for emitLeadingFence/emitTrailingFence in
terms of IR-level fences, that mimic the original logic of SelectionDAGBuilder.
As we saw above, this is unsound, but the best that can be done without knowing
the targets well (and there is a comment warning about this risk).
- it then switches Mips/Sparc/XCore to use AtomicExpand, relying on this default
implementation (that exactly replicates the logic of SelectionDAGBuilder, so no
functional change)
- it finally erase this logic from SelectionDAGBuilder as it is dead-code.
Ideally, each target would define its own override for emitLeading/TrailingFence
using target-specific fences, but I do not know the Sparc/Mips/XCore memory model
well enough to do this, and they appear to be dealing fine with the ARM-inspired
default expansion for now (probably because they are overly conservative, as
Power was). If anyone wants to compile fences more agressively on these
platforms, the long comment should make it clear why he should first override
emitLeading/TrailingFence.
Test Plan: make check-all, no functional change
Reviewers: jfb, t.p.northover
Subscribers: aemerson, llvm-commits
Differential Revision: http://reviews.llvm.org/D5474
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219957 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-16 20:34:57 +00:00
|
|
|
addPass(createAtomicExpandPass(&getMipsTargetMachine()));
|
2013-04-10 16:58:04 +00:00
|
|
|
if (getMipsSubtarget().os16())
|
|
|
|
addPass(createMipsOs16(getMipsTargetMachine()));
|
Checkin in of first of several patches to finish implementation of
mips16/mips32 floating point interoperability.
This patch fixes returns from mips16 functions so that if the function
was in fact called by a mips32 hard float routine, then values
that would have been returned in floating point registers are so returned.
Mips16 mode has no floating point instructions so there is no way to
load values into floating point registers.
This is needed when returning float, double, single complex, double complex
in the Mips ABI.
Helper functions in libc for mips16 are available to do this.
For efficiency purposes, these helper functions have a different calling
convention from normal Mips calls.
Registers v0,v1,a0,a1 are used to pass parameters instead of
a0,a1,a2,a3.
This is because v0,v1,a0,a1 are the natural registers used to return
floating point values in soft float. These values can then be moved
to the appropriate floating point registers with no extra cost.
The only register that is modified is ra in this call.
The helper functions make sure that the return values are in the floating
point registers that they would be in if soft float was not in effect
(which it is for mips16, though the soft float is implemented using a mips32
library that uses hard float).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181641 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-10 22:25:39 +00:00
|
|
|
if (getMipsSubtarget().inMips16HardFloat())
|
|
|
|
addPass(createMips16HardFloat(getMipsTargetMachine()));
|
2013-04-10 16:58:04 +00:00
|
|
|
}
|
2010-11-15 00:06:54 +00:00
|
|
|
// Install an instruction selector pass using
|
2007-06-06 07:42:06 +00:00
|
|
|
// the ISelDag to gen Mips code.
|
2012-05-01 08:27:43 +00:00
|
|
|
bool MipsPassConfig::addInstSelector() {
|
2014-07-18 20:29:02 +00:00
|
|
|
addPass(createMipsModuleISelDag(getMipsTargetMachine()));
|
|
|
|
addPass(createMips16ISelDag(getMipsTargetMachine()));
|
|
|
|
addPass(createMipsSEISelDag(getMipsTargetMachine()));
|
2007-06-06 07:42:06 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-11-27 23:38:42 +00:00
|
|
|
void MipsPassConfig::addMachineSSAOptimization() {
|
|
|
|
addPass(createMipsOptimizePICCallPass(getMipsTargetMachine()));
|
|
|
|
TargetPassConfig::addMachineSSAOptimization();
|
|
|
|
}
|
|
|
|
|
2014-12-11 21:26:47 +00:00
|
|
|
void MipsPassConfig::addPreRegAlloc() {
|
|
|
|
if (getOptLevel() == CodeGenOpt::None)
|
2014-03-10 16:31:25 +00:00
|
|
|
addPass(createMipsOptimizePICCallPass(getMipsTargetMachine()));
|
|
|
|
}
|
|
|
|
|
2015-02-01 13:20:00 +00:00
|
|
|
TargetIRAnalysis MipsTargetMachine::getTargetIRAnalysis() {
|
|
|
|
return TargetIRAnalysis([this](Function &F) {
|
|
|
|
if (Subtarget->allowMixed16_32()) {
|
|
|
|
DEBUG(errs() << "No Target Transform Info Pass Added\n");
|
|
|
|
// FIXME: This is no longer necessary as the TTI returned is per-function.
|
|
|
|
return TargetTransformInfo(getDataLayout());
|
|
|
|
}
|
|
|
|
|
|
|
|
DEBUG(errs() << "Target Transform Info Pass Added\n");
|
2015-02-01 14:22:17 +00:00
|
|
|
return TargetTransformInfo(BasicTTIImpl(this, F));
|
2015-02-01 13:20:00 +00:00
|
|
|
});
|
2013-04-09 19:46:01 +00:00
|
|
|
}
|
|
|
|
|
2010-11-15 00:06:54 +00:00
|
|
|
// Implemented by targets that want to run passes immediately before
|
|
|
|
// machine code is emitted. return true if -print-machineinstrs should
|
2007-06-06 07:42:06 +00:00
|
|
|
// print out the code after the passes.
|
2014-12-11 21:26:47 +00:00
|
|
|
void MipsPassConfig::addPreEmitPass() {
|
2012-06-14 01:19:35 +00:00
|
|
|
MipsTargetMachine &TM = getMipsTargetMachine();
|
2014-12-11 23:18:03 +00:00
|
|
|
addPass(createMipsDelaySlotFillerPass(TM));
|
|
|
|
addPass(createMipsLongBranchPass(TM));
|
2014-07-18 20:29:02 +00:00
|
|
|
addPass(createMipsConstantIslandPass(TM));
|
2007-06-06 07:42:06 +00:00
|
|
|
}
|