[PATCH] D115985: Remove unreachable blocks after jumpthreading

Duanyang Jing via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 17 23:49:27 PST 2021


duanyangjing created this revision.
duanyangjing added reviewers: efriedma, fhahn, dmgreen, nikic.
Herald added a subscriber: hiraditya.
duanyangjing requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In the jumpthreading main loop in runImpl, we handle unreachable blocks generated in the middle of transformation by checking pred_empty(&BB), and delete this block. But this mechanism seems insufficient: when a BB is made unreachable, it may still have a predecessor.  This is true when the bb is part of a connected component and the edge from entry block to the component is removed.

This patch adds a full clean-up of unreachable blocks after the transformation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115985

Files:
  llvm/lib/Transforms/Scalar/JumpThreading.cpp
  llvm/test/Transforms/JumpThreading/SimplifyUnreachableBlock.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115985.395265.patch
Type: text/x-patch
Size: 4585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211218/13db7d70/attachment.bin>


More information about the llvm-commits mailing list