ipa vrp implementation in gcc
kugan
kugan.vivekanandarajah@linaro.org
Fri Mar 18 10:20:00 GMT 2016
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
More information about the Gcc
mailing list