llvm.org GIT mirror llvm / 881a05b
misched: handle on-the-fly regpressure queries better for 2-addr instructions without relying on liveintervals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167526 91177308-0d34-0410-b5e6-96231b3b80d8 Andrew Trick 7 years ago
2 changed file(s) with 15 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
4242 /// class. This is only useful to account for spilling or rematerialization.
4343 void decrease(const TargetRegisterClass *RC, const TargetRegisterInfo *TRI);
4444
45 void dump(const TargetRegisterInfo *TRI);
45 void dump(const TargetRegisterInfo *TRI) const;
4646 };
4747
4848 /// RegisterPressure computed within a region of instructions delimited by
196196 /// This result is complete if either advance() or recede() has returned true,
197197 /// or if closeRegion() was explicitly invoked.
198198 RegisterPressure &getPressure() { return P; }
199 const RegisterPressure &getPressure() const { return P; }
199200
200201 /// Get the register set pressure at the current position, which may be less
201202 /// than the pressure across the traversed region.
6363 }
6464
6565 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
66 void RegisterPressure::dump(const TargetRegisterInfo *TRI) {
66 void RegisterPressure::dump(const TargetRegisterInfo *TRI) const {
6767 dbgs() << "Live In: ";
6868 for (unsigned i = 0, e = LiveInRegs.size(); i < e; ++i)
6969 dbgs() << PrintReg(LiveInRegs[i], TRI) << " ";
321321 if (findReg(MO.getReg(), isVReg, DeadDefs, TRI) == DeadDefs.end())
322322 DeadDefs.push_back(MO.getReg());
323323 }
324 else {
325 if (findReg(MO.getReg(), isVReg, Defs, TRI) == Defs.end())
326 Defs.push_back(MO.getReg());
327 }
324 else if (findReg(MO.getReg(), isVReg, Defs, TRI) == Defs.end())
325 Defs.push_back(MO.getReg());
328326 }
329327 }
330328 };
675673 decreaseVirtRegPressure(VirtRegOpers.DeadDefs);
676674
677675 // Kill liveness at live defs.
678 decreasePhysRegPressure(PhysRegOpers.Defs);
679 decreaseVirtRegPressure(VirtRegOpers.Defs);
680
676 for (unsigned i = 0, e = PhysRegOpers.Defs.size(); i < e; ++i) {
677 unsigned Reg = PhysRegOpers.Defs[i];
678 if (!findReg(Reg, false, PhysRegOpers.Uses, TRI))
679 decreasePhysRegPressure(PhysRegOpers.Defs);
680 }
681 for (unsigned i = 0, e = VirtRegOpers.Defs.size(); i < e; ++i) {
682 unsigned Reg = VirtRegOpers.Defs[i];
683 if (!findReg(Reg, true, VirtRegOpers.Uses, TRI))
684 decreaseVirtRegPressure(VirtRegOpers.Defs);
685 }
681686 // Generate liveness for uses.
682687 for (unsigned i = 0, e = PhysRegOpers.Uses.size(); i < e; ++i) {
683688 unsigned Reg = PhysRegOpers.Uses[i];