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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213430 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2014-07-18 23:41:32 +00:00
parent 0ce4f580bc
commit ec3b0fef11
11 changed files with 53 additions and 124 deletions

View File

@@ -25,7 +25,10 @@ class formatted_raw_ostream;
class MipsRegisterInfo;
class MipsTargetMachine : public LLVMTargetMachine {
MipsSubtarget Subtarget;
MipsSubtarget *Subtarget;
MipsSubtarget DefaultSubtarget;
MipsSubtarget NoMips16Subtarget;
MipsSubtarget Mips16Subtarget;
public:
MipsTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
@@ -42,14 +45,18 @@ public:
const TargetFrameLowering *getFrameLowering() const override {
return getSubtargetImpl()->getFrameLowering();
}
const MipsSubtarget *getSubtargetImpl() const override { return &Subtarget; }
const MipsSubtarget *getSubtargetImpl() const override {
if (Subtarget)
return Subtarget;
return &DefaultSubtarget;
}
const InstrItineraryData *getInstrItineraryData() const override {
return Subtarget.inMips16Mode()
return Subtarget->inMips16Mode()
? nullptr
: &getSubtargetImpl()->getInstrItineraryData();
}
MipsJITInfo *getJITInfo() override {
return Subtarget.getJITInfo();
return Subtarget->getJITInfo();
}
const MipsRegisterInfo *getRegisterInfo() const override {
return getSubtargetImpl()->getRegisterInfo();
@@ -63,6 +70,8 @@ public:
const MipsSelectionDAGInfo* getSelectionDAGInfo() const override {
return getSubtargetImpl()->getSelectionDAGInfo();
}
/// \brief Reset the subtarget for the Mips target.
void resetSubtarget(MachineFunction *MF);
// Pass Pipeline Configuration
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;