[PATCH] D88893: [SROA] Only generate memcpy if the slices is large 'enough' (WIP).

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 9 14:25:09 PDT 2020


efriedma added a comment.

Cost modeling is target-specific yes, and also depends on the alignment of the copy.

If I'm understanding correctly, there are two significant benefits here:

1. Splitting apart the "load" and "store" parts of the memcpy, so, for example, the load can be hoisted out of a loop.
2. We have generally better optimizations for load/store instructions.

> Unfortunately it is going to be quite hard to estimate whether expanding memcpy will enable further optimizations.

There are cases we could detect directly relatively easily: for example, whether we can hoist the load out of a loop, or whether the load is loading a constant value.  More generally it could be tricky, yes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88893



More information about the llvm-commits mailing list