[PATCH] D30225: [LIR] re-enable generation of memmove with runtime checks

Sebastian Pop via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 14:15:31 PST 2017


sebpop created this revision.
Herald added a subscriber: mzolotukhin.

This patch fixes https://bugs.llvm.org//show_bug.cgi?id=31391

Last time memmove was enabled, LIR was using the memory data dependence static analysis to disambiguate the use of memmove().
Those patches were backed out because the dependence analysis is unsafe, and it still contains the same errors as of today.
This patch avoids using the static analysis, and instead versions the loop conditional to whether memmove is legal.

A next patch will add support to generate the runtime checks for memset as described in https://bugs.llvm.org//show_bug.cgi?id=31391#c4

The code of this patch mostly comes from Hexagon-LIR, and the revert of the previous revert of the memmove in LIR.
Krzysztof, we will probably need to refactor this code: Hexagon requires some special handling for volatile memcpy, and the rest is usable for target independent code.


Repository:
  rL LLVM

https://reviews.llvm.org/D30225

Files:
  llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30225.89278.patch
Type: text/x-patch
Size: 15377 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170221/a9896bff/attachment.bin>


More information about the llvm-commits mailing list