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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
We have:
  # RANGE [0, 1] NONZERO 1
  unsigned int b_2(D) = b;
  int r;

  <bb 2> [local count: 1073741824]:
  if (b_2(D) == 1)
    goto <bb 3>; [21.72%]
  else
    goto <bb 4>; [78.28%]

  <bb 3> [local count: 233216728]:

  <bb 4> [local count: 1073741824]:
  # RANGE [1, 2] NONZERO 3
  # r_1 = PHI <1(2), 2(3)>

So, we'd need in some suitable pass (phiopt) figure out that a) the SSA_NAME in
the comparison has a value range of 2 values only, compared against one of them
b) that the PHI values can be expressed by cheap arithmetics from that.

Reply via email to