diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index 83aa385d016..ccaee19529f 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -165,7 +165,12 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) { if (MO.isVirtualRegister() && !MO.getVRegValueOrNull()) { unsigned RegIdx = MO.getReg()-MRegisterInfo::FirstVirtualRegister; HandleVirtRegUse(getVarInfo(RegIdx), MBB, MI); - } else if (MO.isPhysicalRegister() && MO.getReg() != 0) { + } else if (MO.isPhysicalRegister() && MO.getReg() != 0 + /// FIXME: This is a gross hack, due to us not being able to + /// say that some registers are defined on entry to the + /// function. 5 = ESP +&& MO.getReg() != 5 +) { HandlePhysRegUse(MO.getReg(), MI); } } @@ -188,7 +193,12 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) { VRInfo.DefBlock = MBB; // Created here... VRInfo.DefInst = MI; VRInfo.Kills.push_back(std::make_pair(MBB, MI)); // Defaults to dead - } else if (MO.isPhysicalRegister() && MO.getReg() != 0) { + } else if (MO.isPhysicalRegister() && MO.getReg() != 0 + /// FIXME: This is a gross hack, due to us not being able to + /// say that some registers are defined on entry to the + /// function. 5 = ESP +&& MO.getReg() != 5 +) { HandlePhysRegDef(MO.getReg(), MI); } }