[PATCH] D105382: [GlobalISel] Tail call memcpy/memmove/memset even in the presence of copies

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 16 14:28:58 PDT 2021


aemerson added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:508
 
   // Only tail call if the following instruction is a standard return.
   auto Next = next_nodbg(MI.getIterator(), MBB.instr_end());
----------------
paquette wrote:
> This comment is out of date with this change.
Why is it necessary to check for `%0 = COPY $x0`?

It seems the condition we need to check is that there's a write to $x0 (or whatever register is the return register) of the same vreg value as the first argument to G_MEMCPY.

```
G_MEMCPY %0, %1, %2
$x0 = COPY %0
RET_ReallyLR implicit $x0
```



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105382/new/

https://reviews.llvm.org/D105382



More information about the llvm-commits mailing list