- // register references as presumed dead across basic blocks.
- MachineInstr **PhysRegInfo;
-
- // PhysRegUsed - Keep track whether the physical register has been used after
- // its last definition. This is local property.
- bool *PhysRegUsed;
-
- // PhysRegPartUse - Keep track of which instruction was the last partial use
- // of a physical register (e.g. on X86 a def of EAX followed by a use of AX).
- // This is a purely local property.
- MachineInstr **PhysRegPartUse;
-
- // PhysRegPartDef - Keep track of a list of instructions which "partially"
- // defined the physical register (e.g. on X86 AX partially defines EAX).
- // These are turned into use/mod/write if there is a use of the register
- // later in the same block. This is local property.
- SmallVector<MachineInstr*, 4> *PhysRegPartDef;
-
- SmallVector<unsigned, 4> *PHIVarInfo;
-
- /// addRegisterKilled - We have determined MI kills a register. Look for the
- /// operand that uses it and mark it as IsKill. If AddIfNotFound is true,
- /// add a implicit operand if it's not found. Returns true if the operand
- /// exists / is added.
- bool addRegisterKilled(unsigned IncomingReg, MachineInstr *MI,
- bool AddIfNotFound = false);
-
- /// addRegisterDead - We have determined MI defined a register without a use.
- /// Look for the operand that defines it and mark it as IsDead. If
- /// AddIfNotFound is true, add a implicit operand if it's not found. Returns
- /// true if the operand exists / is added.
- bool addRegisterDead(unsigned IncomingReg, MachineInstr *MI,
- bool AddIfNotFound = false);
+ // register references are presumed dead across basic blocks.
+ std::vector<MachineInstr *> PhysRegUse;
+
+ std::vector<SmallVector<unsigned, 4>> PHIVarInfo;
+
+ // DistanceMap - Keep track the distance of a MI from the start of the
+ // current basic block.
+ DenseMap<MachineInstr*, unsigned> DistanceMap;
+
+ /// HandlePhysRegKill - Add kills of Reg and its sub-registers to the
+ /// uses. Pay special attention to the sub-register uses which may come below
+ /// the last use of the whole register.
+ bool HandlePhysRegKill(unsigned Reg, MachineInstr *MI);
+
+ /// HandleRegMask - Call HandlePhysRegKill for all registers clobbered by Mask.
+ void HandleRegMask(const MachineOperand&);