diff options
author | Eric Christopher <echristo@gmail.com> | 2014-07-18 23:41:32 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2014-07-18 23:41:32 +0000 |
commit | 4e7d1e7e7bb36bcd715297b36d688bdc0ed96bdf (patch) | |
tree | a7c30c18e955d430a9e192d803dd196d06e7be18 /llvm/lib/Target/Mips/MipsConstantIslandPass.cpp | |
parent | e54f10ee77cc973ae83a425efdb7494a111683ab (diff) | |
download | bcm5719-llvm-4e7d1e7e7bb36bcd715297b36d688bdc0ed96bdf.tar.gz bcm5719-llvm-4e7d1e7e7bb36bcd715297b36d688bdc0ed96bdf.zip |
Fundamentally change the MipsSubtarget replacement machinery:
a) Move the replacement level decision to the target machine.
b) Create additional subtargets at the TargetMachine level to
cache and make replacement easy.
c) Make the mips16 features obvious.
d) Remove the override logic as it no longer does anything.
e) Have MipsModuleDAGToDAGISel take only the target machine.
f) Have the constant islands pass grab the current subtarget
from the MachineFunction (via the TargetMachine) instead
of caching it.
g) Unconditionally initialize TLOF.
h) Remove the old complicated subtarget based resetting and
replace it with simple conditionals.
llvm-svn: 213430
Diffstat (limited to 'llvm/lib/Target/Mips/MipsConstantIslandPass.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/MipsConstantIslandPass.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp b/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp index a37062f3b26..80bf573a962 100644 --- a/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp +++ b/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp @@ -365,11 +365,10 @@ namespace { public: static char ID; MipsConstantIslands(TargetMachine &tm) - : MachineFunctionPass(ID), TM(tm), - IsPIC(TM.getRelocationModel() == Reloc::PIC_), - ABI(TM.getSubtarget<MipsSubtarget>().getTargetABI()), - STI(&TM.getSubtarget<MipsSubtarget>()), MF(nullptr), MCP(nullptr), - PrescannedForConstants(false){} + : MachineFunctionPass(ID), TM(tm), + IsPIC(TM.getRelocationModel() == Reloc::PIC_), + ABI(TM.getSubtarget<MipsSubtarget>().getTargetABI()), STI(nullptr), + MF(nullptr), MCP(nullptr), PrescannedForConstants(false) {} const char *getPassName() const override { return "Mips Constant Islands"; @@ -450,9 +449,9 @@ bool MipsConstantIslands::runOnMachineFunction(MachineFunction &mf) { // FIXME: MF = &mf; MCP = mf.getConstantPool(); + STI = &mf.getTarget().getSubtarget<MipsSubtarget>(); DEBUG(dbgs() << "constant island machine function " << "\n"); - if (!TM.getSubtarget<MipsSubtarget>().inMips16Mode() || - !MipsSubtarget::useConstantIslands()) { + if (!STI->inMips16Mode() || !MipsSubtarget::useConstantIslands()) { return false; } TII = (const Mips16InstrInfo*)MF->getTarget().getInstrInfo(); |