[PATCH] D82550: [SLPVectorizer] handle vectorized lib functions

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 6 12:53:52 PDT 2020


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5121
+    if (I->mayReadOrWriteMemory() && !isSideeffectIntrinsic(I) &&
+        !isVectorizableLibFunctionCall(I)) {
       // Update the linked list of memory accessing instructions.
----------------
sanwou01 wrote:
> ABataev wrote:
> > Why do you need to exclude vectorizable library functions here?
> For "normal" function calls, we have to assume that the functions may read or write memory any location in memory, which may alias memory read or written by another instruction in the same bundle. For functions with vector variants, we should be able to assume that they are pure: they won't write to memory (except when the function takes pointer arguments, which I'm not handling correctly now that I think about it; I'll fix that up).
> 
> Actually, the calculateDependencies function below might be the less-surprising place to handle this.
Then it is better to add correct attributes to such functions. Special processing may lead to problems later.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82550/new/

https://reviews.llvm.org/D82550





More information about the llvm-commits mailing list