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, rs6000] Fix PR81504 (vec_ld / vec_st bug)


Hi!

On Thu, Aug 24, 2017 at 04:04:23PM -0500, Bill Schmidt wrote:
> @@ -1501,7 +1503,21 @@ recombine_lvx_pattern (rtx_insn *insn, del_info *t
>  	  to_delete[INSN_UID (swap_insn)].replace = true;
>  	  to_delete[INSN_UID (swap_insn)].replace_insn = swap_insn;
>  
> -	  XEXP (mem, 0) = and_operation;
> +	  /* However, first we must be sure that we make the
> +	     base register from the AND operation available
> +	     in case the register has been overwritten.  Copy
> +	     the base register to a new pseudo and use that
> +	     as the base register of the AND operation in
> +	     the new LVX instruction.  */
> +	  rtx and_base = XEXP (and_operation, 0);
> +	  rtx new_reg = gen_reg_rtx (GET_MODE (and_base));
> +	  rtx copy = gen_rtx_SET (new_reg, and_base);
> +	  rtx_insn *new_insn = emit_insn_after (copy, and_insn);
> +	  set_block_for_insn (new_insn, BLOCK_FOR_INSN (and_insn));
> +	  df_insn_rescan (new_insn);

Are those last two lines needed?  Doesn't emit_insn_after do this
already?

Oh, "copy" isn't an insn yet.  Is it simpler if you change this?

Okay with or without that change (also for 7).  Thanks!


Segher


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