| Index: src/IceTargetLowering.cpp
|
| diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp
|
| index 8d67e8b9f68c99d9c280c4df6554f63c5ee922dd..aa1a80c46b30da7603175b7541bcee0ddf3736ce 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().shouldRepeatRegAlloc());
|
| + do {
|
| + LinearScan.init(Kind);
|
| + LinearScan.scan(RegMask, Ctx->getFlags().shouldRandomizeRegAlloc());
|
| + if (!LinearScan.hasEvictions())
|
| + Repeat = false;
|
| + Kind = RAK_SecondChance;
|
| + } while (Repeat);
|
| }
|
|
|
| void TargetLowering::markRedefinitions() {
|
|
|