Lines Matching refs:virtReg
171 bool hasPhys(unsigned virtReg) const {
172 return getPhys(virtReg) != NO_PHYS_REG;
177 unsigned getPhys(unsigned virtReg) const {
178 assert(TargetRegisterInfo::isVirtualRegister(virtReg));
179 return Virt2PhysMap[virtReg];
184 void assignVirt2Phys(unsigned virtReg, unsigned physReg) {
185 assert(TargetRegisterInfo::isVirtualRegister(virtReg) &&
187 assert(Virt2PhysMap[virtReg] == NO_PHYS_REG &&
190 Virt2PhysMap[virtReg] = physReg;
195 void clearVirt(unsigned virtReg) {
196 assert(TargetRegisterInfo::isVirtualRegister(virtReg));
197 assert(Virt2PhysMap[virtReg] != NO_PHYS_REG &&
199 Virt2PhysMap[virtReg] = NO_PHYS_REG;
209 unsigned getRegAllocPref(unsigned virtReg);
211 /// @brief returns true if VirtReg is assigned to its preferred physreg.
212 bool hasPreferredPhys(unsigned VirtReg) {
213 return getPhys(VirtReg) == getRegAllocPref(VirtReg);
216 /// @brief records virtReg is a split live interval from SReg.
217 void setIsSplitFromReg(unsigned virtReg, unsigned SReg) {
218 Virt2SplitMap[virtReg] = SReg;
221 /// @brief returns the live interval virtReg is split from.
222 unsigned getPreSplitReg(unsigned virtReg) const {
223 return Virt2SplitMap[virtReg];
226 /// getOriginal - Return the original virtual register that VirtReg descends
230 unsigned getOriginal(unsigned VirtReg) const {
231 unsigned Orig = getPreSplitReg(VirtReg);
232 return Orig ? Orig : VirtReg;
237 bool isAssignedReg(unsigned virtReg) const {
238 if (getStackSlot(virtReg) == NO_STACK_SLOT &&
239 getReMatId(virtReg) == NO_STACK_SLOT)
243 return (Virt2SplitMap[virtReg] && Virt2PhysMap[virtReg] != NO_PHYS_REG);
248 int getStackSlot(unsigned virtReg) const {
249 assert(TargetRegisterInfo::isVirtualRegister(virtReg));
250 return Virt2StackSlotMap[virtReg];
255 int getReMatId(unsigned virtReg) const {
256 assert(TargetRegisterInfo::isVirtualRegister(virtReg));
257 return Virt2ReMatIdMap[virtReg];
262 int assignVirt2StackSlot(unsigned virtReg);
265 void assignVirt2StackSlot(unsigned virtReg, int frameIndex);
269 int assignVirtReMatId(unsigned virtReg);
272 void assignVirtReMatId(unsigned virtReg, int id);
276 bool isReMaterialized(unsigned virtReg) const {
277 return ReMatMap[virtReg] != NULL;
282 MachineInstr *getReMaterializedMI(unsigned virtReg) const {
283 return ReMatMap[virtReg];
290 void setVirtIsReMaterialized(unsigned virtReg, MachineInstr *def) {
291 ReMatMap[virtReg] = def;
295 void addKillPoint(unsigned virtReg, SlotIndex index) {
296 Virt2SplitKillMap[virtReg] = index;
299 SlotIndex getKillPoint(unsigned virtReg) const {
300 return Virt2SplitKillMap[virtReg];
304 void removeKillPoint(unsigned virtReg) {
305 Virt2SplitKillMap[virtReg] = SlotIndex();
319 /// @brief records the specified MachineInstr as a spill point for virtReg.
320 void addSpillPoint(unsigned virtReg, bool isKill, MachineInstr *Pt) {
324 I->second.push_back(std::make_pair(virtReg, isKill));
327 Virts.push_back(std::make_pair(virtReg, isKill));
340 unsigned virtReg = I->second.back().first;
343 addSpillPoint(virtReg, isKill, New);
359 /// @brief records the specified MachineInstr as a restore point for virtReg.
360 void addRestorePoint(unsigned virtReg, MachineInstr *Pt) {
364 I->second.push_back(virtReg);
367 Virts.push_back(virtReg);
380 unsigned virtReg = I->second.back();
382 addRestorePoint(virtReg, New);
419 unsigned virtReg = I->second.back();
421 addEmergencySpill(virtReg, New);
449 void setIsImplicitlyDefined(unsigned VirtReg) {
450 ImplicitDefed.set(TargetRegisterInfo::virtReg2Index(VirtReg));
454 bool isImplicitlyDefined(unsigned VirtReg) const {
455 return ImplicitDefed[TargetRegisterInfo::virtReg2Index(VirtReg)];
460 void virtFolded(unsigned VirtReg, MachineInstr *OldMI, MachineInstr *NewMI,
465 void virtFolded(unsigned VirtReg, MachineInstr *MI, ModRef MRInfo);