The X86FixupLEAs pass for Intel Atom must not call convertToThreeAddress

on ADD16rr opcodes, if src1 != src, since that would cause 
convertToThreeAddress to try to create a virtual register. This is not
permitted after register allocation, which is when the X86FixupLEAs pass
runs.

This patch fixes PR16785.

llvm-svn: 191711
This commit is contained in:
Preston Gurd 2013-09-30 23:18:42 +00:00
parent d9670853b9
commit a352cdea56

View File

@ -125,6 +125,14 @@ FixupLEAPass::postRAConvertToLEA(MachineFunction::iterator &MFI,
// which requires isImm() to be true
return 0;
}
case X86::ADD16rr:
case X86::ADD16rr_DB:
if (MI->getOperand(1).getReg() != MI->getOperand(2).getReg()) {
// if src1 != src2, then convertToThreeAddress will
// need to create a Virtual register, which we cannot do
// after register allocation.
return 0;
}
}
return TII->convertToThreeAddress(MFI, MBBI, 0);
}