From 94c8d4976cd2882277ed2311fa077d72a5265dd7 Mon Sep 17 00:00:00 2001 From: Anna Thomas Date: Wed, 15 Feb 2017 17:08:29 +0000 Subject: Revert "[JumpThreading] Thread through guards" This reverts commit r294617. We fail on an assert while trying to get a condition from an unconditional branch. llvm-svn: 295200 --- llvm/lib/Transforms/Utils/CloneFunction.cpp | 37 ----------------------------- 1 file changed, 37 deletions(-) (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp') diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index b3c062f37cc..4d33e22fecf 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -747,40 +747,3 @@ Loop *llvm::cloneLoopWithPreheader(BasicBlock *Before, BasicBlock *LoopDomBB, return NewLoop; } - -/// \brief Duplicate non-Phi instructions from the beginning of block up to -/// StopAt instruction into a split block between BB and its predecessor. -BasicBlock * -llvm::DuplicateInstructionsInSplitBetween(BasicBlock *BB, BasicBlock *PredBB, - Instruction *StopAt, - ValueToValueMapTy &ValueMapping) { - // We are going to have to map operands from the original BB block to the new - // copy of the block 'NewBB'. If there are PHI nodes in BB, evaluate them to - // account for entry from PredBB. - BasicBlock::iterator BI = BB->begin(); - for (; PHINode *PN = dyn_cast(BI); ++BI) - ValueMapping[PN] = PN->getIncomingValueForBlock(PredBB); - - BasicBlock *NewBB = SplitEdge(PredBB, BB); - NewBB->setName(PredBB->getName() + ".split"); - Instruction *NewTerm = NewBB->getTerminator(); - - // Clone the non-phi instructions of BB into NewBB, keeping track of the - // mapping and using it to remap operands in the cloned instructions. - for (; StopAt != &*BI; ++BI) { - Instruction *New = BI->clone(); - New->setName(BI->getName()); - New->insertBefore(NewTerm); - ValueMapping[&*BI] = New; - - // Remap operands to patch up intra-block references. - for (unsigned i = 0, e = New->getNumOperands(); i != e; ++i) - if (Instruction *Inst = dyn_cast(New->getOperand(i))) { - auto I = ValueMapping.find(Inst); - if (I != ValueMapping.end()) - New->setOperand(i, I->second); - } - } - - return NewBB; -} -- cgit v1.2.3