[PATCH] D104636: [LoopIdiom] [LoopNest] let the pass deal with runtime memset size

Yueh-Ting Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 21 05:50:05 PDT 2021


eopXD added a subscriber: qianzhen.
eopXD added a comment.

In D104636#2830325 <https://reviews.llvm.org/D104636#2830325>, @lebedev.ri wrote:

> Why is this beneficial?

I shall quote from D104179 <https://reviews.llvm.org/D104179> as @qianzhen stated this optimization clearly:

> When the loop idiom transformation processes a memset instruction in a loop, currently it only handles the memset with a compile-time constant size. The motivation of this work is to relax this limitation, so that a memset with a variable size in a loop may still be processed and promoted to a larger memset if it passes all the eligibility checks. Performance-wise, promoting the memset in a loop to a larger memset reduces the number of calls to memset; hence reducing the overall call overhead.
> A similar technique may also apply to the memcpy with a variable size in a loop.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104636



More information about the llvm-commits mailing list