forked from OSchip/llvm-project
Move the code in MipsExpandPseudo to MipsInstrInfo::expandPostRAPseudo.
Delete MipsExpandPseudo. llvm-svn: 157495
This commit is contained in:
parent
f4554485cb
commit
d0ac2c93d3
|
@ -17,7 +17,6 @@ add_llvm_target(MipsCodeGen
|
|||
MipsAsmPrinter.cpp
|
||||
MipsCodeEmitter.cpp
|
||||
MipsDelaySlotFiller.cpp
|
||||
MipsExpandPseudo.cpp
|
||||
MipsJITInfo.cpp
|
||||
MipsInstrInfo.cpp
|
||||
MipsISelDAGToDAG.cpp
|
||||
|
|
|
@ -24,8 +24,6 @@ namespace llvm {
|
|||
|
||||
FunctionPass *createMipsISelDag(MipsTargetMachine &TM);
|
||||
FunctionPass *createMipsDelaySlotFillerPass(MipsTargetMachine &TM);
|
||||
FunctionPass *createMipsExpandPseudoPass(MipsTargetMachine &TM);
|
||||
|
||||
FunctionPass *createMipsJITCodeEmitterPass(MipsTargetMachine &TM,
|
||||
JITCodeEmitter &JCE);
|
||||
|
||||
|
|
|
@ -232,6 +232,53 @@ loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
|||
.addMemOperand(MMO);
|
||||
}
|
||||
|
||||
void MipsInstrInfo::ExpandExtractElementF64(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I) const {
|
||||
const TargetInstrInfo *TII = TM.getInstrInfo();
|
||||
unsigned DstReg = I->getOperand(0).getReg();
|
||||
unsigned SrcReg = I->getOperand(1).getReg();
|
||||
unsigned N = I->getOperand(2).getImm();
|
||||
const MCInstrDesc& Mfc1Tdd = TII->get(Mips::MFC1);
|
||||
DebugLoc dl = I->getDebugLoc();
|
||||
const uint16_t* SubReg = TM.getRegisterInfo()->getSubRegisters(SrcReg);
|
||||
|
||||
BuildMI(MBB, I, dl, Mfc1Tdd, DstReg).addReg(*(SubReg + N));
|
||||
}
|
||||
|
||||
void MipsInstrInfo::ExpandBuildPairF64(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I) const {
|
||||
const TargetInstrInfo *TII = TM.getInstrInfo();
|
||||
unsigned DstReg = I->getOperand(0).getReg();
|
||||
unsigned LoReg = I->getOperand(1).getReg(), HiReg = I->getOperand(2).getReg();
|
||||
const MCInstrDesc& Mtc1Tdd = TII->get(Mips::MTC1);
|
||||
DebugLoc dl = I->getDebugLoc();
|
||||
const uint16_t* SubReg =
|
||||
TM.getRegisterInfo()->getSubRegisters(DstReg);
|
||||
|
||||
// mtc1 Lo, $fp
|
||||
// mtc1 Hi, $fp + 1
|
||||
BuildMI(MBB, I, dl, Mtc1Tdd, *SubReg).addReg(LoReg);
|
||||
BuildMI(MBB, I, dl, Mtc1Tdd, *(SubReg + 1)).addReg(HiReg);
|
||||
}
|
||||
|
||||
bool MipsInstrInfo::expandPostRAPseudo(MachineBasicBlock::iterator MI) const {
|
||||
MachineBasicBlock &MBB = *MI->getParent();
|
||||
|
||||
switch(MI->getDesc().getOpcode()) {
|
||||
default:
|
||||
return false;
|
||||
case Mips::BuildPairF64:
|
||||
ExpandBuildPairF64(MBB, MI);
|
||||
break;
|
||||
case Mips::ExtractElementF64:
|
||||
ExpandExtractElementF64(MBB, MI);
|
||||
break;
|
||||
}
|
||||
|
||||
MBB.erase(MI);
|
||||
return true;
|
||||
}
|
||||
|
||||
MachineInstr*
|
||||
MipsInstrInfo::emitFrameIndexDebugValue(MachineFunction &MF, int FrameIx,
|
||||
uint64_t Offset, const MDNode *MDPtr,
|
||||
|
|
|
@ -70,6 +70,10 @@ public:
|
|||
private:
|
||||
void BuildCondBr(MachineBasicBlock &MBB, MachineBasicBlock *TBB, DebugLoc DL,
|
||||
const SmallVectorImpl<MachineOperand>& Cond) const;
|
||||
void ExpandExtractElementF64(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I) const;
|
||||
void ExpandBuildPairF64(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I) const;
|
||||
|
||||
public:
|
||||
virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
|
||||
|
@ -92,6 +96,8 @@ public:
|
|||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual bool expandPostRAPseudo(MachineBasicBlock::iterator MI) const;
|
||||
|
||||
virtual MachineInstr* emitFrameIndexDebugValue(MachineFunction &MF,
|
||||
int FrameIx, uint64_t Offset,
|
||||
const MDNode *MDPtr,
|
||||
|
|
|
@ -105,7 +105,6 @@ public:
|
|||
}
|
||||
|
||||
virtual bool addInstSelector();
|
||||
virtual bool addPreSched2();
|
||||
virtual bool addPreEmitPass();
|
||||
};
|
||||
} // namespace
|
||||
|
@ -129,11 +128,6 @@ bool MipsPassConfig::addPreEmitPass() {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool MipsPassConfig::addPreSched2() {
|
||||
PM->add(createMipsExpandPseudoPass(getMipsTargetMachine()));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MipsTargetMachine::addCodeEmitter(PassManagerBase &PM,
|
||||
JITCodeEmitter &JCE) {
|
||||
// Machine code emitter pass for Mips.
|
||||
|
|
Loading…
Reference in New Issue