[PATCH] D40613: [LoopIdiom] Recognize unordered atomic memset

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 11:50:23 PST 2017


anna accepted this revision.
anna added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/Transforms/Scalar/LoopIdiomRecognize.cpp:923
+    const auto *SI = dyn_cast<StoreInst>(TheStore);
+    if (!(SI && SI->isAtomic()))
+      NewCall =
----------------
dneilson wrote:
> anna wrote:
> > Why do we not check that the "ordinary memset" was substituting a store?
> > In other words, shouldn't there be a check for `SI`
> > 
> > This is the behaviour before your change as well (we dont check for store), but somehow it struck me as weird. 
> processLoopStridedStore() kind of has two modes of operation.
> 1) A loop of stores being converted into a single memset call 
> 2) A loop of memset calls being merged into a single memset call
> 
> I made the atomic case explicitly check for a store instruction here because the "loop of atomic memsets" hasn't been implemented yet.
makes sense. thanks for the clarification.


https://reviews.llvm.org/D40613





More information about the llvm-commits mailing list