Go to the source code of this file.
|
| STATISTIC (NumNotRotatedDueToHeaderSize, "Number of loops not rotated due to the header size") |
|
| STATISTIC (NumInstrsHoisted, "Number of instructions hoisted into loop preheader") |
|
| STATISTIC (NumInstrsDuplicated, "Number of instructions cloned into loop preheader") |
|
| STATISTIC (NumRotated, "Number of loops rotated") |
|
static void | InsertNewValueIntoMap (ValueToValueMapTy &VM, Value *K, Value *V) |
| Insert (K, V) pair into the ValueToValueMap, and verify the key did not previously exist in the map, and the value was inserted.
|
|
static void | RewriteUsesOfClonedInstructions (BasicBlock *OrigHeader, BasicBlock *OrigPreheader, ValueToValueMapTy &ValueMap, ScalarEvolution *SE, SmallVectorImpl< PHINode * > *InsertedPHIs) |
| RewriteUsesOfClonedInstructions - We just cloned the instructions from the old header into the preheader.
|
|
static bool | profitableToRotateLoopExitingLatch (Loop *L) |
|
static bool | canRotateDeoptimizingLatchExit (Loop *L) |
|
static void | updateBranchWeights (BranchInst &PreHeaderBI, BranchInst &LoopBI, bool HasConditionalPreHeader, bool SuccsSwapped) |
|
static bool | shouldSpeculateInstrs (BasicBlock::iterator Begin, BasicBlock::iterator End, Loop *L) |
| Determine whether the instructions in this range may be safely and cheaply speculated.
|
|
◆ DEBUG_TYPE
#define DEBUG_TYPE "loop-rotate" |
◆ canRotateDeoptimizingLatchExit()
static bool canRotateDeoptimizingLatchExit |
( |
Loop * |
L | ) |
|
|
static |
◆ InsertNewValueIntoMap()
◆ profitableToRotateLoopExitingLatch()
static bool profitableToRotateLoopExitingLatch |
( |
Loop * |
L | ) |
|
|
static |
◆ RewriteUsesOfClonedInstructions()
RewriteUsesOfClonedInstructions - We just cloned the instructions from the old header into the preheader.
If there were uses of the values produced by these instruction that were outside of the loop, we have to insert PHI nodes to merge the two values. Do this now.
Definition at line 101 of file LoopRotationUtils.cpp.
References llvm::BasicBlock::begin(), llvm::BasicBlock::end(), llvm::findDbgValues(), llvm::ScalarEvolution::forgetValue(), llvm::UndefValue::get(), llvm::BasicBlock::getMarker(), llvm::Value::getName(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::DbgMarker::getParent(), llvm::Value::getType(), I, llvm::ValueMap< KeyT, ValueT, Config >::lookup(), llvm::make_early_inc_range(), SSA, llvm::Value::use_empty(), and llvm::Value::uses().
◆ shouldSpeculateInstrs()
◆ STATISTIC() [1/4]
STATISTIC |
( |
NumInstrsDuplicated |
, |
|
|
"Number of instructions cloned into loop preheader" |
|
|
) |
| |
◆ STATISTIC() [2/4]
STATISTIC |
( |
NumInstrsHoisted |
, |
|
|
"Number of instructions hoisted into loop preheader" |
|
|
) |
| |
◆ STATISTIC() [3/4]
STATISTIC |
( |
NumNotRotatedDueToHeaderSize |
, |
|
|
"Number of loops not rotated due to the header size" |
|
|
) |
| |
◆ STATISTIC() [4/4]
STATISTIC |
( |
NumRotated |
, |
|
|
"Number of loops rotated" |
|
|
) |
| |
◆ updateBranchWeights()
◆ MultiRotate
cl::opt< bool > MultiRotate("loop-rotate-multi", cl::init(false), cl::Hidden, cl::desc("Allow loop rotation multiple times in order to reach " "a better latch exit")) |
( |
"loop-rotate-multi" |
, |
|
|
cl::init(false) |
, |
|
|
cl::Hidden |
, |
|
|
cl::desc("Allow loop rotation multiple times in order to reach " "a better latch exit") |
|
|
) |
| |
|
static |
◆ ZeroTripCountWeights
constexpr uint32_t ZeroTripCountWeights[] = {1, 127} |
|
staticconstexpr |