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

Daniel Neilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 11:25:14 PST 2017


dneilson added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopIdiomRecognize.cpp:923
+    const auto *SI = dyn_cast<StoreInst>(TheStore);
+    if (!(SI && SI->isAtomic()))
+      NewCall =
----------------
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.


https://reviews.llvm.org/D40613





More information about the llvm-commits mailing list