Don't hoist instructions that define a physical register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55074 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2008-08-20 20:32:05 +00:00
parent cb34cd7b5e
commit fb018d0433

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();