llvm.org GIT mirror llvm / faa5107
Rename findRegisterUseOperand to findRegisterUseOperandIdx to avoid confusion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36483 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 13 years ago
8 changed file(s) with 15 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
389389 delete removeFromParent();
390390 }
391391
392 /// findRegisterUseOperand() - Returns the operand index that is a use of
392 /// findRegisterUseOperandIdx() - Returns the operand index that is a use of
393393 /// the specific register or -1 if it is not found. It further tightening
394394 /// the search criteria to a use that kills the register if isKill is true.
395 int findRegisterUseOperand(unsigned Reg, bool isKill = false);
395 int findRegisterUseOperandIdx(unsigned Reg, bool isKill = false);
396396
397397 /// findRegisterDefOperand() - Returns the MachineOperand that is a def of
398398 /// the specific register or NULL if it is not found.
886886
887887 // If the source instruction was killing the source register before the
888888 // merge, unset the isKill marker given the live range has been extended.
889 int UIdx = ValLREndInst->findRegisterUseOperand(IntB.reg, true);
889 int UIdx = ValLREndInst->findRegisterUseOperandIdx(IntB.reg, true);
890890 if (UIdx != -1)
891891 ValLREndInst->getOperand(UIdx).unsetIsKill();
892892
434434 "Cannot have a live-in virtual register!");
435435 HandlePhysRegUse(*I, Ret);
436436 // Add live-out registers as implicit uses.
437 Ret->addRegOperand(*I, false, true);
437 if (Ret->findRegisterUseOperandIdx(*I) == -1)
438 Ret->addRegOperand(*I, false, true);
438439 }
439440 }
440441
168168 }
169169 }
170170
171 /// findRegisterUseOperand() - Returns the MachineOperand that is a use of
171 /// findRegisterUseOperandIdx() - Returns the MachineOperand that is a use of
172172 /// the specific register or -1 if it is not found. It further tightening
173173 /// the search criteria to a use that kills the register if isKill is true.
174 int MachineInstr::findRegisterUseOperand(unsigned Reg, bool isKill){
174 int MachineInstr::findRegisterUseOperandIdx(unsigned Reg, bool isKill) {
175175 for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
176176 MachineOperand &MO = getOperand(i);
177177 if (MO.isReg() && MO.isUse() && MO.getReg() == Reg)
234234 I = next(I);
235235 while (I != MBB->end()) {
236236 Dist++;
237 if (I->findRegisterUseOperand(Reg) != -1)
237 if (I->findRegisterUseOperandIdx(Reg) != -1)
238238 return Dist;
239239 I = next(I);
240240 }
763763 // necessary.
764764 bool WasKill = false;
765765 if (SSMI) {
766 int UIdx = SSMI->findRegisterUseOperand(PhysReg, true);
766 int UIdx = SSMI->findRegisterUseOperandIdx(PhysReg, true);
767767 if (UIdx != -1) {
768768 MachineOperand &MOK = SSMI->getOperand(UIdx);
769769 WasKill = MOK.isKill();
848848 // necessary.
849849 bool WasKill = false;
850850 if (SSMI) {
851 int UIdx = SSMI->findRegisterUseOperand(PhysReg, true);
851 int UIdx = SSMI->findRegisterUseOperandIdx(PhysReg, true);
852852 if (UIdx != -1) {
853853 MachineOperand &MOK = SSMI->getOperand(UIdx);
854854 WasKill = MOK.isKill();
858858 MachineInstr *CopyMI = prior(MII);
859859 if (WasKill) {
860860 // Transfer kill to the next use.
861 int UIdx = CopyMI->findRegisterUseOperand(PhysReg);
861 int UIdx = CopyMI->findRegisterUseOperandIdx(PhysReg);
862862 assert(UIdx != -1);
863863 MachineOperand &MOU = CopyMI->getOperand(UIdx);
864864 MOU.setIsKill();
956956 // extended. Remove its kill.
957957 bool WasKill = false;
958958 if (SSMI) {
959 int UIdx = SSMI->findRegisterUseOperand(InReg, true);
959 int UIdx = SSMI->findRegisterUseOperandIdx(InReg, true);
960960 if (UIdx != -1) {
961961 MachineOperand &MOK = SSMI->getOperand(UIdx);
962962 WasKill = MOK.isKill();
966966 if (NextMII != MBB.end()) {
967967 // If NextMII uses InReg and the use is not a two address
968968 // operand, mark it killed.
969 int UIdx = NextMII->findRegisterUseOperand(InReg);
969 int UIdx = NextMII->findRegisterUseOperandIdx(InReg);
970970 if (UIdx != -1) {
971971 MachineOperand &MOU = NextMII->getOperand(UIdx);
972972 if (WasKill) {
277277 for (unsigned j = 0; j < 2; ++j) {
278278 // Look at the two new MI's in reverse order.
279279 MachineInstr *NewMI = NewMIs[j];
280 int NIdx = NewMI->findRegisterUseOperand(Reg);
280 int NIdx = NewMI->findRegisterUseOperandIdx(Reg);
281281 if (NIdx == -1)
282282 continue;
283283 LV.addVirtualRegisterKilled(Reg, NewMI);
220220 }
221221 }
222222
223 bool BaseKill = Loc->findRegisterUseOperand(Base, true) != -1;
223 bool BaseKill = Loc->findRegisterUseOperandIdx(Base, true) != -1;
224224 if (mergeOps(MBB, ++Loc, SOffset, Base, BaseKill, Opcode,Scratch,Regs, TII)) {
225225 Merges.push_back(prior(Loc));
226226 for (unsigned i = SIndex, e = MemOps.size(); i != e; ++i) {