diff --git a/lib/CodeGen/RegisterScavenging.cpp b/lib/CodeGen/RegisterScavenging.cpp index 06368639b8c..13a36199195 100644 --- a/lib/CodeGen/RegisterScavenging.cpp +++ b/lib/CodeGen/RegisterScavenging.cpp @@ -235,7 +235,7 @@ static unsigned calcDistanceToUse(MachineBasicBlock *MBB, I = next(I); while (I != MBB->end()) { Dist++; - if (I->findRegisterUseOperand(Reg)) + if (I->findRegisterUseOperand(Reg) != -1) return Dist; I = next(I); }