LLVM  5.0.0
Macros | Functions
LiveRangeShrink.cpp File Reference

===------------------------------------------------------------------—===// More...

#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/Debug.h"
Include dependency graph for LiveRangeShrink.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "lrshrink"
 

Functions

 STATISTIC (NumInstrsHoistedToShrinkLiveRange,"Number of insructions hoisted to shrink live range.")
 
 INITIALIZE_PASS (LiveRangeShrink,"lrshrink","Live Range Shrink Pass", false, false) namespace
 

Detailed Description

===------------------------------------------------------------------—===//

This pass moves instructions close to the definition of its operands to shrink live range of the def instruction. The code motion is limited within the basic block. The moved instruction should have 1 def, and more than one uses, all of which are the only use of the def.

===------------------------------------------------------------------—===//

Definition in file LiveRangeShrink.cpp.

Macro Definition Documentation

#define DEBUG_TYPE   "lrshrink"

Definition at line 23 of file LiveRangeShrink.cpp.

Function Documentation

INITIALIZE_PASS ( LiveRangeShrink  ,
"lrshrink"  ,
"Live Range Shrink Pass"  ,
false  ,
false   
)

Returns New if it's dominated by Old, otherwise return Old. M maintains a map from instruction to its dominating order that satisfies M[A] > M[B] guarantees that A is dominated by B. If New is not in M, return Old. Otherwise if Old is null, return New.

Builds Instruction to its dominating order number map M by traversing from instruction Start.

Definition at line 53 of file LiveRangeShrink.cpp.

References llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), I, and llvm::make_range().

STATISTIC ( NumInstrsHoistedToShrinkLiveRange  ,
"Number of insructions hoisted to shrink live range."   
)