]> granicus.if.org Git - llvm/commit
[IfConversion] Disallow TBB == FBB for valid triangles
authorMikael Holmen <mikael.holmen@ericsson.com>
Thu, 26 Sep 2019 06:35:55 +0000 (06:35 +0000)
committerMikael Holmen <mikael.holmen@ericsson.com>
Thu, 26 Sep 2019 06:35:55 +0000 (06:35 +0000)
commit91fdf5127faadc711bd5f97e91a95eab5290d44e
treea160514bd9c4ccfbe2672d3ddc8cc69e82afc9c2
parentdcdbbe2ec49b0810c88ea6524433477ec9c1c930
 [IfConversion] Disallow TBB == FBB for valid triangles

Summary:
Previously the case

     EBB
     | \_
     |  |
     | TBB
     |  /
     FBB

was treated as a valid triangle also when TBB and FBB was the same basic
block. This could then lead to an invalid CFG when we removed the edge
from EBB to TBB, since that meant we would also remove the edge from EBB
to FBB.

Since TBB == FBB is quite a degenerated case of a triangle, we now
don't treat it as a valid triangle anymore, and thus we will avoid the
trouble with updating the CFG.

Reviewers: efriedma, dmgreen, kparzysz

Reviewed By: efriedma

Subscribers: bjope, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372943 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/IfConversion.cpp
test/CodeGen/ARM/ifcvt_triangleSameCvtNext.mir [new file with mode: 0644]