llvm.org GIT mirror llvm / 7a3abdc
Move two methods out of line, make them work when the record for a machine instruction includes physregs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30061 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 14 years ago
2 changed file(s) with 42 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
241241
242242 /// removeVirtualRegistersKilled - Remove all killed info for the specified
243243 /// instruction.
244 void removeVirtualRegistersKilled(MachineInstr *MI) {
245 std::map >::iterator I =
246 RegistersKilled.find(MI);
247 if (I != RegistersKilled.end()) {
248 std::vector &Regs = I->second;
249 for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
250 bool removed = getVarInfo(Regs[i]).removeKill(MI);
251 assert(removed && "kill not in register's VarInfo?");
252 }
253 RegistersKilled.erase(I);
254 }
255 }
256
244 void removeVirtualRegistersKilled(MachineInstr *MI);
245
257246 /// addVirtualRegisterDead - Add information about the fact that the specified
258247 /// register is dead after being used by the specified instruction.
259248 ///
291280 return true;
292281 }
293282
294 /// removeVirtualRegistersDead - Remove all of the specified dead
295 /// registers from the live variable information.
296 void removeVirtualRegistersDead(MachineInstr *MI) {
297 std::map >::iterator I =
298 RegistersDead.find(MI);
299 if (I != RegistersDead.end()) {
300 std::vector &Regs = I->second;
301 for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
302 bool removed = getVarInfo(Regs[i]).removeKill(MI);
303 assert(removed && "kill not in register's VarInfo?");
304 }
305 RegistersDead.erase(I);
306 }
307 }
308
283 /// removeVirtualRegistersDead - Remove all of the dead registers for the
284 /// specified instruction from the live variable information.
285 void removeVirtualRegistersDead(MachineInstr *MI);
286
309287 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
310288 AU.setPreservesAll();
311289 }
414414 RegistersDead.erase(OldMI);
415415 }
416416 }
417
418 /// removeVirtualRegistersKilled - Remove all killed info for the specified
419 /// instruction.
420 void LiveVariables::removeVirtualRegistersKilled(MachineInstr *MI) {
421 std::map >::iterator I =
422 RegistersKilled.find(MI);
423 if (I == RegistersKilled.end()) return;
424
425 std::vector &Regs = I->second;
426 for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
427 if (MRegisterInfo::isVirtualRegister(Regs[i])) {
428 bool removed = getVarInfo(Regs[i]).removeKill(MI);
429 assert(removed && "kill not in register's VarInfo?");
430 }
431 }
432 RegistersKilled.erase(I);
433 }
434
435 /// removeVirtualRegistersDead - Remove all of the dead registers for the
436 /// specified instruction from the live variable information.
437 void LiveVariables::removeVirtualRegistersDead(MachineInstr *MI) {
438 std::map >::iterator I =
439 RegistersDead.find(MI);
440 if (I == RegistersDead.end()) return;
441
442 std::vector &Regs = I->second;
443 for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
444 if (MRegisterInfo::isVirtualRegister(Regs[i])) {
445 bool removed = getVarInfo(Regs[i]).removeKill(MI);
446 assert(removed && "kill not in register's VarInfo?");
447 }
448 }
449 RegistersDead.erase(I);
450 }
451
452