Set register kill flags on the SelectionDAG path, at least in the

easy cases.

llvm-svn: 102678
This commit is contained in:
Dan Gohman 2010-04-30 00:08:21 +00:00
parent dac3ea6e8d
commit ac55510c4e
1 changed files with 12 additions and 1 deletions

View File

@ -296,8 +296,19 @@ InstrEmitter::AddRegisterOperand(MachineInstr *MI, SDValue Op,
}
}
// If this value has only one use, that use is a kill. This is a
// conservative approximation. Tied operands are never killed, so we need
// to check that. And that means we need to determine the index of the
// operand.
unsigned Idx = MI->getNumOperands();
while (Idx > 0 &&
MI->getOperand(Idx-1).isReg() && MI->getOperand(Idx-1).isImplicit())
--Idx;
bool isTied = MI->getDesc().getOperandConstraint(Idx, TOI::TIED_TO) != -1;
bool isKill = Op.hasOneUse() && !isTied;
MI->addOperand(MachineOperand::CreateReg(VReg, isOptDef,
false/*isImp*/, false/*isKill*/,
false/*isImp*/, isKill,
false/*isDead*/, false/*isUndef*/,
false/*isEarlyClobber*/,
0/*SubReg*/, IsDebug));