Index: llvm/trunk/include/llvm/CodeGen/TailDuplicator.h =================================================================== --- llvm/trunk/include/llvm/CodeGen/TailDuplicator.h +++ llvm/trunk/include/llvm/CodeGen/TailDuplicator.h @@ -33,7 +33,6 @@ const MachineBranchProbabilityInfo *MBPI; const MachineModuleInfo *MMI; MachineRegisterInfo *MRI; - std::unique_ptr RS; bool PreRegAlloc; // A list of virtual registers for which to update SSA form. Index: llvm/trunk/lib/CodeGen/TailDuplicator.cpp =================================================================== --- llvm/trunk/lib/CodeGen/TailDuplicator.cpp +++ llvm/trunk/lib/CodeGen/TailDuplicator.cpp @@ -67,10 +67,6 @@ assert(MBPI != nullptr && "Machine Branch Probability Info required"); PreRegAlloc = MRI->isSSA(); - RS.reset(); - - if (MRI->tracksLiveness() && TRI->trackLivenessAfterRegAlloc(MF)) - RS.reset(new RegScavenger()); } static void VerifyPHIs(MachineFunction &MF, bool CheckExtra) { @@ -770,20 +766,6 @@ // Remove PredBB's unconditional branch. TII->RemoveBranch(*PredBB); - if (RS && !TailBB->livein_empty()) { - // Update PredBB livein. - RS->enterBasicBlock(*PredBB); - if (!PredBB->empty()) - RS->forward(std::prev(PredBB->end())); - for (const auto &LI : TailBB->liveins()) { - if (!RS->isRegUsed(LI.PhysReg, false)) - // If a register is previously livein to the tail but it's not live - // at the end of predecessor BB, then it should be added to its - // livein list. - PredBB->addLiveIn(LI); - } - } - // Clone the contents of TailBB into PredBB. DenseMap LocalVRMap; SmallVector, 4> CopyInfos;