LLVM: lib/CodeGen/LiveRangeShrink.cpp File Reference (original) (raw)
===------------------------------------------------------------------—===// More...
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) using InstOrderMap | |
| static MachineInstr * | FindDominatedInstruction (MachineInstr &New, MachineInstr *Old, const InstOrderMap &M) |
| Returns New if it's dominated by Old, otherwise return Old. | |
| static bool | isCodeMotionBarrier (MachineInstr &MI) |
| Returns whether this instruction is considered a code motion barrier by this pass. | |
| static void | BuildInstOrderMap (MachineBasicBlock::iterator Start, InstOrderMap &M) |
| Builds Instruction to its dominating order number map M by traversing from instruction Start. |
===------------------------------------------------------------------—===//
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.
◆ DEBUG_TYPE
#define DEBUG_TYPE "lrshrink"
◆ BuildInstOrderMap()
◆ FindDominatedInstruction()
◆ INITIALIZE_PASS()
| INITIALIZE_PASS | ( | LiveRangeShrink | , |
|---|---|---|---|
| "lrshrink" | , | ||
| "Live Range Shrink Pass" | , | ||
| false | , | ||
| false | ) |
◆ isCodeMotionBarrier()
Returns whether this instruction is considered a code motion barrier by this pass.
We can be less conservative than hasUnmodeledSideEffects() when deciding whether an instruction is a barrier because it is known that pseudo probes are safe to move in this pass specifically (see commit 1cb47a063e2b).
Definition at line 102 of file LiveRangeShrink.cpp.
References MI.
Referenced by BuildInstOrderMap().
◆ STATISTIC()
| STATISTIC | ( | NumInstrsHoistedToShrinkLiveRange | , |
|---|---|---|---|
| "Number of insructions hoisted to shrink live range." | ) |