diff --git a/lib/CodeGen/PostRASchedulerList.cpp b/lib/CodeGen/PostRASchedulerList.cpp index 27c73a75951..f3dfb01ff12 100644 --- a/lib/CodeGen/PostRASchedulerList.cpp +++ b/lib/CodeGen/PostRASchedulerList.cpp @@ -532,9 +532,9 @@ SchedulePostRATDList::findSuitableFreeRegister(unsigned AntiDepReg, "Kill and Def maps aren't consistent for AntiDepReg!"); assert(((KillIndices[NewReg] == ~0u) != (DefIndices[NewReg] == ~0u)) && "Kill and Def maps aren't consistent for NewReg!"); - if (KillIndices[NewReg] == ~0u && - Classes[NewReg] != reinterpret_cast(-1) && - KillIndices[AntiDepReg] <= DefIndices[NewReg]) + if (KillIndices[NewReg] != ~0u || + Classes[NewReg] == reinterpret_cast(-1) || + KillIndices[AntiDepReg] > DefIndices[NewReg]) continue; return NewReg; }