llvm.org GIT mirror llvm / 51d6e76
add a comment that I should have written a long time ago git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25084 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 14 years ago
1 changed file(s) with 28 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
3737
3838 class LiveVariables : public MachineFunctionPass {
3939 public:
40 /// VarInfo - This represents the regions where a virtual register is live in
41 /// the program. We represent this with three difference pieces of
42 /// information: the instruction that uniquely defines the value, the set of
43 /// blocks the instruction is live into and live out of, and the set of
44 /// non-phi instructions that are the last users of the value.
45 ///
46 /// In the common case where a value is defined and killed in the same block,
47 /// DefInst is the defining inst, there is one killing instruction, and
48 /// AliveBlocks is empty.
49 ///
50 /// Otherwise, the value is live out of the block. If the value is live
51 /// across any blocks, these blocks are listed in AliveBlocks. Blocks where
52 /// the liveness range ends are not included in AliveBlocks, instead being
53 /// captured by the Kills set. In these blocks, the value is live into the
54 /// block (unless the value is defined and killed in the same block) and lives
55 /// until the specified instruction. Note that there cannot ever be a value
56 /// whose Kills set contains two instructions from the same basic block.
57 ///
58 /// PHI nodes complicate things a bit. If a PHI node is the last user of a
59 /// value in one of its predecessor blocks, it is not listed in the kills set,
60 /// but does include the predecessor block in the AliveBlocks set (unless that
61 /// block also defines the value). This leads to the (perfectly sensical)
62 /// situation where a value is defined in a block, and the last use is a phi
63 /// node in the successor. In this case, DefInst will be the defining
64 /// instruction, AliveBlocks is empty (the value is not live across any
65 /// blocks) and Kills is empty (phi nodes are not included). This is sensical
66 /// because the value must be live to the end of the block, but is not live in
67 /// any successor blocks.
4068 struct VarInfo {
4169 /// DefInst - The machine instruction that defines this register.
4270 ///