llvm.org GIT mirror llvm / dde3a9a
add routines to track the livein/out set for a function git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21179 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 15 years ago
1 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
104104 /// for other target specific uses.
105105 bool *UsedPhysRegs;
106106
107 /// LiveIns/LiveOuts - Keep track of the physical registers that are
108 /// livein/liveout of the function. Live in values are typically arguments in
109 /// registers, live out values are typically return values in registers.
110 std::vector LiveIns, LiveOuts;
111
107112 public:
108113 MachineFunction(const Function *Fn, const TargetMachine &TM);
109114 ~MachineFunction();
165170 /// changePhyRegUsed - This method allows code that runs after register
166171 /// allocation to keep the PhysRegsUsed array up-to-date.
167172 void changePhyRegUsed(unsigned Reg, bool State) { UsedPhysRegs[Reg] = State; }
173
174
175 // LiveIn/LiveOut management methods.
176
177 /// addLiveIn/Out - Add the specified register as a live in/out. Note that it
178 /// is an error to add the same register to the same set more than once.
179 void addLiveIn(unsigned Reg) { LiveIns.push_back(Reg); }
180 void addLiveOut(unsigned Reg) { LiveOuts.push_back(Reg); }
181
182 // Iteration support for live in/out sets. These sets are kept in sorted
183 // order by their register number.
184 typedef std::vector::const_iterator liveinout_iterator;
185 liveinout_iterator livein_begin() const { return LiveIns.begin(); }
186 liveinout_iterator livein_end() const { return LiveIns.end(); }
187 liveinout_iterator liveout_begin() const { return LiveOuts.begin(); }
188 liveinout_iterator liveout_end() const { return LiveOuts.end(); }
168189
169190 /// getBlockNumbered - MachineBasicBlocks are automatically numbered when they
170191 /// are inserted into the machine function. The block number for a machine