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

loop-split improvements, part 3

extend tree-ssa-loop-split to understand test of the form
 if (i==0)
and
 if (i!=0)
which triggers only during the first iteration.  Naturally we should
also be able to trigger last iteration or split into 3 cases if
the test indeed can fire in the middle of the loop.

Last iteration is bit trickier pattern matching so I want to do it
incrementally, but I implemented easy case using value range that handled
loops with constant iterations.

The testcase gets misupdated profile, I will also fix that incrementally.

gcc/ChangeLog:

	PR middle-end/77689
	* tree-ssa-loop-split.cc: Include value-query.h.
	(split_at_bb_p): Analyze cases where EQ/NE can be turned
	into LT/LE/GT/GE; return updated guard code.
	(split_loop): Use guard code.

gcc/testsuite/ChangeLog:

	PR middle-end/77689
	* g++.dg/tree-ssa/loop-split-1.C: New test.
parent 095eb138
No related branches found
No related tags found
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