LLVM 22.0.0git
CodeMoverUtils.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "codemover-utils"

Functions

 STATISTIC (HasDependences, "Cannot move across instructions that has memory dependences")
 STATISTIC (MayThrowException, "Cannot move across instructions that may throw")
 STATISTIC (NotControlFlowEquivalent, "Instructions are not control flow equivalent")
 STATISTIC (NotMovedPHINode, "Movement of PHINodes are not supported")
 STATISTIC (NotMovedTerminator, "Movement of Terminator are not supported")
static bool domTreeLevelBefore (DominatorTree *DT, const Instruction *InstA, const Instruction *InstB)
static bool reportInvalidCandidate (const Instruction &I, llvm::Statistic &Stat)
static void collectInstructionsInBetween (Instruction &StartInst, const Instruction &EndInst, SmallPtrSetImpl< Instruction * > &InBetweenInsts)
 Collect all instructions in between StartInst and EndInst, and store them in InBetweenInsts.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "codemover-utils"

Definition at line 23 of file CodeMoverUtils.cpp.

Function Documentation

◆ collectInstructionsInBetween()

void collectInstructionsInBetween ( Instruction & StartInst,
const Instruction & EndInst,
SmallPtrSetImpl< Instruction * > & InBetweenInsts )
static

Collect all instructions in between StartInst and EndInst, and store them in InBetweenInsts.

Get the next instructions of I, and push them to WorkList.

Definition at line 280 of file CodeMoverUtils.cpp.

References assert(), llvm::SmallPtrSetImpl< PtrType >::begin(), llvm::SmallPtrSetImplBase::empty(), llvm::SmallPtrSetImpl< PtrType >::erase(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), and llvm::successors().

Referenced by llvm::isSafeToMoveBefore().

◆ domTreeLevelBefore()

◆ reportInvalidCandidate()

bool reportInvalidCandidate ( const Instruction & I,
llvm::Statistic & Stat )
static

Definition at line 269 of file CodeMoverUtils.cpp.

References llvm::dbgs(), I, and LLVM_DEBUG.

Referenced by llvm::isSafeToMoveBefore().

◆ STATISTIC() [1/5]

STATISTIC ( HasDependences ,
"Cannot move across instructions that has memory dependences"  )

◆ STATISTIC() [2/5]

STATISTIC ( MayThrowException ,
"Cannot move across instructions that may throw"  )

◆ STATISTIC() [3/5]

STATISTIC ( NotControlFlowEquivalent ,
"Instructions are not control flow equivalent"  )

◆ STATISTIC() [4/5]

STATISTIC ( NotMovedPHINode ,
"Movement of PHINodes are not supported"  )

◆ STATISTIC() [5/5]

STATISTIC ( NotMovedTerminator ,
"Movement of Terminator are not supported"  )

References llvm::CallingConv::C.