[IfConversion] Disallow TrueBB == FalseBB for valid diamonds
authorMikael Holmen <mikael.holmen@ericsson.com>
Wed, 8 Apr 2020 09:58:26 +0000 (11:58 +0200)
committerMikael Holmen <mikael.holmen@ericsson.com>
Wed, 8 Apr 2020 10:50:36 +0000 (12:50 +0200)
commit893df2032d480bf791a69fe965c3ca4ef500145b
treea7dd655b09ca6bf597e265df1906f8af457af265
parent89e1248d7b76886912f499391719e68b27e42ec3
[IfConversion] Disallow TrueBB == FalseBB for valid diamonds

Summary:
This fixes PR45302.

Previously the case

     BB1
     / \
    |   |
   TBB FBB
    |   |
     \ /
     BB2

was treated as a valid diamond also when TBB and FBB was the same basic
block. This then lead to a failed assertion in IfConvertDiamond.

Since TBB == FBB is quite a degenerated case of a diamond, we now
don't treat it as a valid diamond anymore, and thus we will avoid the
trouble of making IfConvertDiamond handle it correctly.

Reviewers: efriedma, kparzysz

Reviewed By: efriedma

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D77651
llvm/lib/CodeGen/IfConversion.cpp
llvm/test/CodeGen/ARM/ifcvt_diamondSameTrueFalse.mir [new file with mode: 0644]