This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [GSoC] CSE result-ops


On Sun, Aug 10, 2014 at 11:33 PM, Prathamesh Kulkarni
<bilbotheelffriend@gmail.com> wrote:
> Should we CSE result-op (if result-op is not c_expr) ?

I think that's a premature optimization at this point.

Richard.

> for example:
>
> match-op1 -> result-op1
> match-op2 -> result-op1
>
> we generate code as:
> match-op1
>   result-op1
>
> match-op2
>   result-op1
>
> instead generate:
> match-op1
>   goto l1;
>
> match-op2
>   goto l1;
>
> l1:
> result-op1
>
> In general, for patterns.
> match-op1 -> result-op1,
> match-op2 -> result-op2 ..
>
> generate code as:
> match-op1
>   goto l1
>
> match-op2
>   goto l2
>
> l1: result-op1
> l2: result-op2
>
> We would need to compare AST's for this. Not sure how to do it
> for c_expr. Maybe lexicographically compare tokens by
> comparing c_expr::code of both c_expr's ?
>
> Thanks,
> Prathamesh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]