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: PATCH COMMITTED: Use conditional moves in groups of assignments


Ian Lance Taylor wrote:

My patch handles code which is different in the then/else branches, as
long as everything is an assignment to a pseudo-register.

My code would handle the RHSs of these assignments as inputs.

In
particular, the then/else branches can set different registers.


That is something not covered by my patch.  It would require extra data
structures to describe where such sets are.

I
initially only handled the case of constant or register inputs, but
it's relatively straightforward to extend to general operands, which
need not be the same in the then/else branches, with more careful
checking of which code affects which other code.


My code could easily be adopted to allow a wider range of possible inputs for
if-conversion. There would have to be a flag in the struct equiv_info to tell if
such more general inputs are allowed, since this cannot easily be extended to
cross-jumping - we'd first have to find registers where to put the alternate inputs.
(This would already be true for constant inputs.)


However, even for if-conversion, I wonder what kind of inputs you could safely
yet profitably use - in general, memory operands will be unsuitable because they
can trap. Or would this optimization be restricted to targets that can use such
sources directly in a conditional move such that no trap occurs if the move is
not actually done?



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