Don't hoist instructions that define a physical register.

llvm-svn: 55074
This commit is contained in:
Bill Wendling 2008-08-20 20:32:05 +00:00
parent 07a34a5f69
commit cd01e89852
1 changed files with 8 additions and 1 deletions

View File

@ -273,7 +273,14 @@ bool MachineLICM::IsLoopInvariantInst(MachineInstr &I) {
for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
const MachineOperand &MO = I.getOperand(i);
if (!MO.isRegister() || !MO.isUse())
if (!MO.isRegister())
continue;
if (MO.isDef() && TargetRegisterInfo::isPhysicalRegister(MO.getReg()))
// Don't hoist an instruction that defines a physical register.
return false;
if (!MO.isUse())
continue;
unsigned Reg = MO.getReg();