-
- // There is a now a proper use, forget about the last partial use.
- PhysRegPartUse[Reg] = NULL;
- PhysRegInfo[Reg] = MI;
- PhysRegUsed[Reg] = true;
-
- // Now reset the use information for the sub-registers.
- for (const unsigned *SubRegs = RegInfo->getSubRegisters(Reg);
- unsigned SubReg = *SubRegs; ++SubRegs) {
- // FIXME: Should we do: "PhysRegPartUse[SubReg] = NULL;" here?
- PhysRegInfo[SubReg] = MI;
- PhysRegUsed[SubReg] = true;
- }
-
- for (const unsigned *SuperRegs = RegInfo->getSuperRegisters(Reg);
- unsigned SuperReg = *SuperRegs; ++SuperRegs) {
- // Remember the partial use of this super-register if it was previously
- // defined.
- bool HasPrevDef = PhysRegInfo[SuperReg] != NULL;
-
- if (!HasPrevDef)
- // FIXME: This only goes back one level of super-registers. It might miss
- // some.
- for (const unsigned *SSRegs = RegInfo->getSuperRegisters(SuperReg);
- unsigned SSReg = *SSRegs; ++SSRegs)
- if (PhysRegInfo[SSReg] != NULL) {
- HasPrevDef = true;
- break;
- }
-
- if (HasPrevDef) {
- PhysRegInfo[SuperReg] = MI;
- PhysRegPartUse[SuperReg] = MI;
- }
- }
-}
-
-/// addRegisterKills - For all of a register's sub-registers that are killed in
-/// other instructions (?), indicate that they are killed in this machine
-/// instruction by marking the operand as "killed". (If the machine operand
-/// isn't found, add it first.)
-void LiveVariables::addRegisterKills(unsigned Reg, MachineInstr *MI,
- SmallSet<unsigned, 4> &SubKills) {
- if (SubKills.count(Reg) == 0) {
- MI->addRegisterKilled(Reg, RegInfo, true);
- return;
- }
-
- for (const unsigned *SubRegs = RegInfo->getImmediateSubRegisters(Reg);