Chromium Code Reviews| Index: src/IceTargetLoweringX8632.cpp |
| diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp |
| index 17bc8cc6b103df60159e72755c62d8cf548d3cd8..63da9e7d4307738f96e8c115a4a94216e728a8d6 100644 |
| --- a/src/IceTargetLoweringX8632.cpp |
| +++ b/src/IceTargetLoweringX8632.cpp |
| @@ -316,6 +316,8 @@ TargetX8632::TargetX8632(Cfg *Func) |
| void TargetX8632::translateO2() { |
| TimerMarker T(TimerStack::TT_O2, Func); |
| + initFakeKilledScratchRegisters(); |
| + |
| if (!Ctx->getFlags().PhiEdgeSplit) { |
| // Lower Phi instructions. |
| Func->placePhiLoads(); |
| @@ -411,6 +413,9 @@ void TargetX8632::translateO2() { |
| void TargetX8632::translateOm1() { |
| TimerMarker T(TimerStack::TT_Om1, Func); |
| + |
| + initFakeKilledScratchRegisters(); |
| + |
| Func->placePhiLoads(); |
| if (Func->hasError()) |
| return; |
| @@ -1869,12 +1874,9 @@ void TargetX8632::lowerCall(const InstCall *Instr) { |
| } |
| // Insert a register-kill pseudo instruction. |
| - VarList KilledRegs; |
| - for (SizeT i = 0; i < ScratchRegs.size(); ++i) { |
| - if (ScratchRegs[i]) |
| - KilledRegs.push_back(Func->getTarget()->getPhysicalRegister(i)); |
| - } |
| - Context.insert(InstFakeKill::create(Func, KilledRegs, NewCall)); |
| + assert(!FakeKilledScratchRegisters.empty()); |
| + Context.insert( |
| + InstFakeKill::create(Func, FakeKilledScratchRegisters, NewCall)); |
| // Generate a FakeUse to keep the call live if necessary. |
| if (Instr->hasSideEffects() && ReturnReg) { |
| @@ -4540,8 +4542,6 @@ void TargetX8632::postLower() { |
| // allocator, for example compute live ranges only for pre-colored |
| // and infinite-weight variables and run the existing linear-scan |
| // allocator. |
|
jvoung (off chromium)
2014/11/04 16:47:07
Maybe this can be an assert that isa<InstFakeKill>
Jim Stichnoth
2014/11/04 17:10:39
Done.
|
| - if (llvm::isa<InstFakeKill>(Inst)) |
| - continue; |
| for (SizeT SrcNum = 0; SrcNum < Inst->getSrcSize(); ++SrcNum) { |
| Operand *Src = Inst->getSrc(SrcNum); |
| SizeT NumVars = Src->getNumVars(); |
| @@ -4563,9 +4563,6 @@ void TargetX8632::postLower() { |
| FreedRegisters.reset(); |
| if (Inst->isDeleted()) |
| continue; |
| - // Skip FakeKill instructions like above. |
| - if (llvm::isa<InstFakeKill>(Inst)) |
| - continue; |
| // Iterate over all variables referenced in the instruction, |
| // including the Dest variable (if any). If the variable is |
| // marked as infinite-weight, find it a register. If this |
| @@ -4579,6 +4576,8 @@ void TargetX8632::postLower() { |
| SizeT NumSrcs = Inst->getSrcSize(); |
| if (Dest) |
| ++NumSrcs; |
| + if (NumSrcs == 0) |
| + continue; |
| OperandList Srcs(NumSrcs); |
| for (SizeT i = 0; i < Inst->getSrcSize(); ++i) |
| Srcs[i] = Inst->getSrc(i); |