This is an archive of the discontinued LLVM Phabricator instance.

[WIP] Vectorization for __builtin_prefetch
Needs ReviewPublic

Authored by m-saito-fj on Jul 23 2023, 7:00 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

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

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.

https://discourse.llvm.org/t/rfc-loop-vectorization-for-builtin-prefetch/72234

Diff Detail

Event Timeline

m-saito-fj created this revision.Jul 23 2023, 7:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2023, 7:00 PM
m-saito-fj requested review of this revision.Jul 23 2023, 7:00 PM
m-saito-fj edited the summary of this revision. (Show Details)Jul 23 2023, 7:01 PM
m-saito-fj edited the summary of this revision. (Show Details)Jul 23 2023, 7:25 PM
mdchen added a subscriber: mdchen.Aug 1 2023, 1:46 AM