[patch tree-optimization]: Try to do type sinking on comparisons

Kai Tietz ktietz@redhat.com
Mon Jun 27 18:59:00 GMT 2011


Hello,

this patch tries to sink conversions for comparisons patterns:
a) (type) X cmp (type) Y => x cmp y.
b) (type) X cmp CST => x cmp ((type-x) CST).
c) CST cmp (type) X => ((type-x) CST) cmp x.

This patch just allows type sinking for the case that type-precision of type is wider or equal to type-precision of type-x. Or if type and type-x have same signess and CST fits into type-x. For cmp operation is == or !=, we allow also that type and type-x have different signess, as long as CST fits into type-x without truncation. 

ChangeLog

2011-06-27  Kai Tietz  <ktietz@redhat.com>

        * tree-ssa-forwprop.c (forward_propagate_into_comparision):
        Sink types within comparison operands, if suitable.

Bootstrapped and regression tested for x86_64-pc-linux-gnu. Ok for apply?

Regards,
Kai
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sink_cast_cmp.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110627/41746722/attachment.txt>


More information about the Gcc-patches mailing list