llvm.org GIT mirror llvm / d6b210c
Expose more information from register allocation to passes that run after it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19788 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 15 years ago
1 changed file(s) with 26 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
9696 // numbered and this vector keeps track of the mapping from ID's to MBB's.
9797 std::vector MBBNumbering;
9898
99 /// UsedPhysRegs - This is a new[]'d array of bools that is computed and set
100 /// by the register allocator, and must be kept up to date by passes that run
101 /// after register allocation (though most don't modify this). This is used
102 /// so that the code generator knows which callee save registers to save and
103 /// for other target specific uses.
104 bool *UsedPhysRegs;
105
99106 public:
100107 MachineFunction(const Function *Fn, const TargetMachine &TM);
101108 ~MachineFunction();
136143 "Invalid concrete type or multiple inheritence for getInfo");
137144 return static_cast(MFInfo);
138145 }
146
147 /// setUsedPhysRegs - The register allocator should call this to initialized
148 /// the UsedPhysRegs set. This should be passed a new[]'d array with entries
149 /// for all of the physical registers that the target supports. Each array
150 /// entry should be set to true iff the physical register is used within the
151 /// function.
152 void setUsedPhysRegs(bool *UPR) { UsedPhysRegs = UPR; }
153
154 /// getUsedPhysregs - This returns the UsedPhysRegs array. This returns null
155 /// before register allocation.
156 const bool *getUsedPhysregs() { return UsedPhysRegs; }
157
158 /// isPhysRegUsed - Return true if the specified register is used in this
159 /// function. This only works after register allocation.
160 bool isPhysRegUsed(unsigned Reg) { return UsedPhysRegs[Reg]; }
161
162 /// changePhyRegUsed - This method allows code that runs after register
163 /// allocation to keep the PhysRegsUsed array up-to-date.
164 void changePhyRegUsed(unsigned Reg, bool State) { UsedPhysRegs[Reg] = State; }
139165
140166 /// getBlockNumbered - MachineBasicBlocks are automatically numbered when they
141167 /// are inserted into the machine function. The block number for a machine