struct BoUpSLP::BlockScheduling

Declaration

struct BoUpSLP::BlockScheduling { /* full declaration omitted */ };

Description

Contains all scheduling data for a basic block.

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:1934

Member Variables

public llvm::BasicBlock* BB
public std::vector<std::unique_ptr<ScheduleData[]>> ScheduleDataChunks
Simple memory allocation for ScheduleData.
public int ChunkSize
The size of a ScheduleData array in ScheduleDataChunks.
public int ChunkPos
The allocator position in the current chunk, which is the last entry of ScheduleDataChunks.
public DenseMap< llvm::Value*, llvm::slpvectorizer::BoUpSLP::ScheduleData*> ScheduleDataMap
Attaches ScheduleData to Instruction. Note that the mapping survives during all vectorization iterations, i.e. ScheduleData structures are recycled.
public DenseMap< llvm::Value*, SmallDenseMap<llvm::Value*, llvm::slpvectorizer::BoUpSLP:: ScheduleData*>> ExtraScheduleDataMap
Attaches ScheduleData to Instruction with the leading key.
public llvm::slpvectorizer::BoUpSLP::BlockScheduling:: ReadyList ReadyInsts
The ready-list for scheduling (only used for the dry-run).
public llvm::Instruction* ScheduleStart = nullptr
The first instruction of the scheduling region.
public llvm::Instruction* ScheduleEnd = nullptr
The first instruction _after_ the scheduling region.
public llvm::slpvectorizer::BoUpSLP::ScheduleData* FirstLoadStoreInRegion = nullptr
The first memory accessing instruction in the scheduling region (can be null).
public llvm::slpvectorizer::BoUpSLP::ScheduleData* LastLoadStoreInRegion = nullptr
The last memory accessing instruction in the scheduling region (can be null).
public int ScheduleRegionSize = 0
The current size of the scheduling region.
public int ScheduleRegionSizeLimit = ScheduleRegionSizeBudget
The maximum size allowed for the scheduling region.
public int SchedulingRegionID = 1
The ID of the scheduling region. For a new vectorization iteration this is incremented which "removes" all ScheduleData from the region.

Method Overview

  • public BlockScheduling(llvm::BasicBlock * BB)
  • public llvm::slpvectorizer::BoUpSLP::ScheduleData * allocateScheduleDataChunks()
  • public void calculateDependencies(llvm::slpvectorizer::BoUpSLP::ScheduleData * SD, bool InsertInReadyList, llvm::slpvectorizer::BoUpSLP * SLP)
  • public void cancelScheduling(ArrayRef<llvm::Value *> VL, llvm::Value * OpValue)
  • public void clear()
  • public void doForAllOpcodes(llvm::Value * V, function_ref<void (llvm::slpvectorizer::BoUpSLP::ScheduleData *)> Action)
  • public bool extendSchedulingRegion(llvm::Value * V, const (anonymous namespace)::InstructionsState & S)
  • public llvm::slpvectorizer::BoUpSLP::ScheduleData * getScheduleData(llvm::Value * V)
  • public llvm::slpvectorizer::BoUpSLP::ScheduleData * getScheduleData(llvm::Value * V, llvm::Value * Key)
  • public void initScheduleData(llvm::Instruction * FromI, llvm::Instruction * ToI, llvm::slpvectorizer::BoUpSLP::ScheduleData * PrevLoadStore, llvm::slpvectorizer::BoUpSLP::ScheduleData * NextLoadStore)
  • public template <typename ReadyListType>void initialFillReadyList(ReadyListType & ReadyList)
  • public bool isInSchedulingRegion(llvm::slpvectorizer::BoUpSLP::ScheduleData * SD) const
  • public void resetSchedule()
  • public template <typename ReadyListType>void schedule(llvm::slpvectorizer::BoUpSLP::ScheduleData * SD, ReadyListType & ReadyList)
  • public Optional<llvm::slpvectorizer::BoUpSLP::ScheduleData *> tryScheduleBundle(ArrayRef<llvm::Value *> VL, llvm::slpvectorizer::BoUpSLP * SLP, const (anonymous namespace)::InstructionsState & S)

Methods

BlockScheduling(llvm::BasicBlock* BB)

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:1935

Parameters

llvm::BasicBlock* BB

