diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-02-21 13:51:43 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-02-21 13:51:43 +0000 |
commit | 3f4bde29a30d8c43db5cbe8f5541ebc5d1fdc6af (patch) | |
tree | 87140683fc3fee4e14b3c37e2aa7a4031d473f49 /lib/Target/X86/X86FrameLowering.cpp | |
parent | a322a4af1fe8b989fe5d1bbc15de8736a26c03ca (diff) | |
download | src-3f4bde29a30d8c43db5cbe8f5541ebc5d1fdc6af.tar.gz src-3f4bde29a30d8c43db5cbe8f5541ebc5d1fdc6af.zip |
Vendor import of llvm release_38 branch r261369:vendor/llvm/llvm-release_38-r261369
Notes
Notes:
svn path=/vendor/llvm/dist/; revision=295846
svn path=/vendor/llvm/llvm-release_38-r261369/; revision=295847; tag=vendor/llvm/llvm-release_38-r261369
Diffstat (limited to 'lib/Target/X86/X86FrameLowering.cpp')
-rw-r--r-- | lib/Target/X86/X86FrameLowering.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Target/X86/X86FrameLowering.cpp b/lib/Target/X86/X86FrameLowering.cpp index 7f8ce4768c00..f5ffe0cf7e88 100644 --- a/lib/Target/X86/X86FrameLowering.cpp +++ b/lib/Target/X86/X86FrameLowering.cpp @@ -192,10 +192,9 @@ static unsigned findDeadCallerSavedReg(MachineBasicBlock &MBB, return 0; } -static bool isEAXLiveIn(MachineFunction &MF) { - for (MachineRegisterInfo::livein_iterator II = MF.getRegInfo().livein_begin(), - EE = MF.getRegInfo().livein_end(); II != EE; ++II) { - unsigned Reg = II->first; +static bool isEAXLiveIn(MachineBasicBlock &MBB) { + for (MachineBasicBlock::RegisterMaskPair RegMask : MBB.liveins()) { + unsigned Reg = RegMask.PhysReg; if (Reg == X86::RAX || Reg == X86::EAX || Reg == X86::AX || Reg == X86::AH || Reg == X86::AL) @@ -261,7 +260,7 @@ void X86FrameLowering::emitSPUpdate(MachineBasicBlock &MBB, // load the offset into a register and do one sub/add unsigned Reg = 0; - if (isSub && !isEAXLiveIn(*MBB.getParent())) + if (isSub && !isEAXLiveIn(MBB)) Reg = (unsigned)(Is64Bit ? X86::RAX : X86::EAX); else Reg = findDeadCallerSavedReg(MBB, MBBI, TRI, Is64Bit); @@ -1133,8 +1132,8 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF, if (IsWin64Prologue && !IsFunclet && TRI->needsStackRealignment(MF)) AlignedNumBytes = RoundUpToAlignment(AlignedNumBytes, MaxAlign); if (AlignedNumBytes >= StackProbeSize && UseStackProbe) { - // Check whether EAX is livein for this function. - bool isEAXAlive = isEAXLiveIn(MF); + // Check whether EAX is livein for this block. + bool isEAXAlive = isEAXLiveIn(MBB); if (isEAXAlive) { // Sanity check that EAX is not livein for this function. |