class InterleaveGroup

Declaration

template <typename InstTy>
class InterleaveGroup { /* full declaration omitted */ };

Description

The group of interleaved loads/stores sharing the same stride and close to each other. Each member in this group has an index starting from 0, and the largest index should be less than interleaved factor, which is equal to the absolute value of the access's stride. E.g. An interleaved load group of factor 4: for (unsigned i = 0; i < 1024; i+=4) { a = A[i]; // Member of index 0 b = A[i+1]; // Member of index 1 d = A[i+3]; // Member of index 3 ... } An interleaved store group of factor 4: for (unsigned i = 0; i < 1024; i+=4) { ... A[i] = a; // Member of index 0 A[i+1] = b; // Member of index 1 A[i+2] = c; // Member of index 2 A[i+3] = d; // Member of index 3 } Note: the interleaved load group could have gaps (missing members), but the interleaved store group doesn't allow gaps.

Declared at: llvm/include/llvm/Analysis/VectorUtils.h:609

Templates

InstTy

Member Variables

private uint32_t Factor
private bool Reverse
private llvm::Align Alignment
private DenseMap<int32_t, InstTy*> Members
private int32_t SmallestKey = 0
private int32_t LargestKey = 0
private InstTy* InsertPos

Method Overview

Methods

InterleaveGroup<InstTy>(uint32_t Factor,
                        bool Reverse,
                        llvm::Align Alignment)

Declared at: llvm/include/llvm/Analysis/VectorUtils.h:611

Parameters

uint32_t Factor
bool Reverse
llvm::Align Alignment

InterleaveGroup<InstTy>(InstTy* Instr,
                        int32_t Stride,
                        llvm::Align Alignment)

Declared at: llvm/include/llvm/Analysis/VectorUtils.h:615

Parameters

InstTy* Instr
int32_t Stride
llvm::Align Alignment

void addMetadata(InstTy* NewInst) const

Description

Add metadata (e.g. alias info) from the instructions in this group to \p NewInst. FIXME: this function currently does not add noalias metadata a'la addNewMedata. To do that we need to compute the intersection of the noalias info from all members.

Declared at: llvm/include/llvm/Analysis/VectorUtils.h:704

Parameters

InstTy* NewInst

llvm::Align getAlign() const

Declared at: llvm/include/llvm/Analysis/VectorUtils.h:626

uint32_t getFactor() const

Declared at: llvm/include/llvm/Analysis/VectorUtils.h:625

uint32_t getIndex(const InstTy* Instr) const

Description

Get the index for the given member. Unlike the key in the member map, the index starts from 0.

Declared at: llvm/include/llvm/Analysis/VectorUtils.h:686

Parameters

const InstTy* Instr

InstTy* getInsertPos() const

Declared at: llvm/include/llvm/Analysis/VectorUtils.h:695

InstTy* getMember(uint32_t Index) const

Description

Get the member with the given index \p Index

Declared at: llvm/include/llvm/Analysis/VectorUtils.h:679

Parameters

uint32_t Index

Returns

nullptr if contains no such member.

uint32_t getNumMembers() const

Declared at: llvm/include/llvm/Analysis/VectorUtils.h:627

bool insertMember(InstTy* Instr,
                  int32_t Index,
                  llvm::Align NewAlign)

Description

Try to insert a new member \p Instr with index \p Index and alignment \p NewAlign. The index is related to the leader and it could be negative if it is the new leader.

Declared at: llvm/include/llvm/Analysis/VectorUtils.h:634

Parameters

InstTy* Instr
int32_t Index
llvm::Align NewAlign

Returns

false if the instruction doesn't belong to the group.

bool isReverse() const

Declared at: llvm/include/llvm/Analysis/VectorUtils.h:624

bool requiresScalarEpilogue() const

Description

Returns true if this Group requires a scalar iteration to handle gaps.

Declared at: llvm/include/llvm/Analysis/VectorUtils.h:707

void setInsertPos(InstTy* Inst)

Declared at: llvm/include/llvm/Analysis/VectorUtils.h:696

Parameters

InstTy* Inst