This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa]: Invalid GIMPLE generated by C++ front end
On Wed, 13 Aug 2003 17:14:15 -0400, Daniel Berlin <dberlin@dberlin.org> wrote:
>> But your comment brings up the possibility that other passes will want to
>> be able to check whether or not a transformation leaves the code in gimple
>> form. Is this what you need?
>
> Yup. But not for PTA.
> Forward substitution, for instance, can only substitute when the resulting
> expression is still in GIMPLE form.
>
> IE forward subst takes something like
>
> k = q + 3
> t = k + 9
> a[t] = blah + blah
> and makes it
> a[q + 12] = blah + blah
> (It's a loop pre-transformation to make dependence analysis and whatnot
> easier)
> We can't do this if we had something like:
>
> k = q + b
> t = k + 9
> a[t] = blah + blah
> because
> a[q + b + 9] = blah + blah
> is not valid GIMPLE.
Neither is a[q+12]. The must be a val. There are very few situations
where replacing a variable with something other than a val or constant will
produce valid GIMPLE, and there will be fewer in the future--currently,
a[t] = k
and
a[t] = q + 3
are both valid GIMPLE, but in the future only the first will be.
What sorts of things are you wanting to do with forward substitution?
Jason