On Fri, Jan 12, 2024 at 3:15 AM HAO CHEN GUI <guih...@linux.ibm.com> wrote: > > Hi Richard, > Thanks so much for your comments. > > > >> patch.diff > >> diff --git a/gcc/config/rs6000/rs6000-string.cc > >> b/gcc/config/rs6000/rs6000-string.cc > >> index 7f777666ba9..4c9b2cbeefc 100644 > >> --- a/gcc/config/rs6000/rs6000-string.cc > >> +++ b/gcc/config/rs6000/rs6000-string.cc > >> @@ -140,7 +140,9 @@ expand_block_clear (rtx operands[]) > >> } > >> > >> dest = adjust_address (orig_dest, mode, offset); > >> - > >> + /* Set the alignment of dest to the size of mode in order to > >> + avoid unnecessary byte swaps on LE. */ > >> + set_mem_align (dest, GET_MODE_SIZE (mode) * BITS_PER_UNIT); > > > > but the alignment is now wrong which might cause ripple-down > > wrong-code effects, no? > > > > It's probably bad to hide the byte-swapping in the move patterns (I'm > > just guessing > > you do that) > > Here I just change the alignment of "dest" which is temporary used for > move. The orig_dest is untouched and keep the original alignment. The > subsequent insns which use orig_dest are not affected. I am not sure if > it causes ripple-down effects. Do you mean the dest might be reused > later? But I think the alignment is different even though the mode and > offset is the same.
If the MEM ends up in the IL then its MEM_ALIGN should be better correct. > Looking forward to your advice. > > Thanks > Gui Haochen