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

--- Comment #16 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
It is really hard to make loop splitting to do something.
It does not like canonicalized invariant variables since loop exit condition
should not be NE_EXPR and it does not like when VRP turns LT/GT into NE.

This is what happens in hmmer.  There is loop iterating 100 times and splitting
happens just before last BB
int M = 100;

void
__attribute__ ((noinline,noipa))
do_something()
{
}
void
__attribute__ ((noinline,noipa))
do_something2()
{
}

__attribute__ ((noinline,noipa))
void test1 (int n)
{
  if (n <= 0 || n > 100000)
        return; 
  for (int i = 0; i <= n; i++)
          if (i < n)
                  do_something ();
          else
                  do_something2 ();
}
int
main(int, char **)
{
        for (int i = 0 ; i < 1000; i++)
          test1(M);
        return 0;
}

Reply via email to