- if (isLastUse(Reg, SlotIdx)) {
- if (isLive) {
- LiveRegs.erase(Reg);
- decreaseRegPressure(Reg);
- }
- } else if(!isLive) {
- // We discovered a live which was not last used here, adjust pressure.
- increaseRegPressure(Reg);
+ bool lastUse = false;
+ if (RequireIntervals) {
+ const LiveRange *LR = getLiveRange(Reg);
+ lastUse = LR && LR->Query(SlotIdx).isKill();
+ }
+ else {
+ // Allocatable physregs are always single-use before register rewriting.
+ lastUse = !TargetRegisterInfo::isVirtualRegister(Reg);
+ }
+ if (lastUse && isLive) {
+ LiveRegs.erase(Reg);
+ decreaseRegPressure(Reg);