[aarch64-port-dev ] C2: a few more patterns

Andrew Dinn adinn at redhat.com
Wed Nov 6 09:51:10 PST 2013


Most of this looks ok to me but I am suspicious that some (but not all)
of the iRegI to iRegIorL2I changes are not needed. For example:

> -instruct addP_reg_reg_ext(iRegPNoSp dst, iRegP src1, iRegI src2) %{
> +instruct addP_reg_reg_ext(iRegPNoSp dst, iRegP src1, iRegIorL2I src2) %{
>    match(Set dst (AddP src1 (ConvI2L src2)));
> 
>    ins_cost(DEFAULT_COST);
> @@ -6795,7 +6795,7 @@
>    ins_pipe(pipe_class_default);
>  %}

Modifying the declaration of src2 from iRegI to iRegIorL2I means that it
allows src2 to be a either an iRegI or a term of form (ConvL2I iRegL)).
The previous definition only allowed src to be an iRegI.

So your change adds the option of matching trees of the form (AddP src1
(ConvI2L (ConvL2I src3))). Does the ideal graph really include an
ConvL2I inside an ConvI2L? I would have expected that to have been
optimised out at the ideal level.

This one clearly is correct. It allows a long value in register src to
be used as an int without planting a movw to do truncation.

>  // Pointer Immediate Addition
>  // n.b. this needs to be more expensive than using an indirect memory
>  // operand
> @@ -8505,7 +8519,7 @@
> 
>  // We can use ubfx when extending an And with a mask when we know mask
>  // is positive.  We know that because immI_bitmask guarantees it.
> -instruct ubfxIConvI2L(iRegLNoSp dst, iRegI src, immI rshift, immI_bitmask mask)
> +instruct ubfxIConvI2L(iRegLNoSp dst, iRegIorL2I src, immI rshift, immI_bitmask mask)
>  %{
>    match(Set dst (ConvI2L (AndI (URShiftI src rshift) mask)));

regards,


Andrew Dinn
-----------




More information about the aarch64-port-dev mailing list