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

Yueh-Ting Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 07:46:03 PDT 2021


eopXD created this revision.
eopXD added reviewers: lebedev.ri, Whitney, fhahn, efriedma.
Herald added subscribers: javed.absar, hiraditya.
eopXD requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The current LIR does not deal with runtime-determined memset-size. This patch
utilizes SCEV and check if the PointerStrideSCEV and the MemsetSizeSCEV are equal.

Before comparison the pass would try to fold the expression that is already
protected by the loop guard using SCEVExprConverter.

A testcase file is added - 'memset-runtime.ll'. The first testcase is a simple
for-loop. The second testcase is a nested for-loop and it would need appropriate
conversion by the converter to match the 2 SCEV.

This patch deals with proper loop-idiom. Proceeding patch wants to deal with SCEV-s
that are inequal after folding with the loop guards.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107353

Files:
  llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
  llvm/test/Transforms/LoopIdiom/memset-runtime.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107353.363740.patch
Type: text/x-patch
Size: 27385 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210803/856754fd/attachment.bin>


More information about the llvm-commits mailing list