diff options
author | Anna Thomas <anna@azul.com> | 2017-02-15 17:08:29 +0000 |
---|---|---|
committer | Anna Thomas <anna@azul.com> | 2017-02-15 17:08:29 +0000 |
commit | 94c8d4976cd2882277ed2311fa077d72a5265dd7 (patch) | |
tree | 144f7f400b877f74d54edb5d037ad9d283da5328 /llvm/lib/Transforms/Utils/CloneFunction.cpp | |
parent | 278904317849409f6967da57d784918d35b28739 (diff) | |
download | bcm5719-llvm-94c8d4976cd2882277ed2311fa077d72a5265dd7.tar.gz bcm5719-llvm-94c8d4976cd2882277ed2311fa077d72a5265dd7.zip |
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
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CloneFunction.cpp | 37 |
1 files changed, 0 insertions, 37 deletions
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<PHINode>(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<Instruction>(New->getOperand(i))) { - auto I = ValueMapping.find(Inst); - if (I != ValueMapping.end()) - New->setOperand(i, I->second); - } - } - - return NewBB; -} |