| Index: src/IceTargetLowering.cpp
|
| diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp
|
| index 9a8a02ab9ed504efbe3652ca78ae16d2bcfaf6ba..3a960cdad30835410dbc0598d42a3088846218ef 100644
|
| --- a/src/IceTargetLowering.cpp
|
| +++ b/src/IceTargetLowering.cpp
|
| @@ -267,9 +267,15 @@ void TargetLowering::regAlloc(RegAllocKind Kind) {
|
| RegInclude |= RegSet_CalleeSave;
|
| if (hasFramePointer())
|
| RegExclude |= RegSet_FramePointer;
|
| - LinearScan.init(Kind);
|
| llvm::SmallBitVector RegMask = getRegisterSet(RegInclude, RegExclude);
|
| - LinearScan.scan(RegMask, Ctx->getFlags().shouldRandomizeRegAlloc());
|
| + bool Repeat = (Kind == RAK_Global && Ctx->getFlags().shouldRegAllocRepeat());
|
| + do {
|
| + LinearScan.init(Kind);
|
| + LinearScan.scan(RegMask, Ctx->getFlags().shouldRandomizeRegAlloc());
|
| + if (!LinearScan.hasEvictions())
|
| + Repeat = false;
|
| + Kind = RAK_SecondChance;
|
| + } while (Repeat);
|
| }
|
|
|
| void TargetLowering::markRedefinitions() {
|
|
|