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: [4.5 PATCH] Improve memmove -> memcpy folding optimization


On Thu, Mar 19, 2009 at 4:51 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Mar 19, 2009 at 11:42:05AM -0400, Kaveh R. GHAZI wrote:
>> On Thu, 19 Mar 2009, Jakub Jelinek wrote:
>> > Using get_ref_base_and_extent and ranges_overlap_p we can sometimes prove
>> > what src and dest point to don't overlap and thus memmove with those
>> > arguments can be safely optimized into memcpy.
>> >
>> > Bootstrapped/regtested on x86_64-linux, ok for 4.5?
>> >
>> > 2009-03-18 ?Jakub Jelinek ?<jakub@redhat.com>
>> >
>> > ? ? * builtins.c (fold_builtin_memory_op): Optimize memmove
>> > ? ? into memcpy if we can prove source and destination don't overlap.
>> >
>> > ? ? * gcc.dg/memmove-2.c: New test.
>> > ? ? * gcc.dg/memmove-3.c: New test.
>> >
>>
>> Is this a full or partial solution to enhancement PR 21602 ?
>
> Partial. ?I'm not using PTA here (and at least on the trunk can't easily,
> PTA info is only computed during compute_may_aliases and destroyed before it
> returns) and TBAA of course can't be used (as memmove copying can alias
> anything). ?Perhaps on a-i it is possible.

It will be possible after the a-i branch merge.

Richard.


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