Handle load/store of misaligned vectors that are the
[oota-llvm.git] / lib / CodeGen / LiveVariables.cpp
index ea27b2e08e08256913011e5344412f0fa32569ce..48bf809e4820bea4d5a1235d8cf94e0252223a66 100644 (file)
@@ -246,7 +246,7 @@ void LiveVariables::HandlePhysRegUse(unsigned Reg, MachineInstr *MI) {
   // 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?
+    PhysRegPartUse[SubReg] = NULL;
     PhysRegInfo[SubReg] = MI;
     PhysRegUsed[SubReg] = true;
   }
@@ -258,8 +258,9 @@ void LiveVariables::HandlePhysRegUse(unsigned Reg, MachineInstr *MI) {
     bool HasPrevDef = PhysRegInfo[SuperReg] != NULL;
 
     if (!HasPrevDef)
-      // FIXME: This only goes back one level of super-registers. It might miss
-      // some.
+      // No need to go up more levels. A def of a register also sets its sub-
+      // registers. So if PhysRegInfo[SuperReg] is NULL, it means SuperReg's
+      // super-registers are not previously defined.
       for (const unsigned *SSRegs = RegInfo->getSuperRegisters(SuperReg);
            unsigned SSReg = *SSRegs; ++SSRegs)
         if (PhysRegInfo[SSReg] != NULL) {
@@ -296,6 +297,7 @@ void LiveVariables::addRegisterKills(unsigned Reg, MachineInstr *MI,
 ///     last def/use of the register, or
 ///   - The register has sub-registers and none of them are killed elsewhere.
 ///
+/// SubKills is filled with the set of sub-registers that are killed elsewhere.
 bool LiveVariables::HandlePhysRegKill(unsigned Reg, const MachineInstr *RefMI,
                                       SmallSet<unsigned, 4> &SubKills) {
   const unsigned *SubRegs = RegInfo->getImmediateSubRegisters(Reg);
@@ -320,8 +322,9 @@ bool LiveVariables::HandlePhysRegKill(unsigned Reg, const MachineInstr *RefMI,
   return false;
 }
 
-/// HandlePhysRegKill - Calls the recursive version of HandlePhysRegKill. (See
-/// above for details.)
+/// HandlePhysRegKill - Returns true if the whole register is killed in the
+/// machine instruction. If only some of its sub-registers are killed in this
+/// machine instruction, then mark those as killed and return false.
 bool LiveVariables::HandlePhysRegKill(unsigned Reg, MachineInstr *RefMI) {
   SmallSet<unsigned, 4> SubKills;