Skip to content
Snippets Groups Projects
Commit b9d7140c authored by Jan Hubicka's avatar Jan Hubicka
Browse files

loop-split improvements, part 1

while looking on profile misupdate on hmmer I noticed that loop splitting pass is not
able to handle the loop it has as an example it should apply on:

   One transformation of loops like:

   for (i = 0; i < 100; i++)
     {
       if (i < 50)
         A;
       else
         B;
     }

   into:

   for (i = 0; i < 50; i++)
     {
       A;
     }
   for (; i < 100; i++)
     {
       B;
     }

The problem is that ivcanon turns the test into i != 100 and the pass
explicitly gives up on any loops ending with != test.  It needs to know
the directoin of the induction variable in order to derive right conditions,
but that can be done also from step.

It turns out that there are no testcases for basic loop splitting.  I will add
some with the profile update fix.

gcc/ChangeLog:

	* tree-ssa-loop-split.cc (split_loop): Also support NE driven
	loops when IV test is not overflowing.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-ssa/ifc-12.c: Disable loop splitting.
	* gcc.target/i386/avx2-gather-6.c: Likewise.
	* gcc.target/i386/avx2-vect-aggressive.c: Likewise.
parent 54e54f77
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment