[Bug tree-optimization/126139] phiopt does not if-convert half diamonds with multiple PHIs

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 7 06:00:16 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126139

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=121029

--- Comment #4 from Drea Pinski <pinskia at gcc dot gnu.org> ---
This is a VRP/vectorizer all combined together.

```
  if (lo_5 > x_19)
    goto <bb 5>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 4> :
  _21 = MAX_EXPR <hi_7, x_19>;

  <bb 5> :
  # lo_4 = PHI <x_19(3), lo_5(4)>
  # hi_6 = PHI <hi_7(3), _21(4)>
```

What we need to prove here is that when `lo_5 <= x_19` is true, then hi_7 is
the same as _21.

VRP does not handle reductions inside the loop but that seemly does not help
either. Because LLVM does not vectorize the code either.

rtl ifcvt does not even handle with aarch64 cssc either.


More information about the Gcc-bugs mailing list