This is the mail archive of the gcc-patches@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: CCP propagating conditional expression constants


On 1/5/07, Sebastian Pop <sebastian.pop@inria.fr> wrote:
On 1/5/07, Richard Guenther <richard.guenther@gmail.com> wrote:
> I also wonder if you can achieve the same affect by pre-inserting
> single-argument PHI nodes like
>
> <bb 2>:
>   if (x_2(D) == 0) goto <L0>; else goto <L1>;
>
>   # x_3 = PHI <0(2)>
> <L0>:;
>   a_5 = b_4(D) / x_3(D);
>
>   # a_1 = PHI <a_3(D)(2), a_5(3)>
> <L1>:;
>   D.1615_6 = a_1;
>   return D.1615_6;
>
> CCP knows how to propagate through those.
>

Seems also feasible.  I used asserts for not producing extra copies
when we go out of SSA.

Even cleanup_cfg will propagate those single-argument constant PHI nodes, so you are not going to see extra copies here. Full assert exprs just seem a little bit overkill here...

Richard.


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