diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2017-04-19 06:23:20 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2017-04-19 06:23:20 +0000 |
commit | ae3386aa7449571c7ae5101b2f425021d3b93f98 (patch) | |
tree | 1cebefd5fc0b0d06241735c4289537ed71b25393 /llvm/lib/Transforms | |
parent | 47d58ea681d9a9f1bbce7e37963d5179f227d7a5 (diff) | |
download | bcm5719-llvm-ae3386aa7449571c7ae5101b2f425021d3b93f98.tar.gz bcm5719-llvm-ae3386aa7449571c7ae5101b2f425021d3b93f98.zip |
Revert r300657 due to crashes in stage2 of bootstraps:
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/2476/steps/build-stage2-LLVMgold.so/logs/stdio
http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/15036/steps/build_llvmclang/logs/stdio
I've updated the commit thread, reverting to get the bots back to green.
Original commit summary:
[JumpThread] We want to fold (not thread) when all predecessor go to single BB's successor.
llvm-svn: 300662
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/JumpThreading.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp index 5d193c54282..08eb95a1a3d 100644 --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp @@ -1289,33 +1289,6 @@ bool JumpThreadingPass::ProcessThreadableEdges(Value *Cond, BasicBlock *BB, if (PredToDestList.empty()) return false; - // If all the predecessors go to a single known successor, we want to fold, - // not thread. By doing so, we do not need to duplicate the current block and - // also miss potential opportunities in case we don't/can't duplicate. - if (OnlyDest && OnlyDest != MultipleDestSentinel) { - if (PredToDestList.size() == - (size_t)std::distance(pred_begin(BB), pred_end(BB))) { - for (BasicBlock *SuccBB : successors(BB)) { - if (SuccBB != OnlyDest) - SuccBB->removePredecessor(BB, true); // This is unreachable successor. - } - - // Finally update the terminator. - TerminatorInst *Term = BB->getTerminator(); - BranchInst::Create(OnlyDest, Term); - Term->eraseFromParent(); - - // If the condition is now dead due to the removal of the old terminator, - // erase it. - auto *CondInst = dyn_cast<Instruction>(Cond); - if (CondInst && CondInst->use_empty()) - CondInst->eraseFromParent(); - // FIXME: in case this instruction is defined in the current BB and it - // resolves to a single value from all predecessors, we can do RAUW. - return true; - } - } - // Determine which is the most common successor. If we have many inputs and // this block is a switch, we want to start by threading the batch that goes // to the most popular destination first. If we only know about one |