Repost: RFA [4.1]: improvement to if-conversion and cross-jumping (PR20070)
Joern RENNECKE
joern.rennecke@st.com
Tue Dec 6 16:13:00 GMT 2005
I've just thought of another thing that won't work right with the
current infrastructure:
when we call validate_change, the change is installed instantly. Thus,
when we try to match
the same register again, we will fail. That is easy to fix for
PRE_MODIFY - just save the
register before doing the first potential change - but much harder when
you have a PARALLEL
where any SET_DEST could be a STRICT_LOW_PART, ZERO_EXTEND or SIGN_EXTEND.
I see four possible approaches here:
- split up validate_change into one function that does the registering
of the change request -which is
then used in rtx_equiv_p - and another one that does the tentative
installation of the change
(preferrably for a range of changes).
- Have a separate function like above that only registers the basic
change request, but let validate_changes
figure out if a tentative change needs to be installed first, and
cancel_changes if a change actually
needs to be backed out.
These first to options have the disadvantage of extra overhead for the
exisitng code that uses validate_change,
although the first one could be made to be cost-free with code
duplication (via inlining or in the source).
- Have a function that undoes changes akin to cancel_changes, but does
not throw away
the basic information nor decrement num_changes. This function is
called after the SET_DEST
processing. Then have another function that re-instates the changes,
which is called after the
SET_SRC processing.
- Change the STRICT_LOW_PART, ZERO_EXTEND or SIGN_EXTEND processing:
- gcc_assert that they refer to a MEM or a REG (Is that safe, assuming
an lvalue?).
- If a MEM, process the address only once (it is an input).
- if a REG, do the rvalue == 0 processing like we do now, but set the
register as live in the end
in local_live (if the regs were different) or common_live (if they
were the same. Ignore when
processing rvalue == -1.
More information about the Gcc-patches
mailing list