]> granicus.if.org Git - llvm/commit
Make MergeBlockIntoPredecessor conformant to the precondition of calling DTU.applyUpdates
authorChijun Sima <simachijun@gmail.com>
Thu, 28 Feb 2019 16:47:18 +0000 (16:47 +0000)
committerChijun Sima <simachijun@gmail.com>
Thu, 28 Feb 2019 16:47:18 +0000 (16:47 +0000)
commit86ddb2a386ad4c778285416a41a2690b2e612a8b
treebfa2582d04c34563131a03a2b9edc7c06bf99899
parent29724e215703f8b43995f371840a2d2959da8715
Make MergeBlockIntoPredecessor conformant to the precondition of calling DTU.applyUpdates

Summary:
It is mentioned in the document of DTU that "It is illegal to submit any update that has already been submitted, i.e., you are supposed not to insert an existent edge or delete a nonexistent edge." It is dangerous to violet this rule because DomTree and PostDomTree occasionally crash on this scenario.

This patch fixes `MergeBlockIntoPredecessor`, making it conformant to this precondition.

Reviewers: kuhar, brzycki, chandlerc

Reviewed By: brzycki

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D58444

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355105 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/BasicBlockUtils.cpp