• Home
  • Raw
  • Download

Lines Matching refs:MI

50   bool LowerSubregToReg(MachineInstr *MI);
51 bool LowerCopy(MachineInstr *MI);
53 void TransferImplicitDefs(MachineInstr *MI);
67 ExpandPostRA::TransferImplicitDefs(MachineInstr *MI) { in TransferImplicitDefs() argument
68 MachineBasicBlock::iterator CopyMI = MI; in TransferImplicitDefs()
71 for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { in TransferImplicitDefs()
72 MachineOperand &MO = MI->getOperand(i); in TransferImplicitDefs()
79 bool ExpandPostRA::LowerSubregToReg(MachineInstr *MI) { in LowerSubregToReg() argument
80 MachineBasicBlock *MBB = MI->getParent(); in LowerSubregToReg()
81 assert((MI->getOperand(0).isReg() && MI->getOperand(0).isDef()) && in LowerSubregToReg()
82 MI->getOperand(1).isImm() && in LowerSubregToReg()
83 (MI->getOperand(2).isReg() && MI->getOperand(2).isUse()) && in LowerSubregToReg()
84 MI->getOperand(3).isImm() && "Invalid subreg_to_reg"); in LowerSubregToReg()
86 unsigned DstReg = MI->getOperand(0).getReg(); in LowerSubregToReg()
87 unsigned InsReg = MI->getOperand(2).getReg(); in LowerSubregToReg()
88 assert(!MI->getOperand(2).getSubReg() && "SubIdx on physreg?"); in LowerSubregToReg()
89 unsigned SubIdx = MI->getOperand(3).getImm(); in LowerSubregToReg()
99 DEBUG(dbgs() << "subreg: CONVERTING: " << *MI); in LowerSubregToReg()
101 if (MI->allDefsAreDead()) { in LowerSubregToReg()
102 MI->setDesc(TII->get(TargetOpcode::KILL)); in LowerSubregToReg()
103 DEBUG(dbgs() << "subreg: replaced by: " << *MI); in LowerSubregToReg()
113 MI->setDesc(TII->get(TargetOpcode::KILL)); in LowerSubregToReg()
114 MI->RemoveOperand(3); // SubIdx in LowerSubregToReg()
115 MI->RemoveOperand(1); // Imm in LowerSubregToReg()
116 DEBUG(dbgs() << "subreg: replace by: " << *MI); in LowerSubregToReg()
121 TII->copyPhysReg(*MBB, MI, MI->getDebugLoc(), DstSubReg, InsReg, in LowerSubregToReg()
122 MI->getOperand(2).isKill()); in LowerSubregToReg()
125 MachineBasicBlock::iterator CopyMI = MI; in LowerSubregToReg()
132 MBB->erase(MI); in LowerSubregToReg()
136 bool ExpandPostRA::LowerCopy(MachineInstr *MI) { in LowerCopy() argument
138 if (MI->allDefsAreDead()) { in LowerCopy()
139 DEBUG(dbgs() << "dead copy: " << *MI); in LowerCopy()
140 MI->setDesc(TII->get(TargetOpcode::KILL)); in LowerCopy()
141 DEBUG(dbgs() << "replaced by: " << *MI); in LowerCopy()
145 MachineOperand &DstMO = MI->getOperand(0); in LowerCopy()
146 MachineOperand &SrcMO = MI->getOperand(1); in LowerCopy()
149 DEBUG(dbgs() << "identity copy: " << *MI); in LowerCopy()
152 if (SrcMO.isUndef() || MI->getNumOperands() > 2) { in LowerCopy()
155 MI->setDesc(TII->get(TargetOpcode::KILL)); in LowerCopy()
156 DEBUG(dbgs() << "replaced by: " << *MI); in LowerCopy()
160 MI->eraseFromParent(); in LowerCopy()
164 DEBUG(dbgs() << "real copy: " << *MI); in LowerCopy()
165 TII->copyPhysReg(*MI->getParent(), MI, MI->getDebugLoc(), in LowerCopy()
168 if (MI->getNumOperands() > 2) in LowerCopy()
169 TransferImplicitDefs(MI); in LowerCopy()
171 MachineBasicBlock::iterator dMI = MI; in LowerCopy()
174 MI->eraseFromParent(); in LowerCopy()
194 MachineInstr *MI = mi; in runOnMachineFunction() local
199 if (!MI->isPseudo()) in runOnMachineFunction()
203 if (TII->expandPostRAPseudo(MI)) { in runOnMachineFunction()
209 switch (MI->getOpcode()) { in runOnMachineFunction()
211 MadeChange |= LowerSubregToReg(MI); in runOnMachineFunction()
214 MadeChange |= LowerCopy(MI); in runOnMachineFunction()