LLVM 20.0.0git
|
#include "llvm/Transforms/Scalar/Sink.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "sink" |
Functions | |
STATISTIC (NumSunk, "Number of instructions sunk") | |
STATISTIC (NumSinkIter, "Number of sinking iterations") | |
static bool | isSafeToMove (Instruction *Inst, AliasAnalysis &AA, SmallPtrSetImpl< Instruction * > &Stores) |
static bool | IsAcceptableTarget (Instruction *Inst, BasicBlock *SuccToSinkTo, DominatorTree &DT, LoopInfo &LI) |
IsAcceptableTarget - Return true if it is possible to sink the instruction in the specified basic block. | |
static bool | SinkInstruction (Instruction *Inst, SmallPtrSetImpl< Instruction * > &Stores, DominatorTree &DT, LoopInfo &LI, AAResults &AA) |
SinkInstruction - Determine whether it is safe to sink the specified machine instruction out of its current block into a successor. | |
static bool | ProcessBlock (BasicBlock &BB, DominatorTree &DT, LoopInfo &LI, AAResults &AA) |
static bool | iterativelySinkInstructions (Function &F, DominatorTree &DT, LoopInfo &LI, AAResults &AA) |
|
static |
IsAcceptableTarget - Return true if it is possible to sink the instruction in the specified basic block.
Definition at line 65 of file Sink.cpp.
References assert(), llvm::DominatorTree::dominates(), llvm::LoopInfoBase< BlockT, LoopT >::getLoopFor(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::BasicBlock::getUniquePredecessor(), llvm::Instruction::hasMetadata(), llvm::BasicBlock::isEHPad(), and llvm::Instruction::mayReadFromMemory().
Referenced by SinkInstruction().
|
static |
Definition at line 30 of file Sink.cpp.
References llvm::MemoryLocation::get(), llvm::AAResults::getModRefInfo(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::Instruction::isEHPad(), llvm::isModSet(), llvm::Instruction::isTerminator(), llvm::Instruction::mayThrow(), llvm::Instruction::mayWriteToMemory(), and llvm::Instruction::willReturn().
Referenced by SinkInstruction().
|
static |
Definition at line 212 of file Sink.cpp.
References llvm::dbgs(), F, I, LLVM_DEBUG, and ProcessBlock().
Referenced by llvm::SinkingPass::run().
|
static |
Definition at line 175 of file Sink.cpp.
References llvm::BasicBlock::begin(), llvm::BasicBlock::end(), I, llvm::Instruction::isDebugOrPseudoInst(), llvm::DominatorTree::isReachableFromEntry(), and SinkInstruction().
Referenced by iterativelySinkInstructions(), and llvm::MemorySSAUpdater::updateForClonedLoop().
|
static |
SinkInstruction - Determine whether it is safe to sink the specified machine instruction out of its current block into a successor.
Definition at line 102 of file Sink.cpp.
References llvm::dbgs(), llvm::DominatorTree::dominates(), llvm::DominatorTree::findNearestCommonDominator(), llvm::DomTreeNodeBase< NodeT >::getBlock(), llvm::BasicBlock::getFirstInsertionPt(), llvm::DomTreeNodeBase< NodeT >::getIDom(), llvm::PHINode::getIncomingValueNumForOperand(), llvm::DominatorTreeBase< NodeT, IsPostDom >::getNode(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), IsAcceptableTarget(), llvm::DominatorTree::isReachableFromEntry(), isSafeToMove(), LLVM_DEBUG, llvm::Instruction::moveBefore(), llvm::Value::printAsOperand(), and llvm::Value::uses().
Referenced by ProcessBlock().
STATISTIC | ( | NumSinkIter | , |
"Number of sinking iterations" | |||
) |
STATISTIC | ( | NumSunk | , |
"Number of instructions sunk" | |||
) |