X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FTailDuplication.cpp;h=04d3d311b416e7d7864f7e821a1d1516643eec49;hb=41cdc16e7301c91d2460aa14412f592695b0d4ed;hp=83706deb3f7a0a3bb5c1d85ad18ee7858901be28;hpb=8352062e52eed6e50786fdb89f5e601fdcbe0d90;p=oota-llvm.git diff --git a/lib/CodeGen/TailDuplication.cpp b/lib/CodeGen/TailDuplication.cpp index 83706deb3f7..04d3d311b41 100644 --- a/lib/CodeGen/TailDuplication.cpp +++ b/lib/CodeGen/TailDuplication.cpp @@ -504,8 +504,9 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF, if (!I->isPHI() && !I->isDebugValue()) InstrCount += 1; } - // Heuristically, don't tail-duplicate calls if it would expand code size, - // as it's less likely to be worth the extra cost. + // Don't tail-duplicate calls before register allocation. Calls presents a + // barrier to register allocation so duplicating them may end up increasing + // spills. if (InstrCount > 1 && (PreRegAlloc && HasCall)) return false;