llvm.org GIT mirror llvm / d48b38e
[Stackmaps][X86] Remove EFLAGS and IP registers from the live-out mask. Remove the EFLAGS from the stackmap live-out mask. The EFLAGS register is not supposed to be part of that set, because the X86 calling conventions mark the register as NOT preserved. Also remove the IP registers, since spilling and restoring those doesn't really make any sense. Related to rdar://problem/21019635. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239568 91177308-0d34-0410-b5e6-96231b3b80d8 Juergen Ributzka 5 years ago
2 changed file(s) with 18 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
416416 }
417417
418418 return Reserved;
419 }
420
421 void X86RegisterInfo::adjustStackMapLiveOutMask(uint32_t *Mask) const {
422 // Check if the EFLAGS register is marked as live-out. This shouldn't happen,
423 // because the calling convention defines the EFLAGS register as NOT
424 // preserved.
425 //
426 // Unfortunatelly the EFLAGS show up as live-out after branch folding. Adding
427 // an assert to track this and clear the register afterwards to avoid
428 // unnecessary crashes during release builds.
429 assert(!(Mask[X86::EFLAGS / 32] & (1U << (X86::EFLAGS % 32))) &&
430 "EFLAGS are not live-out from a patchpoint.");
431
432 // Also clean other registers that don't need preserving (IP).
433 for (auto Reg : {X86::EFLAGS, X86::RIP, X86::EIP, X86::IP})
434 Mask[Reg / 32] &= ~(1U << (Reg % 32));
419435 }
420436
421437 //===----------------------------------------------------------------------===//
103103 /// register scavenger to determine what registers are free.
104104 BitVector getReservedRegs(const MachineFunction &MF) const override;
105105
106 void adjustStackMapLiveOutMask(uint32_t *Mask) const override;
107
106108 bool hasBasePointer(const MachineFunction &MF) const;
107109
108110 bool canRealignStack(const MachineFunction &MF) const;