struct Prefetch

Declaration

struct Prefetch { /* full declaration omitted */ };

Description

A record for a potential prefetch made during the initial scan of the loop. This is used to let a single prefetch target multiple memory accesses.

Declared at: llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp:234

Member Variables

public const llvm::SCEVAddRecExpr* LSCEVAddRec
The address formula for this prefetch as returned by ScalarEvolution.
public llvm::Instruction* InsertPt = nullptr
The point of insertion for the prefetch instruction.
public bool Writes = false
True if targeting a write memory access.
public llvm::Instruction* MemI = nullptr
The (first seen) prefetched instruction.

Method Overview

  • public Prefetch(const llvm::SCEVAddRecExpr * L, llvm::Instruction * I)
  • public void addInstruction(llvm::Instruction * I, llvm::DominatorTree * DT = nullptr, int64_t PtrDiff = 0)

Methods

Prefetch(const llvm::SCEVAddRecExpr* L,
         llvm::Instruction* I)

Description

Constructor to create a new Prefetch for \p I.

Declared at: llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp:245

Parameters

const llvm::SCEVAddRecExpr* L
llvm::Instruction* I

void addInstruction(
    llvm::Instruction* I,
    llvm::DominatorTree* DT = nullptr,
    int64_t PtrDiff = 0)

Description

Add the instruction

Declared at: llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp:253

Parameters

llvm::Instruction* I
to this prefetch. If it's not the first one, 'InsertPt' and 'Writes' will be updated as required.
llvm::DominatorTree* DT = nullptr
int64_t PtrDiff = 0
the known constant address difference to the first added instruction.