This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ipa vrp implementation in gcc
- From: kugan <kugan dot vivekanandarajah at linaro dot org>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Martin Jambor <mjambor at suse dot cz>, Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>
- Date: Fri, 18 Mar 2016 21:19:45 +1100
- Subject: Re: ipa vrp implementation in gcc
- Authentication-results: sourceware.org; auth=none
- References: <5692F974 dot 2000805 at linaro dot org> <CAFiYyc0jJpQmg4uh8EhAC0S84=JyBqWdz3rRYuwi85M9YTzecA at mail dot gmail dot com> <20160111175152 dot GA24114 at kam dot mff dot cuni dot cz> <569C1D21 dot 5010803 at linaro dot org> <CAFiYyc2gOWZixd=MwsvReg2vfeu2m87mEQ3U04OEMhAEb7VeuQ at mail dot gmail dot com>
On 18/01/16 20:42, Richard Biener wrote:
I have (very incomplete) prototype patches to do a dominator-based
approach instead (what is refered to downthread as non-iterating approach).
That's cheaper and is what I'd like to provide as an "utility style" interface
to things liker niter analysis which need range-info based on a specific
dominator (the loop header for example).
I am not sure if this is still an interest for GSOC. In the meantime, I
was looking at intra procedural early VRP as suggested.
If I understand this correctly, we have to traverses the dominator tree
forming subregion (or scope) where a variable will have certain range.
We would have to record the ranges in the region in subregion (scope)
context and use this to detect more (for any operation that is used as
operands with known ranges). We will have to keep the context in stack.
We also have to handle loop index variables.
For example,
void bar1 (int, int);
void bar2 (int, int);
void bar3 (int, int);
void bar4 (int, int);
void foo (int a, int b)
{
int t = 0;
//region 1
if (a < 10)
{
//region 2
if (b > 10)
{
//region 3
bar1 (a, b);
}
else
{
//region 4
bar2 (a, b);
}
}
else
{
//region 5
bar3 (a, b);
}
bar4 (a, b);
}
I am also wondering whether we should split the live ranges to get
better value ranges (for the example shown above)?
Thanks,
Kugan