llvm::slpvectorizer::BoUpSLP::ScheduleData*
allocateScheduleDataChunks()

Description

Allocates schedule data chunk.

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2085

void calculateDependencies(
    llvm::slpvectorizer::BoUpSLP::ScheduleData*
        SD,
    bool InsertInReadyList,
    llvm::slpvectorizer::BoUpSLP* SLP)

Description

Updates the dependency information of a bundle and of all instructions/ bundles which depend on the original bundle.

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2099

Parameters

llvm::slpvectorizer::BoUpSLP::ScheduleData* SD
bool InsertInReadyList
llvm::slpvectorizer::BoUpSLP* SLP

void cancelScheduling(ArrayRef<llvm::Value*> VL,
                      llvm::Value* OpValue)

Description

Un-bundles a group of instructions.

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2082

Parameters

ArrayRef<llvm::Value*> VL
llvm::Value* OpValue

void clear()

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:1938

void doForAllOpcodes(
    llvm::Value* V,
    function_ref<void(llvm::slpvectorizer::
                          BoUpSLP::ScheduleData*)>
        Action)

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2047

Parameters

llvm::Value* V
function_ref<void( llvm::slpvectorizer::BoUpSLP::ScheduleData*)> Action

bool extendSchedulingRegion(
    llvm::Value* V,
    const(anonymous namespace)::InstructionsState&
        S)

Description

Extends the scheduling region so that V is inside the region.

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2089

Parameters

llvm::Value* V
const(anonymous namespace)::InstructionsState& S

Returns

true if the region size is within the limit.

llvm::slpvectorizer::BoUpSLP::ScheduleData*
getScheduleData(llvm::Value* V)

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:1957

Parameters

llvm::Value* V

llvm::slpvectorizer::BoUpSLP::ScheduleData*
getScheduleData(llvm::Value* V, llvm::Value* Key)

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:1964

Parameters

llvm::Value* V
llvm::Value* Key

void initScheduleData(
    llvm::Instruction* FromI,
    llvm::Instruction* ToI,
    llvm::slpvectorizer::BoUpSLP::ScheduleData*
        PrevLoadStore,
    llvm::slpvectorizer::BoUpSLP::ScheduleData*
        NextLoadStore)

Description

Initialize the ScheduleData structures for new instructions in the scheduling region.

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2093

Parameters

llvm::Instruction* FromI
llvm::Instruction* ToI
llvm::slpvectorizer::BoUpSLP::ScheduleData* PrevLoadStore
llvm::slpvectorizer::BoUpSLP::ScheduleData* NextLoadStore

template <typename ReadyListType>
void initialFillReadyList(
    ReadyListType& ReadyList)

Description

Put all instructions into the ReadyList which are ready for scheduling.

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2060

Templates

ReadyListType

Parameters

ReadyListType& ReadyList

bool isInSchedulingRegion(
    llvm::slpvectorizer::BoUpSLP::ScheduleData*
        SD) const

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:1976

Parameters

llvm::slpvectorizer::BoUpSLP::ScheduleData* SD

void resetSchedule()

Description

Sets all instruction in the scheduling region to un-scheduled.

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2103

template <typename ReadyListType>
void schedule(
    llvm::slpvectorizer::BoUpSLP::ScheduleData*
        SD,
    ReadyListType& ReadyList)

Description

Marks an instruction as scheduled and puts all dependent ready instructions into the ready-list.

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:1983

Templates

ReadyListType

Parameters

llvm::slpvectorizer::BoUpSLP::ScheduleData* SD
ReadyListType& ReadyList

Optional<
    llvm::slpvectorizer::BoUpSLP::ScheduleData*>
tryScheduleBundle(
    ArrayRef<llvm::Value*> VL,
    llvm::slpvectorizer::BoUpSLP* SLP,
    const(anonymous namespace)::InstructionsState&
        S)

Description

Checks if a bundle of instructions can be scheduled, i.e. has no cyclic dependencies. This is only a dry-run, no instructions are actually moved at this stage.

Declared at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2078

Parameters

ArrayRef<llvm::Value*> VL
llvm::slpvectorizer::BoUpSLP* SLP
const(anonymous namespace)::InstructionsState& S

Returns

the scheduling bundle. The returned Optional value is non-None if \p VL is allowed to be scheduled.