LLVM: lib/Transforms/Utils/LoopUnrollAndJam.cpp File Reference (original) (raw)

Go to the source code of this file.

Macros
#define DEBUG_TYPE "loop-unroll-and-jam"
Functions
STATISTIC (NumUnrolledAndJammed, "Number of loops unroll and jammed")
STATISTIC (NumCompletelyUnrolledAndJammed, "Number of loops unroll and jammed")
static bool partitionLoopBlocks (Loop &L, BasicBlockSet &ForeBlocks, BasicBlockSet &AftBlocks, DominatorTree &DT)
static bool partitionOuterLoopBlocks (Loop &Root, Loop &JamLoop, BasicBlockSet &JamLoopBlocks, DenseMap< Loop *, BasicBlockSet > &ForeBlocksMap, DenseMap< Loop *, BasicBlockSet > &AftBlocksMap, DominatorTree &DT)
Partition blocks in a loop nest into blocks before and after each inner loop.
static bool partitionOuterLoopBlocks (Loop *L, Loop *SubLoop, BasicBlockSet &ForeBlocks, BasicBlockSet &SubLoopBlocks, BasicBlockSet &AftBlocks, DominatorTree *DT)
template<typename T>
static bool processHeaderPhiOperands (BasicBlock *Header, BasicBlock *Latch, BasicBlockSet &AftBlocks, T Visit)
static void moveHeaderPhiOperandsToForeBlocks (BasicBlock *Header, BasicBlock *Latch, BasicBlock::iterator InsertLoc, BasicBlockSet &AftBlocks)
static bool getLoadsAndStores (BasicBlockSet &Blocks, SmallVector< Instruction *, 4 > &MemInstr)
static bool preservesForwardDependence (Instruction *Src, Instruction *Dst, unsigned UnrollLevel, unsigned JamLevel, bool Sequentialized, Dependence *D)
static bool preservesBackwardDependence (Instruction *Src, Instruction *Dst, unsigned UnrollLevel, unsigned JamLevel, bool Sequentialized, Dependence *D)
static bool checkDependency (Instruction *Src, Instruction *Dst, unsigned UnrollLevel, unsigned JamLevel, bool Sequentialized, DependenceInfo &DI)
static bool checkDependencies (Loop &Root, const BasicBlockSet &SubLoopBlocks, const DenseMap< Loop *, BasicBlockSet > &ForeBlocksMap, const DenseMap< Loop *, BasicBlockSet > &AftBlocksMap, DependenceInfo &DI, LoopInfo &LI)
static bool isEligibleLoopForm (const Loop &Root)
static Loop * getInnerMostLoop (Loop *L)

DEBUG_TYPE

#define DEBUG_TYPE "loop-unroll-and-jam"

BasicBlockSet

checkDependencies()

Definition at line 755 of file LoopUnrollAndJam.cpp.

References llvm::SmallVectorTemplateCommon< T, typename >::begin(), checkDependency(), llvm::SmallVectorImpl< T >::clear(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::contains(), llvm::SmallVectorTemplateCommon< T, typename >::end(), getLoadsAndStores(), llvm::LoopBase< BlockT, LoopT >::getLoopDepth(), llvm::LoopInfoBase< BlockT, LoopT >::getLoopFor(), llvm::LoopBase< BlockT, LoopT >::getLoopsInPreorder(), I, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorTemplateCommon< T, typename >::size().

Referenced by llvm::isSafeToUnrollAndJam().

checkDependency()

Definition at line 691 of file LoopUnrollAndJam.cpp.

References assert(), D(), llvm::dbgs(), llvm::DependenceInfo::depends(), llvm::Dependence::DVEntry::EQ, llvm::Dependence::DVEntry::GT, llvm::isa(), LLVM_DEBUG, llvm::Dependence::DVEntry::LT, preservesBackwardDependence(), and preservesForwardDependence().

Referenced by checkDependencies().

getInnerMostLoop()

Loop * getInnerMostLoop ( Loop * L) static

getLoadsAndStores()

isEligibleLoopForm()

moveHeaderPhiOperandsToForeBlocks()

partitionLoopBlocks()

Definition at line 69 of file LoopUnrollAndJam.cpp.

References llvm::LoopBase< BlockT, LoopT >::contains(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::DominatorTree::dominates(), llvm::LoopBase< BlockT, LoopT >::getLoopLatch(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::SmallPtrSetImpl< PtrType >::insert(), and llvm::successors().

Referenced by partitionOuterLoopBlocks(), and partitionOuterLoopBlocks().

partitionOuterLoopBlocks() [1/2]

partitionOuterLoopBlocks() [2/2]

preservesBackwardDependence()

preservesForwardDependence()

processHeaderPhiOperands()

STATISTIC() [1/2]

STATISTIC ( NumCompletelyUnrolledAndJammed ,
"Number of loops unroll and jammed" )

STATISTIC() [2/2]

STATISTIC ( NumUnrolledAndJammed ,
"Number of loops unroll and jammed" )