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: ARM] PR 45335 Use ldrd and strd to access two consecutive words


> > Why is this restricted to Thumb mode? The ARM variant of ldrd isn't quite
> > as flexible, but still provides a useful improvement over ldm.
> 
> I agree the ARM version is also useful. But it brings much less
> benefit with too much complexity (due to more restriction and insn
> pattern conflict with ldm). So I will leave it as a future
> improvement.

I'm still not convinced.  Surely there's no more complexity than the current 
ldm fallback bits.

> >> +  /* Now ldm/stm is possible. Check for special cases ldm/stm has lower
> >> +     cost.  */
> >> +  return false;
> > 
> > Code clearly doesn't match the comment.  In fact this function always
> > returns false.
> 
> Richard mentioned that in some cases (specifically cortex A9) ldm has
> less cost than ldrd and we should model this in the insn pattern. This
> function is used for this. But I don't know the cortex A9 architecture
> detail, so it should be filled by somebody with more knowledge about
> it in future.

This is trivially dead code. As such it should be removed.
I consider this sort of thing to be actively harmful.  At best it's likely to 
bitrot and need rewriting when you implement your "future" changes. At worst 
it triggers incorrectly and breaks something.

> --- pr40457-1.c (revision 165492)
> +++ pr40457-1.c (working copy)
> @@ -1,9 +1,9 @@
> -/* { dg-options "-Os" }  */
> +/* { dg-options "-O2" }  */
> 
>  /* { dg-do compile } */
>  
>  int bar(int* p)

This looks wrong.  ldm is always smaller but is only faster on some cores, so 
I'd expect compiling with -O2 to make this test less reliable.

Paul


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