[PATCH] D156068: [WIP] Vectorization for __builtin_prefetch

m-saito-fj via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 23 19:00:09 PDT 2023


m-saito-fj created this revision.
m-saito-fj added a project: LLVM.
Herald added subscribers: rogfer01, hiraditya.
Herald added a project: All.
m-saito-fj requested review of this revision.
Herald added subscribers: llvm-commits, wangpc, vkmr, jdoerfert.

This patch is for vectorization of a loop with __builtin_prefetch inside the loop as follows

  c
  void foo(double * restrict a, double * restrict b, int n){
    int i;.
    for(i=0; i<n; ++i){
      a[i] = a[i] + b[i];
      __builtin_prefetch(&(b[i+8]));
    }
  }

Two intrinsics are added: masked_prefetch for continuous prefetch and masked_gather_prefetch for gather prefetch.
In vectorization, the implementation basically uses the Load/Store processing path.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156068

Files:
  llvm/include/llvm/Analysis/TargetTransformInfo.h
  llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
  llvm/include/llvm/CodeGen/BasicTTIImpl.h
  llvm/include/llvm/IR/IRBuilder.h
  llvm/include/llvm/IR/IntrinsicInst.h
  llvm/include/llvm/IR/Intrinsics.td
  llvm/lib/Analysis/TargetTransformInfo.cpp
  llvm/lib/Analysis/VectorUtils.cpp
  llvm/lib/IR/IRBuilder.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/VPlan.h
  llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156068.543343.patch
Type: text/x-patch
Size: 34769 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230724/1e36a704/attachment.bin>


More information about the llvm-commits mailing list