[all-commits] [llvm/llvm-project] bdcf04: [LoopIdiom] Don't transform loop into memmove when...
yurai007 via All-commits
all-commits at lists.llvm.org
Wed Aug 25 05:23:44 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: bdcf04246c401aec9bdddf32fabc99fa4834a477
https://github.com/llvm/llvm-project/commit/bdcf04246c401aec9bdddf32fabc99fa4834a477
Author: Dawid Jurczak <dawid_jurek at vp.pl>
Date: 2021-08-25 (Wed, 25 Aug 2021)
Changed paths:
M llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
M llvm/test/Transforms/LoopIdiom/basic.ll
Log Message:
-----------
[LoopIdiom] Don't transform loop into memmove when load from body has more than one use
This change fixes issue found by Markus: https://reviews.llvm.org/rG11338e998df1
Before this patch following code was transformed to memmove:
for (int i = 15; i >= 1; i--) {
p[i] = p[i-1];
sum += p[i-1];
}
However load from p[i-1] is used not only by store to p[i] but also by sum computation.
Therefore we cannot emit memmove in loop header.
Differential Revision: https://reviews.llvm.org/D107964
More information about the All-commits
mailing list