diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-12-20 19:53:05 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-12-20 19:53:05 +0000 |
| commit | 0b57cec536236d46e3dba9bd041533462f33dbb7 (patch) | |
| tree | 56229dbdbbf76d18580f72f789003db17246c8d9 /contrib/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp | |
| parent | 718ef55ec7785aae63f98f8ca05dc07ed399c16d (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp')
| -rw-r--r-- | contrib/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/contrib/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp b/contrib/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp deleted file mode 100644 index 0b4fcffbc655..000000000000 --- a/contrib/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp +++ /dev/null @@ -1,79 +0,0 @@ -//===-- XCoreMachineFunctionInfo.cpp - XCore machine function info --------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "XCoreMachineFunctionInfo.h" -#include "XCoreInstrInfo.h" -#include "llvm/CodeGen/TargetSubtargetInfo.h" -#include "llvm/IR/Function.h" - -using namespace llvm; - -void XCoreFunctionInfo::anchor() { } - -bool XCoreFunctionInfo::isLargeFrame(const MachineFunction &MF) const { - if (CachedEStackSize == -1) { - CachedEStackSize = MF.getFrameInfo().estimateStackSize(MF); - } - // isLargeFrame() is used when deciding if spill slots should be added to - // allow eliminateFrameIndex() to scavenge registers. - // This is only required when there is no FP and offsets are greater than - // ~256KB (~64Kwords). Thus only for code run on the emulator! - // - // The arbitrary value of 0xf000 allows frames of up to ~240KB before spill - // slots are added for the use of eliminateFrameIndex() register scavenging. - // For frames less than 240KB, it is assumed that there will be less than - // 16KB of function arguments. - return CachedEStackSize > 0xf000; -} - -int XCoreFunctionInfo::createLRSpillSlot(MachineFunction &MF) { - if (LRSpillSlotSet) { - return LRSpillSlot; - } - const TargetRegisterClass &RC = XCore::GRRegsRegClass; - const TargetRegisterInfo &TRI = *MF.getSubtarget().getRegisterInfo(); - MachineFrameInfo &MFI = MF.getFrameInfo(); - if (! MF.getFunction().isVarArg()) { - // A fixed offset of 0 allows us to save / restore LR using entsp / retsp. - LRSpillSlot = MFI.CreateFixedObject(TRI.getSpillSize(RC), 0, true); - } else { - LRSpillSlot = MFI.CreateStackObject(TRI.getSpillSize(RC), - TRI.getSpillAlignment(RC), true); - } - LRSpillSlotSet = true; - return LRSpillSlot; -} - -int XCoreFunctionInfo::createFPSpillSlot(MachineFunction &MF) { - if (FPSpillSlotSet) { - return FPSpillSlot; - } - const TargetRegisterClass &RC = XCore::GRRegsRegClass; - const TargetRegisterInfo &TRI = *MF.getSubtarget().getRegisterInfo(); - MachineFrameInfo &MFI = MF.getFrameInfo(); - FPSpillSlot = MFI.CreateStackObject(TRI.getSpillSize(RC), - TRI.getSpillAlignment(RC), true); - FPSpillSlotSet = true; - return FPSpillSlot; -} - -const int* XCoreFunctionInfo::createEHSpillSlot(MachineFunction &MF) { - if (EHSpillSlotSet) { - return EHSpillSlot; - } - const TargetRegisterClass &RC = XCore::GRRegsRegClass; - const TargetRegisterInfo &TRI = *MF.getSubtarget().getRegisterInfo(); - MachineFrameInfo &MFI = MF.getFrameInfo(); - unsigned Size = TRI.getSpillSize(RC); - unsigned Align = TRI.getSpillAlignment(RC); - EHSpillSlot[0] = MFI.CreateStackObject(Size, Align, true); - EHSpillSlot[1] = MFI.CreateStackObject(Size, Align, true); - EHSpillSlotSet = true; - return EHSpillSlot; -} - |
