[PATCH] D16156: Proper handling of diamond-like cases in if-conversion

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 19 13:29:27 PST 2016


MatzeB added a comment.

In http://reviews.llvm.org/D16156#330482, @MatzeB wrote:

> In http://reviews.llvm.org/D16156#330410, @kparzysz wrote:
>
> > The 4th statement will return if TT is null (actually both TT and FT), and both branches are analyzable.  You are right---returns are not analyzable, and this condition is not triggered.  The AnalyzeBranch from Hexagon does not differ in that respect from that from other targets.
>
>
> Your patch description states that you fix diamond cases with no join block (doesn't sound like a diamond case to me, and I'm not convinced the code in ValidDiamond is supposed to handle that). Anyway if both TT and FT end in a return, then I would expect TT and FT to be nullptr at this point and as none of the two branches was analyzable we end in a `return false`


Ignore this comment, you will indeed not hit this case. I still have to read the code some more to understand why ValidSimple() doesn't kick in here and whether ValidDiamond() is supposed to handle this case.


Repository:
  rL LLVM

http://reviews.llvm.org/D16156





More information about the llvm-commits mailing list